Order Matters : Exploring the Structure of the Space of Compilation Sequences Using Randomized Search Algorithms †

Modern optimizing compilers apply a fixed sequence of optimizations, which we call a compilation sequence, to each program that they compile. These compilers let the user modify their behavior in a small number of specified ways, using command-line flags (e.g.,-O1,-O2,...). For five years, we have been working with compilers that automatically select an appropriate compilation sequence for each input program. These adaptive compilers discover a good compilation sequence tailored to the input program, the target machine, and a user-chosen objective function. We have shown, as have others, that program-specific sequences can produce better results than any single universal sequence [1, 7, 10, 21, 23] Our adaptive compiler looks for compilation sequences in a large and complex search space. Its typical compilation sequence includes 10 passes (with possible repeats) chosen from the 16 available—there are 1610 or [1,099,511,627,776] such sequences. To learn about the properties of such spaces, we have studied subspaces that consist of 10 passes drawn from a set of 5 (510 or 9,765,625 sequences). These 10-of-5 subspaces are small enough that we can analyze them thoroughly but large enough to reflect important properties of the full spaces.This paper reports, in detail, on our analysis of several of these subspaces and on the consequences of those observed properties for the design of search algorithms.

[1]  Keith D. Cooper,et al.  Operator strength reduction , 2001, TOPL.

[2]  Bernhard Steffen,et al.  Lazy code motion , 1992, PLDI '92.

[3]  John Cocke,et al.  A methodology for the real world , 1981 .

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

[5]  Bowen Alpern,et al.  Detecting equality of variables in programs , 1988, POPL '88.

[6]  F. Grund Forsythe, G. E. / Malcolm, M. A. / Moler, C. B., Computer Methods for Mathematical Computations. Englewood Cliffs, New Jersey 07632. Prentice Hall, Inc., 1977. XI, 259 S , 1979 .

[7]  John Cocke,et al.  Register allocation via graph coloring , 1981 .

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

[9]  Keith D. Cooper,et al.  Adaptive Optimizing Compilers for the 21st Century , 2002, The Journal of Supercomputing.

[10]  Adolfy Hoisie,et al.  Performance Optimization of Numerically Intensive Codes , 1987 .

[11]  Mary Lou Soffa,et al.  An approach for exploring code improving transformations , 1997, TOPL.

[12]  Keith D. Cooper,et al.  Effective partial redundancy elimination , 1994, PLDI '94.

[13]  Preston Briggs,et al.  Register allocation via graph coloring , 1992 .

[14]  Christopher W. Fraser,et al.  The Design and Application of a Retargetable Peephole Optimizer , 1980, TOPL.

[15]  Keith D. Cooper,et al.  Value-driven redundancy elimination , 1996 .

[16]  Michael A. Malcolm,et al.  Computer methods for mathematical computations , 1977 .

[17]  Keith D. Cooper,et al.  Value Numbering , 1997, Softw. Pract. Exp..

[18]  Keith D. Cooper,et al.  Engineering a Compiler , 2003 .

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

[20]  Mark N. Wegman,et al.  Constant propagation with conditional branches , 1985, POPL.

[21]  Etienne Morel,et al.  Global optimization by suppression of partial redundancies , 1979, CACM.

[22]  Mark N. Wegman,et al.  Efficiently computing static single assignment form and the control dependence graph , 1991, TOPL.

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

[24]  Lori Pollock An approach to incremental compilation of optimized code , 1986 .

[25]  Arch D. Robison,et al.  Impact of economics on compiler optimization , 2001, JGI '01.

[26]  Yunheung Paek,et al.  Finding effective optimization phase sequences , 2003 .

[27]  Keith D. Cooper,et al.  Combining analyses, combining optimizations , 1995, TOPL.