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


On Monday 18 July 2005 22:47, Steve Ellcey wrote:
> > > 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.

Ehm...  rerun_cse_after_loop, or gcse-after-reload?

> 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.

This causes (or probably, uncovers) PR23095.

> *** 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

Here you set flag_gcse_after_reload to AUTODETECT_VALUE, but you never
check if this flag is later on set by a user option.  As a result, you
have enabled GCSE after reload by default, unconditionally, at -O1 and
up (because the flag is never zero).  It is amazing that this didn't
break anything else, but I don't think post-reload GCSE has received
this much testing before ;-)


> *************** 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

You never set flag_rerun_cse_after_loop to AUTODETECT_VALUE in common.opt.

I believe you intended to do this:
===================================================================
Index: gcc/common.opt
===================================================================
RCS file: /cvs/gcc/gcc/gcc/common.opt,v
retrieving revision 1.80
diff -u -r1.80 common.opt
--- gcc/common.opt      18 Jul 2005 21:14:19 -0000      1.80
+++ gcc/common.opt      31 Jul 2005 16:38:06 -0000
@@ -431,7 +431,7 @@
 elimination

 fgcse-after-reload
-Common Report Var(flag_gcse_after_reload) Init(2)
+Common Report Var(flag_gcse_after_reload)
 Perform global common subexpression elimination after register allocation
 has finished

@@ -690,7 +690,7 @@
 Reorder functions to improve code placement

 frerun-cse-after-loop
-Common Report Var(flag_rerun_cse_after_loop)
+Common Report Var(flag_rerun_cse_after_loop) Init(2)
 Add a common subexpression elimination pass after loop optimizations

 frerun-loop-opt
===================================================================

It's still interesting that gcse-after-reload breaks reg-stack.  Let's
see if we can figure out why...

Gr.
Steven


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