|why not inline all functions? firstname.lastname@example.org (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? email@example.com (Phillip Toland) (1998-06-11)|
|Re: why not inline all functions? firstname.lastname@example.org (Joerg Schoen) (1998-06-11)|
|Re: why not inline all functions? email@example.com (Ben Elliston) (1998-06-11)|
|Re: why not inline all functions? firstname.lastname@example.org (Andy Ayers) (1998-06-11)|
|Re: why not inline all functions? email@example.com (1998-06-11)|
|Re: why not inline all functions? firstname.lastname@example.org (Thomas Niemann) (1998-06-11)|
|Re: why not inline all functions? email@example.com (1998-06-11)|
|Re: why not inline all functions? firstname.lastname@example.org (1998-06-18)|
|Re: why not inline all functions? email@example.com (Hans Walheim) (1998-06-18)|
|RE: why not inline all functions firstname.lastname@example.org (Quinn Tyler Jackson) (1998-06-19)|
|Re: why not inline all functions email@example.com (David Chase) (1998-06-19)|
|[1 later articles]|
|From:||firstname.lastname@example.org (Sean McDirmid)|
|Date:||11 Jun 1998 16:59:26 -0400|
|Organization:||Computer Science & Engineering, U of Washington, Seattle|
Mark Sanvitale (email@example.com) wrote:
: Now, a "inline everything" scheme might run into some roadblocks when
: it comes to external functions which are resolved at link time and the
: notion of dynamic linking is not compatible with such a method.
: Still, I think compilers should try to inline every function it can
: without depending on the programmer to specify a function as "inline"
Hmm, you forgot to mention recursive functions and virtual methods in
C++. In C++, sometimes you execute a method that can only be determined
at runtime. That's why, if you "inline" a method that can be invoked
virtually, the compiler will probably just compile it to a function for
Of course, there are tools like Vortex that are attempting to solve this
problem through extreme global analysis. See:
: Perhaps compilers already take advantage of the idea I have outlined or
: perhaps there are some problems with the idea which I don't know about
: (an old C++ book I have says, "Compiler limits prevent complicated
: functions from being inlined," but no further explanation is given.
Over "inlining" leads to greater code bloat. This could adversely affect
your instruction cache (or maybe not...). Whenever you optimize here, you
might deoptimize somewhere else (isn't computer science fun!).
: What do you all think?
: NOTE - During my quest for a CS degree I did not have the chance to take
: a compilers course (it was a tech elective which never fit in my
: schedule) so if my assertion is totally pointless please just point out
: the reason I am wrong and spare me the "Are you stupid/crazy/lost"
: comments. In the area of compilers I admit to being fairly ignorant (as
: far as professional programmers go).
A compilers course probably would not have gone into these issues. Maybe
an architecture course...
Return to the
Search the comp.compilers archives again.