[RFC/patch] Callgraph based inlining heuristics
Jan Hubicka
jh@suse.cz
Mon Jun 23 16:21:00 GMT 2003
> >and possibly tree-optimize the to-be inlined function (with its current
> >parameters) before applying any heuristics. Of course this will be
> >
> In fact, the weird thing about unit-at-a-time is that it changes the
> current behavior of tree-ssa in a peculiar way. With -finline-functions
> when not in unit-at-a-time mode, each function is first tree-optimized
> and then deferred and later inlined. With unit-at-a-time, the functions
> are first deferred, then inlined, and tree-optimizing them is the final
> step. So _without_ unit-at-a-time, we inline optimized function bodies,
> but _with_ unit-at-a-time we do not!
Why not hook tree-SSA work into the unit-at-a-time driver? The code is
supposed to drive how the compilation works and when the code is
optimized.
Early tree-ssa optimization is supposed to happen at the same time
frontend hook lower_function is called (lower_function is called so
because I had gimplifying in the mind) and the late optimization after
inlining is done is supposed to happen inside cgraph_optimize_function.
I can try to send the patch for this once I am done with the other work
that is currently making me so busy.
>
> Ideally we would tree-optimize first (allowing better estimates of the
> function size) and then defer for unit-at-a-time, but there were some
> issues with C++, GIMPLE and unit-at-a-time which I didn't quite
> understand but which seemed to be the reason why C++ unit-at-a-time took
> so long to implement. Again, Honza? ;-)
Hmm, the reason why it took so long to implement is that C++ is funny
language and I had very little understanding of the frontend when I
started :(
With the current tree-ssa branch you don't have unit-at-a-time C++ at
all, so you can't do it, but still you can do it for C.
Honza
>
> >expensive. But at -O4 I'll pay this price if the result is good.
> >
>
> Yup.
>
> Gr.
> Steven
>
>
>
More information about the Gcc
mailing list