A compiler framework for speculative analysis and optimizations

Speculative execution, such as control speculation and data speculation, is an effective way to improve program performance. Using edge/path profile information or simple heuristic rules, existing compiler frameworks can adequately incorporate and exploit control speculation. However, very little has been done so far to allow existing compiler frameworks to incorporate and exploit data speculation effectively in various program transformations beyond instruction scheduling. This paper proposes a speculative SSA form to incorporate information from alias profiling and/or heuristic rules for data speculation, thus allowing existing program analysis frameworks to be easily extended to support both control and data speculation. Such a general framework is very useful for EPIC architectures that provide checking (such as advanced load address table (ALAT) [10]) on data speculation to guarantee the correctness of program execution. We use SSAPRE [21] as one example to illustrate how to incorporate data speculation in those important compiler optimizations such as partial redundancy elimination (PRE), register promotion, strength reduction and linear function test replacement. Our extended framework allows both control and data speculation to be performed on top of SSAPRE and, thus, enables more aggressive speculative optimizations. The proposed framework has been implemented on Intel's Open Research Compiler (ORC). We present experimental data on some SPEC2000 benchmark programs to demonstrate the usefulness of this framework and how data speculation benefits partial redundancy elimination.

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

[2]  Rajiv Gupta,et al.  Complete removal of redundant expressions , 1998, PLDI 1998.

[3]  Rajiv Gupta,et al.  Load-reuse analysis: design and evaluation , 1999, PLDI '99.

[4]  Raymond Lo,et al.  Register promotion by sparse partial redundancy elimination of loads and stores , 1998, PLDI.

[5]  Raymond Lo,et al.  A new algorithm for partial redundancy elimination based on SSA form , 1997, PLDI '97.

[6]  Jin Lin,et al.  An Empirical Study on the Granularity of Pointer Analysis in C Programs , 2002, LCPC.

[7]  Carole Dulong,et al.  The IA-64 Architecture at Work , 1998, Computer.

[8]  Vivek Sarkar,et al.  Array SSA form and its use in parallelization , 1998, POPL '98.

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

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

[11]  Dhananjay M. Dhamdhere Practical adaption of the global optimization algorithm of Morel and Renvoise , 1991, TOPL.

[12]  Roy Dz-Ching Ju,et al.  A unified compiler framework for control and data speculation , 2000, Proceedings 2000 International Conference on Parallel Architectures and Compilation Techniques (Cat. No.PR00622).

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

[14]  Raymond Lo,et al.  Partial redundancy elimination in SSA form , 1999, TOPL.

[15]  Amer Diwan,et al.  Type-based alias analysis , 1998, PLDI.

[16]  Jin Lin,et al.  Speculative register promotion using advanced load address table (ALAT) , 2003, International Symposium on Code Generation and Optimization, 2003. CGO 2003..

[17]  David C. Sehr,et al.  On the importance of points-to analysis and other memory disambiguation methods for C programs , 2001, PLDI '01.

[18]  Michael Hind,et al.  Pointer analysis: haven't we solved this problem yet? , 2001, PASTE '01.

[19]  S LamMonica,et al.  Efficient context-sensitive pointer analysis for C programs , 1995 .

[20]  Roger Espasa,et al.  Speculative alias analysis for executable code , 2002, Proceedings.International Conference on Parallel Architectures and Compilation Techniques.

[21]  Jenq Kuen Lee,et al.  Probabilistic Points-to Analysis , 2001, LCPC.

[22]  James R. Larus,et al.  Branch prediction for free , 1993, PLDI '93.

[23]  Roy Dz-Ching Ju,et al.  Probabilistic memory disambiguation and its application to data speculation , 1999, CARN.

[24]  Monica S. Lam,et al.  Efficient context-sensitive pointer analysis for C programs , 1995, PLDI '95.

[25]  Bjarne Steensgaard,et al.  Points-to analysis in almost linear time , 1996, POPL '96.

[26]  Rakesh Krishnaiyer,et al.  An Overview of the Intel® IA-64 Compiler , 1999 .

[27]  Raymond Lo,et al.  Strength Reduction via SSAPRE , 1998, CC.