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: [RFA] Limit stack usage growth caused by inliner


> On 11/6/06, Jan Hubicka <jh@suse.cz> wrote:
> >I tried the idea of summing sizes and on tramp3d it increases average
> >stack frame estimate for functions with non-zero stack usage 3 times, so
> >it is probably good idea to use the packing algorithm as for C++ there
> >seems to be something to pack...
> 
> I'm sure that it's a good idea from the can-pack POV.  But did you
> also compare compile times?

I've run it on Gerald's testcase (tramp3d for some reason no longer
compiles for me on current mainline) with timmer added and I get 0%,
0.02 seconds on packing.
Also I've run bootstrap time and measured no difference (in fact new
time was 10 seconds lower, but I doubt my patch is making compilation
any faster).
Do you know of testcases where the packing misbehave?  It ought to be
easy to trim it down.
I would rather avoid GIGO principe on stuff inliner uses for inlining
decision - if we fork the estimate, we will risk of having it very wrong
without really noticing the problem as inliner problems manifest
themselves only in incredibly complex testcases.

Does the attached patch look like good idea so we keep eye on varpacking
behaviour?

Honza

Index: timevar.def
===================================================================
--- timevar.def	(revision 118482)
+++ timevar.def	(working copy)
@@ -126,6 +126,7 @@ DEFTIMEVAR (TV_CONTROL_DEPENDENCES   , "
 DEFTIMEVAR (TV_OVERLOAD              , "overload resolution")
 DEFTIMEVAR (TV_TEMPLATE_INSTANTIATION, "template instantiation")
 DEFTIMEVAR (TV_EXPAND		     , "expand")
+DEFTIMEVAR (TV_VAR_PACK		     , "var packing")
 DEFTIMEVAR (TV_VARCONST              , "varconst")
 DEFTIMEVAR (TV_JUMP                  , "jump")
 DEFTIMEVAR (TV_FWPROP                , "forward prop")
Index: cfgexpand.c
===================================================================
--- cfgexpand.c	(revision 118482)
+++ cfgexpand.c	(working copy)
@@ -954,6 +1118,7 @@ expand_used_vars (void)
 {
   tree t, outer_block = DECL_INITIAL (current_function_decl);
 
+  timevar_push (TV_VAR_PACK);
   /* Compute the phase of the stack frame for this function.  */
   {
     int align = PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT;
@@ -1077,6 +1226,7 @@ expand_used_vars (void)
 	frame_offset += align - 1;
       frame_offset &= -align;
     }
+  timevar_pop (TV_VAR_PACK);
 }
 
 
> 
> Gr.
> Steven


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