A new algorithm for partial redundancy elimination based on SSA form

A new algorithm, SSAPRE, for performing partial redundancy elimination based entirely on SSA form is presented. It achieves optimal code motion similar to lazy code motion [KRS94a, DS93], but is formulated independently and does not involve iterative data flow analysis and bit vectors in its solution. It not only exhibits the characteristics common to other sparse approaches, but also inherits the advantages shared by other SSA-based optimization techniques. SSAPRE also maintains its output in the same SSA form as its input. In describing the algorithm, we state theorems with proofs giving our claims about SSAPRE. We also give additional description about our practical implementation of SSAPRE, and analyze and compare its performance with a bit-vector-based implementation of PRE. We conclude with some discussion of the implications of this work.

[1]  Keith D. Cooper,et al.  Value-Driven Code Motion , 1995 .

[2]  Walter Kirchgässner,et al.  An optimizer for Ada - design, experiences and results , 1988, PLDI '88.

[3]  Dhananjay M. Dhamdhere Corrigendum: a new algorithm for composite hoisting and strength reduction optimisation , 1989 .

[4]  J. Knoop,et al.  Lazy Strength Reduction , 1993 .

[5]  Fred C. Chow,et al.  A portable machine-independent global optimizer--design and measurements , 1984 .

[6]  Fred C. Chow Minimizing register usage penalty at procedure calls , 1988, PLDI '88.

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

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

[9]  Incremental Computation of Static Single Assignment Form , 1996, CC.

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

[11]  Dhananjay M. Dhamdhere,et al.  How to analyze large programs efficiently and informatively , 1992, PLDI '92.

[12]  Keshav Pingali,et al.  The program structure tree: computing control regions in linear time , 1994, PLDI '94.

[13]  Raymond Lo,et al.  Effective Representation of Aliases and Indirect Memory Operations in SSA Form , 1996, CC.

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

[15]  Manfred P. Stadel,et al.  A variation of Knoop, Rüthing, and Steffen's Lazy Code Motion , 1993, SIGP.

[16]  Jong-Deok Choi,et al.  Automatic construction of sparse data flow evaluation graphs , 1991, POPL '91.

[17]  Raymond Lo,et al.  Loop induction variable canonicalization in parallelizing compilers , 1996, Proceedings of the 1996 Conference on Parallel Architectures and Compilation Technique.

[18]  Keith D. Cooper,et al.  SCC-Based Value Numbering , 1995 .

[19]  Michael Wolfe,et al.  Beyond induction variables: detecting and classifying sequences using a demand-driven SSA form , 1995, TOPL.

[20]  Michael Wolfe,et al.  A reference chain approach for live variables , 1994 .

[21]  Cliff Click,et al.  Global code motion/global value numbering , 1995, PLDI '95.

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

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

[24]  Richard Johnson Efficient program analysis using dependence flow graphs , 1995 .

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

[26]  Bernhard Steffen,et al.  Optimal code motion: theory and practice , 1994, TOPL.

[27]  Michael Wolfe,et al.  High performance compilers for parallel computing , 1995 .

[28]  Guang R. Gao,et al.  A linear time algorithm for placing φ-nodes , 1995, POPL '95.

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