Towards better inlining decisions using inlining trials

Inlining trials are a general mechanism for making better automatic decisions about whether a routine is profitable to inline. Unlike standard source-level inlining heuristics, an inlining trial captures the effects of optimizations applied to the body of the inlined routine when calculating the costs and benefits of inlining. The results of inlining trials are stored in a persistent database to be reused when making future inlining decisions at similar call sites. Type group analysis can determine the amount of available static information exploited during compilation, and the results of analyzing the compilation of an inlined routine help decide when a future call site would lead to substantially the same generated code as a given inlining trial. We have implemented inlining trials and type group analysis in an optimizing compiler for SELF, and by making wiser inlining decisions we were able to cut compilation time and compiled code space with virtually no loss of execution speed. We believe that inlining trials and type group analysis could be applied effectively to many high-level languages where procedural or functional abstraction is used heavily.

[1]  Simon L. Peyton Jones,et al.  Report on the programming language Haskell: a non-strict, purely functional language version 1.2 , 1992, SIGP.

[2]  Erik Ruf,et al.  Avoiding Redundant Specialization during Partial Evaluation , 1992 .

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

[4]  J. Dean,et al.  Training Compilers to Make Better Inlining Decisions , 1993 .

[5]  David Robson,et al.  Smalltalk-80: The Language and Its Implementation , 1983 .

[6]  Greg Nelson,et al.  Systems programming in modula-3 , 1991 .

[7]  Steve Johnson,et al.  Compiling C for vectorization, parallelization, and inline expansion , 1988, PLDI '88.

[8]  Ken Kennedy,et al.  Efficient call graph analysis , 1992, LOPL.

[9]  Andrew A. Chien,et al.  The Concert system - Compiler and runtime technology for efficient concurrent object-oriented programming , 1993 .

[10]  Olin Shivers,et al.  Control flow analysis in scheme , 1988, PLDI '88.

[11]  D. H. Bartley,et al.  Revised4 report on the algorithmic language scheme , 1991, LIPO.

[12]  Jens Palsberg,et al.  Object-oriented type inference , 1991, OOPSLA '91.

[13]  Bjarne Stroustrup,et al.  The C++ programming language (2nd ed.) , 1991 .

[14]  Randall B. Smith,et al.  SELF: The power of simplicity , 1987, OOPSLA '87.

[15]  Erik Ruf,et al.  Using Types to Avoid Redundant Specialization , 1991, PEPM.

[16]  Scott A. Mahlke,et al.  Profile‐guided automatic inline expansion for C programs , 1992, Softw. Pract. Exp..

[17]  Ken Kennedy,et al.  Procedure cloning , 1992, Proceedings of the 1992 International Conference on Computer Languages.

[18]  WadlerPhilip,et al.  Report on the programming language Haskell , 1992 .

[19]  Andrew A. Chien,et al.  The concert system--compiler and runtime support for efficient, fine-grained concurrent object-oriented programs , 1993 .

[20]  Bertrand Meyer,et al.  Eiffel: The Language , 1991 .

[21]  Bjarne Stroustrup,et al.  The C++ Programming Language, Second Edition , 1991 .

[22]  Craig Chambers,et al.  The design and implementation of the self compiler, an optimizing compiler for object-oriented programming languages , 1992 .

[23]  Mike Spreitzer,et al.  First-class data-type representations in SCHEMEXEROX , 1993, PLDI '93.

[24]  Erik Ruf,et al.  Using types to avoid redundant specialization , 1991, PEPM '91.

[25]  Daniel G. Bobrow,et al.  Common lisp object system specification , 1988, SIGP.

[26]  Erik G. Urdang Book Review: The T Programming Language: A Dialect of Lisp by Stephen Slade, Prentice Hall, Inc. 1987 , 1987, SIGP.

[27]  Urs Hölzle,et al.  Optimizing dynamically-dispatched calls with run-time type feedback , 1994, PLDI '94.

[28]  Randall B. Smith,et al.  Self: The power of simplicity , 1987, OOPSLA 1987.

[29]  Craig Chambers,et al.  Iterative type analysis and extended message splitting; optimizing dynamically-typed object-oriented programs , 1990, PLDI '90.

[30]  Jens Palsberg,et al.  Object-oriented type inference , 1991, OOPSLA 1991.

[31]  William D. Clinger,et al.  Revised3 report on the algorithmic language scheme , 1986, SIGP.

[32]  Craig Chambers,et al.  Making pure object-oriented languages practical , 1991, OOPSLA 1991.

[33]  Robin Milner,et al.  Definition of standard ML , 1990 .

[34]  Craig Chambers,et al.  Making pure object-oriented languages practical , 1991, OOPSLA '91.