Re: why not inline all functions?

Thomas Niemann <portland@uswest.net>
11 Jun 1998 17:00:10 -0400

          From comp.compilers

Related articles
why not inline all functions? sanvitam@std.teradyne.com (Mark Sanvitale) (1998-06-09)
Re: why not inline all functions? cliff.click@Eng.Sun.COM (Clifford Click) (1998-06-11)
Re: why not inline all functions? p.toland@computer.org (Phillip Toland) (1998-06-11)
Re: why not inline all functions? f81@ix.urz.uni-heidelberg.de (Joerg Schoen) (1998-06-11)
Re: why not inline all functions? bje@cygnus.com (Ben Elliston) (1998-06-11)
Re: why not inline all functions? ayers@incert.com (Andy Ayers) (1998-06-11)
Re: why not inline all functions? mcdirmid@beaver.cs.washington.edu (1998-06-11)
Re: why not inline all functions? portland@uswest.net (Thomas Niemann) (1998-06-11)
Re: why not inline all functions? wclodius@aol.com (1998-06-11)
Re: why not inline all functions? ian@five-d.com (1998-06-18)
inlining + optimization = nuisance bugs qjackson@wave.home.com (Quinn Tyler Jackson) (1998-06-18)
Re: why not inline all functions? hawa@celsiustech.se (Hans Walheim) (1998-06-18)
Re: inlining + optimization = nuisance bugs bill@amber.ssd.csd.harris.com (1998-06-19)
Re: inlining + optimization = nuisance bugs acoetmeur@icdc.caissedesdepots.fr (Alain Coetmeur) (1998-06-24)
| List of all articles for this month |

From: Thomas Niemann <portland@uswest.net>
Newsgroups: comp.compilers
Date: 11 Jun 1998 17:00:10 -0400
Organization: Compilers Central
References: 98-06-032
Keywords: optimize, practice

I worked on compilers for Prime and Apollo in the 80's, and implemented
procedure inlining for both. For testing, I tried to inline
everything. I recall one program that seemingly "hung" the compiler.
Being persistent, I let it compile overnight. It finally did, and
executed properly. On inspection, the call graph for the code resembled
a binary tree, and quickly resulted in a huge program that took hours to
compile. The final released product tried to determine good candidates
for inlining (another topic). As I recall, we didn't expand recursive
routines, though we could have inlined a few times.


Large programs not only take a long time to compile, but may incurr
excessive paging, as there may be insufficient memory to hold the
executable. The big win obtained from inlining is due to optimization.
Inlining a procedure exposes the procedure's body to the surrounding
code, allowing for classical optimizations to take place. One of the
benchmarks in our test suite terminated with a divide-by-zero exception
after inlining. A matrix-multiplication function was inlined. The
optimizer could then determine that there was no use of the calculation,
so the code was eliminated. Thus, it took zero time to do the
calculation. The divide-by-zero error occurred when dividing elapsed
time into a constant. At any rate, we had qualms about reporting
benchmark figures for such a result.
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.