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]

[PATCH 2/5] New option, parameter and timevar.


Hi,

this  patch adds an option and a parameter for IPA-SRA, their
description in the user manual and a new timevar for the pass.

I have tested this separately with make pdf.

Thanks,

Martin



2009-07-09  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.
	* params.def (ipa-sra-ptr-growth-factor): New parameter.
	* doc/invoke.texi: Document -fipa-sra and ipa-sra-ptr-growth-factor.


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
@@ -897,6 +897,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
@@ -334,7 +334,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
@@ -5631,6 +5631,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
@@ -5791,6 +5792,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
@@ -8090,6 +8101,12 @@ with more basic blocks than this paramet
 motion optimization performed on them.  The default value of the
 parameter is 1000 for -O1 and 10000 for -O2 and above.
 
+@item ipa-sra-ptr-growth-factor
+IPA-SRA will replace a pointer to an aggregate with one or more new
+parameters only when their cumulative size is less or equal to
+@option{ipa-sra-ptr-growth-factor} times the size of the original
+pointer parameter.
+
 @end table
 @end table
 
Index: mine/gcc/params.def
===================================================================
--- mine.orig/gcc/params.def
+++ mine/gcc/params.def
@@ -752,6 +752,12 @@ DEFPARAM (PARAM_PREFETCH_MIN_INSN_TO_MEM
 	  "min. ratio of insns to mem ops to enable prefetching in a loop",
 	  3, 0, 0)
 
+DEFPARAM (PARAM_IPA_SRA_PTR_GROWTH_FACTOR,
+	  "ipa-sra-ptr-growth-factor",
+	  "maximum allowed growth of size of new parameters ipa-sra replaces "
+	  "a pointer to an aggregate with",
+	  2, 0, 0)
+
 /*
 Local variables:
 mode:c


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