An Adaptive Strategy for Inline Substitution

Inline substitution is an optimization that replaces a procedure call with the body of the procedure that it calls. Inlining has the immediate benefit of reducing the overhead associated with the call, including register saves and restores, parameter evaluation, and activation record setup and teardown. It has secondary benefits that arise from providing greater context for global optimizations. These benefits can be offset by the effects of increased code size, and by deleterious interactions with other optimizations, such as register allocation. The difficult aspect of inline substitution is choosing which calls to inline. Previous work has focused on static, one-size-fits-all heuristics. This paper presents a feedback-driven adaptive scheme that derives a programspecific inlining heuristic. The key contributions of this work are: (1) a novel parameterization scheme for the inliner that makes it susceptible to fine-grained external control, (2) a scheme for discretizing large integer parameter spaces, and (3) effective search techniques for the resulting search space. This work provides a proof of concept that can provide insight into the design of adaptive controllers for other optimizations with complex decision heuristics. Our goal in this work is not to exhibit the world's best inliner. Instead, we present evidence to suggest that a program-specific, adaptive scheme is needed to achieve the best results.

[1]  Joseph A. Fisher,et al.  Trace Scheduling: A Technique for Global Microcode Compaction , 1981, IEEE Transactions on Computers.

[2]  Saman P. Amarasinghe,et al.  Meta optimization: improving compiler heuristics with machine learning , 2003, PLDI '03.

[3]  Donald E. Knuth,et al.  An empirical study of FORTRAN programs , 1971, Softw. Pract. Exp..

[4]  Yuefan Deng,et al.  New trends in high performance computing , 2001, Parallel Computing.

[5]  Matthew S. Hecht,et al.  Flow Analysis of Computer Programs , 1977 .

[6]  Keith D. Cooper,et al.  Optimizing for reduced code space using genetic algorithms , 1999, LCTES '99.

[7]  Louise Trevillyan,et al.  The Experimental Compiling System , 1980, IBM J. Res. Dev..

[8]  David I. August,et al.  Compiler optimization-space exploration , 2003, International Symposium on Code Generation and Optimization, 2003. CGO 2003..

[9]  Jack W. Davidson,et al.  A study of a C function inliner , 1988, Softw. Pract. Exp..

[10]  Wen-mei W. Hwu,et al.  Inline function expansion for compiling C programs , 1989, PLDI '89.

[11]  Manuel Serrano Inline Expansion: When and How? , 1997, PLILP.

[12]  José Nelson Amaral,et al.  To Inline or Not to Inline? Enhanced Inlining Decisions , 2003, LCPC.

[13]  Keith D. Cooper,et al.  Adaptive ordering of code transformations in an optimizing compiler , 2005 .

[14]  Michael F. P. O'Boyle,et al.  Automatic Tuning of Inlining Heuristics , 2005, ACM/IEEE SC 2005 Conference (SC'05).

[15]  Mary Lou Soffa,et al.  Predicting the impact of optimizations for embedded systems , 2003 .

[16]  Douglas L. Jones,et al.  Fast and efficient searches for effective optimization-phase sequences , 2005, TACO.

[17]  Todd Waterman Adaptive compilation and inlining , 2006 .

[18]  Robert Scheifler,et al.  An analysis of inline substitution for a structured programming language , 1977, CACM.

[19]  L. Almagor,et al.  Finding effective compilation sequences , 2004, LCTES '04.

[20]  Craig Chambers,et al.  Towards better inlining decisions using inlining trials , 1994, LFP '94.

[21]  Keith D. Cooper,et al.  Investigating Adaptive Compilation Using the Mipspro Compiler , 2005, Int. J. High Perform. Comput. Appl..

[22]  Keith D. Cooper,et al.  An experiment with inline substitution , 1991, Softw. Pract. Exp..

[23]  Jack W. Davidson,et al.  Subprogram Inlining: A Study of its Effects on Program Execution Time , 1992, IEEE Trans. Software Eng..

[24]  Michael F. P. O'Boyle,et al.  Combined Selection of Tile Sizes and Unroll Factors Using Iterative Compilation , 2000, Proceedings 2000 International Conference on Parallel Architectures and Compilation Techniques (Cat. No.PR00622).

[25]  Ira Krepchin,et al.  Texas Instruments Inc. , 1963, Nature.

[26]  Scott A. Mahlke,et al.  Using profile information to assist classic code optimizations , 1991, Softw. Pract. Exp..

[27]  William H. Harrison A New Strategy for Code Generation—the General-Purpose Optimizing Compiler , 1979, IEEE Transactions on Software Engineering.

[28]  J. E. Ball,et al.  Predicting the effects of optimization on a procedure body , 1979, SIGPLAN '79.