This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] New c++ inliner
- To: Nathan Sidwell <nathan at codesourcery dot com>
- Subject: Re: [PATCH] New c++ inliner
- From: Jason Merrill <jason_merrill at redhat dot com>
- Date: 16 Jul 2001 13:54:29 +0100
- Cc: gcc-patches at gcc dot gnu dot org, Gerald Pfeifer <pfeifer at dbai dot tuwien dot ac dot at>, mark at codesourcery dot com, Daniel Berlin <dan at cgsoftware dot com>
- References: <3B4F1363.4BB4F5C5@codesourcery.com>
>>>>> "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