Advertisement

Inline expansion: When and how?

  • Manuel Serrano
Program Analysis
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1292)

Abstract

Inline function expansion is an optimization that may improve program performance by removing calling sequences and enlarging the scope of other optimizations. Unfortunately it also has the drawback of enlarging programs. This might impair executable programs performance. In order to get rid of this annoying effect, we present, an easy to implement, inlining optimization that minimizes code size growth by combining a compile-time algorithm deciding when expansion should occur with different expansion frameworks describing how they should be performed. We present the experimental measures that have driven the design of inline function expansion. We conclude with measurements showing that our optimization succeeds in producing faster codes while avoiding code size increase.

Keywords

Compilation Optimization Inlining Functional languages 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    A. Appel. Compiling with continuations. Cambridge University Press, 1992.Google Scholar
  2. 2.
    A. Appel. Loop Headers in λ-calculus or CPS. Lisp and Symbolic Computation, 7:337–343, December 1994.Google Scholar
  3. 3.
    H. Baker. Inlining Semantics for Subroutines which are recursive. ACM Sigplan Notices, 27(12):39–46, December 1992.Google Scholar
  4. 4.
    C. Chambers. The Design and Implementation of the SELF Compiler, an Optimizing Compiler for Object-Oriented Programming Languages. Technical report stan-cs-92-1240, Stanford University, Departement of Computer Science, March 1992.Google Scholar
  5. 5.
    K. Cooper, M. Hall, and L. Torczon. Unexpected Side Effects of Inline Substitution: A Case Study. ACM Letters on Programming Languages and Systems, 1(1):22–31, 1992.Google Scholar
  6. 6.
    J. Davidson and A. Holler. Subprogram Inlining: A Study of its Effects on Program Execution Time. IEEE Transactions on Software Engineering, 18(2):89–101, February 1992.Google Scholar
  7. 7.
    J. Dean and C. Chambers. Towards Better Inlining Decisions Using Inlining Trials. In Conference on Lisp and Functional Programming, pages 273–282, Orlando, Florida, USA, June 1994.Google Scholar
  8. 8.
    W. Hwu and P. Chang. Inline Function Expansion for Compiling C Programs. In Conference on Programming Language Design and Implementation, Portland, Oregon, USA, June 1989. ACM.Google Scholar
  9. 9.
    IEEE Std 1178-1990. IEEE Standard for the Scheme Programming Language. Institute of Electrical and Electronic Engineers, Inc., New York, NY, 1991.Google Scholar
  10. 10.
    S. Jagannathan and A. Wright. Flow-directed Inlining. In Conference on Programming Language Design and Implementation, Philadelphia, Penn, USA, May 1996.Google Scholar
  11. 11.
    R.W. Scheifler. An Analysis of Inline Substitution for a Structured Programming Language. CACM, 20(9):647–654, September 1977.Google Scholar
  12. 12.
    M. Serrano. Bigloo user's manual. RT 0169, INRIA-Rocquencourt, France, December 1994.Google Scholar
  13. 13.
    M. Serrano and P. Weis. 1 + 1 = 1: an optimizing Caml compiler. In ACM SIGPLAN Workshop on ML and its Applications, pages 101–111, Orlando (Florida, USA), June 1994. ACM SIGPLAN, INRIA RR 2265.Google Scholar
  14. 14.
    R. Stallman. Using and Porting GNU CC. for version 2.7.2 ISBN 1-882114-66-3, Free Software Foundation, Inc., 59 Temple Place — Suite 330, Boston, MA 02111-1307, USA, November 1995.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1997

Authors and Affiliations

  • Manuel Serrano
    • 1
  1. 1.Centre Universitaire d'InformatiqueUniversity of GenevaGeneva 4Switzerland

Personalised recommendations