This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Enable -fweb and -frename-registers when unrolling


> > 2005-07-15  Steve Ellcey  <sje@cup.hp.com>
> > 
> > 	* common.opt (frename-registers): Initialize to 2.
> > 	(fweb): Ditto.
> > 	* toplev.c (AUTODETECT_FLAG_VAR_TRACKING): Rename to AUTODETECT_VALUE.
> > 	(process_options): Only change flag_web and flag_rename_registers
> > 	it not explicitly set by user.
> 
> Looks sensible.  Might as well do the same for rerun_cse_after_loop 
> while you're there.  Preapproved in either form.
> 
> 
> Bernd

Thanks, here is the final patch (with rerun_cse_after_loop) that I will
check in.


2005-07-18  Steve Ellcey  <sje@cup.hp.com>

	* common.opt (frename-registers): Initialize to 2.
	(fweb): Ditto.
	(fgcse-after-reload): Ditto.
	* toplev.c (AUTODETECT_FLAG_VAR_TRACKING): Rename to AUTODETECT_VALUE.
	(process_options): Only change flag_web, flag_rename_registers,
	and flag_rerun_cse_after_loop if not explicitly set by user.


*** gcc.orig/gcc/common.opt	Fri Jul 15 13:35:24 2005
--- gcc/gcc/common.opt	Mon Jul 18 11:21:05 2005
*************** Perform redundant load after store elimi
*** 431,437 ****
  elimination
  
  fgcse-after-reload
! Common Report Var(flag_gcse_after_reload)
  Perform global common subexpression elimination after register allocation
  has finished
  
--- 431,437 ----
  elimination
  
  fgcse-after-reload
! Common Report Var(flag_gcse_after_reload) Init(2)
  Perform global common subexpression elimination after register allocation
  has finished
  
*************** Common Report Var(flag_regmove)
*** 662,668 ****
  Enables a register move optimization
  
  frename-registers
! Common Report Var(flag_rename_registers)
  Perform a register renaming optimization pass
  
  freorder-blocks
--- 662,668 ----
  Enables a register move optimization
  
  frename-registers
! Common Report Var(flag_rename_registers) Init(2)
  Perform a register renaming optimization pass
  
  freorder-blocks
*************** Common Report Var(flag_value_profile_tra
*** 999,1005 ****
  Use expression value profiles in optimizations
  
  fweb
! Common Report Var(flag_web) Init(0)
  Construct webs and split unrelated uses of single variable
  
  fwhole-program
--- 999,1005 ----
  Use expression value profiles in optimizations
  
  fweb
! Common Report Var(flag_web) Init(2)
  Construct webs and split unrelated uses of single variable
  
  fwhole-program
*** gcc.orig/gcc/toplev.c	Fri Jul 15 13:35:29 2005
--- gcc/gcc/toplev.c	Mon Jul 18 11:41:48 2005
*************** location_t unknown_location = { NULL, 0 
*** 145,151 ****
  
  /* Used to enable -fvar-tracking, -fweb and -frename-registers according
     to optimize and default_debug_hooks in process_options ().  */
! #define AUTODETECT_FLAG_VAR_TRACKING 2
  
  /* Current position in real source file.  */
  
--- 145,151 ----
  
  /* Used to enable -fvar-tracking, -fweb and -frename-registers according
     to optimize and default_debug_hooks in process_options ().  */
! #define AUTODETECT_VALUE 2
  
  /* Current position in real source file.  */
  
*************** rtx stack_limit_rtx;
*** 334,342 ****
  int flag_renumber_insns = 1;
  
  /* Nonzero if we should track variables.  When
!    flag_var_tracking == AUTODETECT_FLAG_VAR_TRACKING it will be set according
     to optimize, debug_info_level and debug_hooks in process_options ().  */
! int flag_var_tracking = AUTODETECT_FLAG_VAR_TRACKING;
  
  /* True if the user has tagged the function with the 'section'
     attribute.  */
--- 334,342 ----
  int flag_renumber_insns = 1;
  
  /* Nonzero if we should track variables.  When
!    flag_var_tracking == AUTODETECT_VALUE it will be set according
     to optimize, debug_info_level and debug_hooks in process_options ().  */
! int flag_var_tracking = AUTODETECT_VALUE;
  
  /* True if the user has tagged the function with the 'section'
     attribute.  */
*************** process_options (void)
*** 1531,1544 ****
      flag_unroll_loops = 1;
  
    /* The loop unrolling code assumes that cse will be run after loop.
!      Also enable -fweb and -frename-registers that help scheduling
!      the unrolled loop.  */
!   if (flag_unroll_loops || flag_peel_loops)
!     {
!       flag_rerun_cse_after_loop = 1;
!       flag_web = 1;
!       flag_rename_registers = 1;
!     }
  
    /* If explicitly asked to run new loop optimizer, switch off the old
       one.  */
--- 1531,1544 ----
      flag_unroll_loops = 1;
  
    /* The loop unrolling code assumes that cse will be run after loop.
!      web and rename-registers also help when run after loop unrolling.  */
! 
!   if (flag_rerun_cse_after_loop == AUTODETECT_VALUE)
!     flag_rerun_cse_after_loop = flag_unroll_loops || flag_peel_loops;
!   if (flag_web == AUTODETECT_VALUE)
!     flag_web = flag_unroll_loops || flag_peel_loops;
!   if (flag_rename_registers == AUTODETECT_VALUE)
!     flag_rename_registers = flag_unroll_loops || flag_peel_loops;
  
    /* If explicitly asked to run new loop optimizer, switch off the old
       one.  */
*************** process_options (void)
*** 1693,1703 ****
        flag_var_tracking = 0;
      }
  
!   if (flag_rename_registers == AUTODETECT_FLAG_VAR_TRACKING)
      flag_rename_registers = default_debug_hooks->var_location
  	    		    != do_nothing_debug_hooks.var_location;
  
!   if (flag_var_tracking == AUTODETECT_FLAG_VAR_TRACKING)
      flag_var_tracking = optimize >= 1;
  
    /* If auxiliary info generation is desired, open the output file.
--- 1693,1703 ----
        flag_var_tracking = 0;
      }
  
!   if (flag_rename_registers == AUTODETECT_VALUE)
      flag_rename_registers = default_debug_hooks->var_location
  	    		    != do_nothing_debug_hooks.var_location;
  
!   if (flag_var_tracking == AUTODETECT_VALUE)
      flag_var_tracking = optimize >= 1;
  
    /* If auxiliary info generation is desired, open the output file.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]