A general compiler framework for speculative optimizations using data speculative code motion

Data speculative optimization refers to code transformations that allow load and store instructions to be moved across potentially dependent memory operations. Existing research work on data speculative optimizations has mainly focused on individual code transformation. The required speculative analysis that identifies data speculative optimization opportunities and the required recovery code generation that guarantees the correctness of their execution are handled separately for each optimization. This paper proposes a new compiler framework to facilitate the design and implementation of general data speculative optimizations such as dead store elimination, redundancy elimination, copy propagation, and code scheduling. This framework allows different data speculative optimizations to share the followings: (i) a speculative analysis mechanism to identify data speculative optimization opportunities by ignoring low probability data dependences from optimizations, and (ii) a recovery code generation mechanism to guarantee the correctness of the data speculative optimizations. The proposed recovery code generation is based on data speculative code motion (DSCM) that uses code motion to facilitate a desired transformation. Based on the position of the moved instruction, recovery code can be generated accordingly. The proposed framework greatly simplifies the task of incorporating data speculation into non-speculative optimizations by sharing the recovery code generation and the speculative analysis. We have implemented the proposed framework in the ORC 2.1 compiler and demonstrated its effectiveness on SPEC2000 benchmark programs.

[1]  Roy Dz-Ching Ju,et al.  A compiler framework for speculative analysis and optimizations , 2003, PLDI '03.

[2]  Utpal Banerjee,et al.  Dependence analysis for supercomputing , 1988, The Kluwer international series in engineering and computer science.

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

[4]  Wen-mei W. Hwu,et al.  Modular interprocedural pointer analysis using access paths: design, implementation, and evaluation , 2000, PLDI '00.

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

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

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

[8]  최린 IA - 64 and Intel® Itanium TM Processor Micro - architecture Overview , 2001 .

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

[10]  Scott A. Mahlke,et al.  Dynamic memory disambiguation using the memory conflict buffer , 1994, ASPLOS VI.

[11]  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).

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

[13]  John Paul Shen,et al.  Speculative disambiguation: a compilation technique for dynamic memory disambiguation , 1994, ISCA '94.

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

[15]  Trevor N. Mudge,et al.  The store-load address table and speculative register promotion , 2000, MICRO 33.

[16]  Scott A. Mahlke,et al.  Tolerating data access latency with register preloading , 1992, ICS '92.

[17]  Jin Lin,et al.  Data Dependence Profiling for Speculative Optimizations , 2004, CC.

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

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