Handle flattening in early inliner
Jan Hubicka
hubicka@ucw.cz
Sun Apr 18 18:02:00 GMT 2010
> On Sun, Apr 18, 2010 at 1:44 AM, Jan Hubicka <hubicka@ucw.cz> wrote:
> > Hi,
> > this patch makes early inliner to handle flattening (that is flatten as much as
> > it can leaving rest of work for late inliner). Â This helps to get more realistic
> > profiles on flattended nodes and also more effective profiling and profile feedback.
> >
> > Bootstrapped/regtested x86_64-linux, comitted.
> >
> > Â Â Â Â * ipa-inline.c (cgraph_early_inlining): Handle flattening too.
> > Index: ipa-inline.c
> > ===================================================================
> > --- ipa-inline.c     (revision 158462)
> > +++ ipa-inline.c     (working copy)
> > @@ -1667,6 +1667,17 @@ cgraph_early_inlining (void)
> > Â Â }
> > Â else
> > Â Â {
> > + Â Â Â if (lookup_attribute ("flatten",
> > + Â Â Â Â Â Â Â Â Â Â Â Â Â DECL_ATTRIBUTES (node->decl)) != NULL)
> > + Â Â Â {
> > + Â Â Â Â if (dump_file)
> > + Â Â Â Â Â fprintf (dump_file,
> > + Â Â Â Â Â Â Â Â Â Â "Flattening %s\n", cgraph_node_name (node));
> > + Â Â Â Â cgraph_flatten (node);
> > + Â Â Â Â timevar_push (TV_INTEGRATION);
> > + Â Â Â Â todo |= optimize_inline_calls (current_function_decl);
> > + Â Â Â Â timevar_pop (TV_INTEGRATION);
> > + Â Â Â }
>
> you should be able to skip the following code for non-flatten
> functions. Thus place it in else { .. }.
The following code handle inlining of indirect calls via iteration, so I
decided to keep it so "flatten" decorated functions won't end up with less
inlining than non-flatten decorated ones (i.e. I am trying those attributes to
monotonously increase amount of inlining in general as that is what they are
supposed to do). But it is not big deal.
Honza
>
> Richard.
>
> > Â Â Â /* We iterate incremental inlining to get trivial cases of indirect
> > Â Â Â Â inlining. Â */
> > Â Â Â while (iterations < PARAM_VALUE (PARAM_EARLY_INLINER_MAX_ITERATIONS)
> >
More information about the Gcc-patches
mailing list