Combining analyses, combining optimizations

Modern optimizing compilers use several passes over a program's intermediate representation to generate good code. Many of these optimizations exhibit a phase-ordering problem. Getting the best code may require iterating optimizations until a fixed point is reached. Combining these phases can lead to the discovery of more facts about the program, exposing more opportunities for optimization. This article presents a framework for describing optimizations. It shows how to combine two such frameworks and how to reason about the properties of the resulting framework. The structure of the frame work provides insight into when a combination yields better results. To make the ideas more concrete, this article presents a framework for combining constant propagation, value numbering, and unreachable-code elimination. It is an open question as to what other frameworks can be combined in this way.

[1]  Robert E. Tarjan Testing flow graph reducibility , 1973, STOC '73.

[2]  Matthias Felleisen,et al.  The semantics of program dependence , 1989, PLDI '89.

[3]  Gregory J. Chaitin,et al.  Register allocation and spilling via graph coloring , 2004, SIGP.

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

[5]  Christopher W. Fraser,et al.  Code selection through object code optimization , 1984, TOPL.

[6]  Joe D. Warren,et al.  The program dependence graph and its use in optimization , 1987, TOPL.

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

[8]  Robert E. Tarjan,et al.  Efficiency of a Good But Not Linear Set Union Algorithm , 1972, JACM.

[9]  John Field,et al.  A Simple Rewriting Semantics for Realistic Imperative Programs and its Application to Program Analysis , 1992, ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation.

[10]  Manfred P. Stadel,et al.  A solution to a problem with Morel and Renvoise's “Global optimization by suppression of partial redundancies” , 1988, TOPL.

[11]  John Cocke,et al.  Programming languages and their compilers , 1969 .

[12]  Herbert B. Enderton,et al.  A mathematical introduction to logic , 1972 .

[13]  Arthur B. Maccabe,et al.  The program dependence web: a representation supporting control-, data-, and demand-driven interpretation of imperative languages , 1990, PLDI '90.

[14]  Michael Wolfe,et al.  Beyond induction variables , 1992, PLDI '92.

[15]  Michael D. Ernst,et al.  Value dependence graphs: representation without taxation , 1994, POPL '94.

[16]  J. Cocke Global common subexpression elimination , 1970, Symposium on Compiler Optimization.

[17]  Alfred V. Aho,et al.  Compilers: Principles, Techniques, and Tools , 1986, Addison-Wesley series in computer science / World student series edition.

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

[19]  Christopher A. Vick SSA-based reduction of operator strength , 1994 .

[20]  Robert E. Tarjan,et al.  A Unified Approach to Path Problems , 1981, JACM.

[21]  Christopher W. Fraser,et al.  Integrating code generation and optimization , 1986, SIGPLAN '86.

[22]  M. Wegman,et al.  Global value numbers and redundant computations , 1988, POPL '88.

[23]  A. Tarski A LATTICE-THEORETICAL FIXPOINT THEOREM AND ITS APPLICATIONS , 1955 .

[24]  John W. Backus,et al.  The history of FORTRAN I, II, and III , 1978, SIGP.

[25]  David R. Hanson Fast allocation and deallocation of memory based on object lifetimes , 1990, Softw. Pract. Exp..

[26]  Jeffrey D. Ullman,et al.  Global Data Flow Analysis and Iterative Algorithms , 1976, J. ACM.

[27]  KEN KENNEDY,et al.  Use-Definition Chains with Applications , 1978, Comput. Lang..

[28]  Robert E. Tarjan,et al.  A fast algorithm for finding dominators in a flowgraph , 1979, TOPL.

[29]  Paul Havlak,et al.  Interprocedural symbolic analysis , 1995 .

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

[31]  Andrew S. Tanenbaum,et al.  Using Peephole Optimization on Intermediate Code , 1982, TOPL.

[32]  John E. Hopcroft,et al.  An n log n algorithm for minimizing states in a finite automaton , 1971 .

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

[34]  Christopher W. Fraser,et al.  Automatic generation of fast optimizing code generators , 1988, PLDI '88.

[35]  Mark N. Wegman,et al.  An efficient method of computing static single assignment form , 1989, POPL '89.

[36]  Bernhard Steffen,et al.  Partial dead code elimination , 1994, PLDI '94.

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

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

[39]  Patrick Cousot,et al.  Systematic design of program analysis frameworks , 1979, POPL.

[40]  Keshav Pingali,et al.  Dependence flow graphs: an algebraic approach to program dependencies , 1991, POPL '91.

[41]  Gary A. Kildall,et al.  A unified approach to global program optimization , 1973, POPL.