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: [tree-profiling] Fix some leftouts of previous patch


On Dec 8, 2004, at 3:10 PM, Andrew Pinski wrote:
On Dec 8, 2004, at 5:55 PM, Jan Hubicka wrote:
Hi,
this patch fix the frequency updating issues (I will still keep the
frequency updating around as I am not quite sure how we will want to
deal with the estimated profiles once available yet) and it also avoid
recursive inlining that helps some benchmarks.


Could back port the recursive inlining part to the mainline since I see that
we recursive inlining functions on the mainline which is a regression from
3.4.0?

It's a regression in some cases and an improvement in others, as usual with
changes to heuristics. Consider everybody's favorite CS 101 example of recursion:


unsigned int factorial(unsigned int x) { return (x==0) ? 1 : x*factorial(x-1); }

Inlining factorial(4) enough that all the calls go away is a clear win.
(It may be that most of the wins come in cases that shouldn't have been
written as recursion in the first place, like this one, but users do things
like that.)


I'm not saying this is necessarily a bad idea, but we should have more data.
I know of 1 case in SPEC where recursive inlining is a win (like the
factorial case, the recursion terminates in a couple of levels, and you
wind up with a leaf function). I don't know of any where it's a loss, but it
sounds like Jan might.



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