This is the mail archive of the gcc@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: Inlining heuristics for C++


Mark Mitchell wrote:
> 
> --On Monday, July 09, 2001 09:46:59 PM -0400 Daniel Berlin
> <dan@cgsoftware.com> wrote:

> I think your ideas are reasonable.  Nathan Sidwell has been thinking
> about these issues, too; you should coordinate with him to try to
> get some decent ideas and some decent measurements.
Yes, and I'm making good progress. I have significantly reduced the
compile time time and memory requirements. One of Geralds test cases now
takes 112MB and 87 seconds instead of 279MB and 1133 seconds (that went
into swap, hence the huge time dilation). The produced executable is also
much smaller. The downside is that the resultant executable does not
always go faster.

Reading some inlining papers suggests that the 'inline until too big'
heuristic is not sensible. A % increase might be better. I'm trying
the following heuristics,
	inline until too big (current one)
	inline all smaller than X
	inline until too expanded
	inline all smaller than X% of target fn

Note that my algorithm does a bottom up inlining, so we don't get problems
with unbounded inlining of small functions.

I don't delay inlining until the end of the compilation unit. Doing that
would not be difficult, and then one could generate the complete call
graph and potentially do a better job (it would not invalidate the work
I'm doing, which is good).

I'd guess I'll have something postable by the end of the week. Dan, if you
can wait 'til then, that'd be great!

nathan
-- 
Dr Nathan Sidwell   ::   http://www.codesourcery.com   ::   CodeSourcery LLC
         'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org


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