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]

Re: [PATCH] New c++ inliner


>>>>> "Nathan" == Nathan Sidwell <nathan@codesourcery.com> writes:

Great!

> Q) What about mutual & direct recursion?
> A) Recursion is detected in step 3 by keeping a stack of the functions
> being optimized. We check for a loop. If one is found, we have to decide
> where to break the recursion i.e. which inlinable function do we _not_
> inline. I pick the largest function, as that has the least chance
> of being inlinable. [Actually, I should tweak that to highest cost]

Thoughts:

It seems to me that in some cases we should expand recursive functions a
few times as well, like loop unrolling.

Another useful heuristic might be to lower the measured cost of calls with
constant parameters.

Another might be to raise the cost of functions with loops in them.

FWIW.

Jason


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