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, pretty-ipa merge 2/4] New option and timevar.


Hi,

On Sun, Jun 28, 2009 at 03:06:54PM +0200, Richard Guenther wrote:
> On Wed, 24 Jun 2009, Martin Jambor wrote:
> 
> > Hi,
> > 
> > this patch adds an option for IPA-SRA, its description in the user
> > manual and a new timevar for the pass.
> 
> Why is this "early-ipa-sra" and not ipa-sra?  I think the user
> shouldn't need to care and if he should then the difference between
> early ipa-sra and non-early ipa-sra needs to be explained.
> 

Hm, fair enough.  I thought it might be useful for us, but thinking
about it again, this is a different situation from inlining.

So, the (yet untested) patch below is what I propose now and what I
will use in further development and tests.

Thanks,

Martin


2009-07-01  Martin Jambor  <mjambor@suse.cz>

	* common.opt (fipa-sra): New switch.
	* opts.c (decode_options): Turn flag_ipa_sra on for opt2.
	* timevar.def (TV_IPA_SRA): New timevar.
	* doc/invoke.texi: Document -fipa-sra.


Index: mine/gcc/common.opt
===================================================================
--- mine.orig/gcc/common.opt
+++ mine/gcc/common.opt
@@ -486,6 +486,10 @@ feliminate-dwarf2-dups
 Common Report Var(flag_eliminate_dwarf2_dups)
 Perform DWARF2 duplicate elimination
 
+fipa-sra
+Common Report Var(flag_ipa_sra) Init(0) Optimization
+Perform interprocedural reduction of aggregates
+
 feliminate-unused-debug-symbols
 Common Report Var(flag_debug_only_used_symbols)
 Perform unused type elimination in debug info
Index: mine/gcc/opts.c
===================================================================
--- mine.orig/gcc/opts.c
+++ mine/gcc/opts.c
@@ -894,6 +894,7 @@ decode_options (unsigned int argc, const
   flag_tree_pre = opt2;
   flag_tree_switch_conversion = 1;
   flag_ipa_cp = opt2;
+  flag_ipa_sra = opt2;
 
   /* Track fields in field-sensitive alias analysis.  */
   set_param_value ("max-fields-for-field-sensitive",
Index: mine/gcc/timevar.def
===================================================================
--- mine.orig/gcc/timevar.def
+++ mine/gcc/timevar.def
@@ -46,6 +46,7 @@ DEFTIMEVAR (TV_IPA_REFERENCE         , "
 DEFTIMEVAR (TV_IPA_PURE_CONST        , "ipa pure const")
 DEFTIMEVAR (TV_IPA_TYPE_ESCAPE       , "ipa type escape")
 DEFTIMEVAR (TV_IPA_PTA               , "ipa points-to")
+DEFTIMEVAR (TV_IPA_SRA               , "ipa SRA")
 /* Time spent by constructing CFG.  */
 DEFTIMEVAR (TV_CFG                   , "cfg construction")
 /* Time spent by cleaning up CFG.  */
Index: mine/gcc/doc/invoke.texi
===================================================================
--- mine.orig/gcc/doc/invoke.texi
+++ mine/gcc/doc/invoke.texi
@@ -333,7 +333,7 @@ Objective-C and Objective-C++ Dialects}.
 -fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules -fcx-limited-range @gol
 -fdata-sections -fdce -fdce @gol
 -fdelayed-branch -fdelete-null-pointer-checks -fdse -fdse @gol
--fearly-inlining -fexpensive-optimizations -ffast-math @gol
+-fearly-inlining -fipa-sra -fexpensive-optimizations -ffast-math @gol
 -ffinite-math-only -ffloat-store -fexcess-precision=@var{style} @gol
 -fforward-propagate -ffunction-sections @gol
 -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm @gol
@@ -5609,6 +5609,7 @@ also turns on the following optimization
 -fexpensive-optimizations @gol
 -fgcse  -fgcse-lm  @gol
 -findirect-inlining @gol
+-fipa-sra @gol
 -foptimize-sibling-calls @gol
 -fpeephole2 @gol
 -fregmove @gol
@@ -5769,6 +5770,16 @@ having large chains of nested wrapper fu
 
 Enabled by default.
 
+@item -fipa-sra
+@opindex fipa-sra
+Perform interprocedural scalar replacement of aggregates and other
+forms of call regularization.  This will change parameters of
+functions when deemed profitable by passing arguments by value instead
+by reference, passing only a part of an aggregate or removing an
+unused argument altogether.
+
+Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
+
 @item -finline-limit=@var{n}
 @opindex finline-limit
 By default, GCC limits the size of functions that can be inlined.  This flag


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