Re: Is inlining evil?

Marc Sabatella <>
Wed, 8 May 91 11:17:59 mdt

          From comp.compilers

Related articles
Is inlining evil? (Michael K. Gschwind) (1991-05-03)
Re: Is inlining evil? hoelzle@neon.Stanford.EDU (1991-05-04)
Re: Is inlining evil? (1991-05-04)
Re: Is inlining evil? (Clark Williams) (1991-05-05)
Re: Is inlining evil? (Marc Sabatella) (1991-05-08)
| List of all articles for this month |

Newsgroups: comp.compilers
From: Marc Sabatella <>
Keywords: optimize, design
Organization: Compilers Central
References: <>
Date: Wed, 8 May 91 11:17:59 mdt

Preston makes some good points about "naive inlining". But there is no
particular reason inlining need be so naive. The HP-UX C and Fortran
compilers for 680x0 do inlining under +O3, and the programmer is offered
considerable control over the inlining process via command line options
and compiler directives. The default for +O3 is to inline any function
that is under a certain size, but that measurement is made before any of
its own calls are inlined, so you can easily end up with a sort of
combinatorial explosion. However, you can set the size limit, also you
can (via directive) turn on or off inlining for a particular function, and
you can even turn off the inlining at the point of call, so that some
calls to a given function are inlined and others aren't. You can also
control whether standalone code for the function should also be emitted
(to allow external calls).

My own experience on a small but very "real" program is that after spending
a day or two experimenting, figuring out which calls to inline and which not
to, I ended up with a program that was 10% larger and 10% faster, and I
considered the whole deal to be a fair tradeoff of my time, run time, and

Marc Sabatella (

Post a followup to this message

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