Re: When to do inline expansion

jfc@athena.mit.edu (John F Carr)
Tue, 21 Sep 1993 14:31:04 GMT

          From comp.compilers

Related articles
When to do inline expansion jhall@whale.WPI.EDU (1993-09-14)
Re: When to do inline expansion zstern@adobe.com (1993-09-20)
Re: When to do inline expansion salomon@silver.cs.umanitoba.ca (1993-09-20)
Re: When to do inline expansion davidm@questor.rational.com (1993-09-20)
Re: When to do inline expansion jfc@athena.mit.edu (1993-09-21)
Re: When to do inline expansion jgmorris+@cs.cmu.edu (1993-09-21)
Re: When to do inline expansion jdean@bergen.cs.washington.edu (1993-09-21)
Re: When to do inline expansion salomon@silver.cs.umanitoba.ca (1993-09-22)
Re: When to do inline expansion preston@dawn.cs.rice.edu (1993-09-22)
Re: When to do inline expansion cliffc@rice.edu (1993-09-22)
Re: When to do inline expansion rfg@netcom.com (1993-09-25)
[1 later articles]
| List of all articles for this month |

Newsgroups: comp.compilers
From: jfc@athena.mit.edu (John F Carr)
Keywords: optimize
Organization: Massachusetts Institute of Technology
References: 93-09-063 93-09-069
Date: Tue, 21 Sep 1993 14:31:04 GMT

zstern@adobe.com (Zalman Stern) writes:
>If it is called precisely once in the program, the function should be
>inlined no matter what.


I disagree. Some cases where inlining may hurt:


. the inlined function is so complex that it needs more registers
than are available at the point of inlining


Are there any commercial compilers which do not allocate a value to the
same register over its entire live range, but instead will save it on
the stack in those blocks where the value is live but not accessed and
it would be benficial to let another value use that register? This would
reduce the number of extra registers needed to inline a function.


. the inlined function is infrequently executed


Some potential costs of inlining an infrequently executed function: more
registers to save and restore; more I-cache and TLB misses in the normal
path; less optimization due to increased code complexity (depending on the
compiler).


--
        John Carr (jfc@athena.mit.edu)
--


Post a followup to this message

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