tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: inline (Was: Bloat)



On Wed, Feb 11, 2009 at 08:10:01PM +1100, Andrew Reilly wrote:
 > In particular, a global optimizer should automatically inline
 > any functions that are only called once irrespective of how
 > large they are.

It's never quite that simple... for example, inlining a big and rarely
called function into the main body of a frequently run loop is a big
lose. Most of the time.

The biggest problem with doing global optimization is structural: in
Unix the compiler is expected to behave a certain way with respect to
object files, and object files have a fixed format and well known
semantics. But to do global optimization you'd far rather have access
to the compiler's intermediate representation, or at least parts of it
or information derived from it. Working out and deploying a suitable
compromise is probably at least as difficult as writing the actual
code-munging tools.

-- 
David A. Holland
dholland%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index