A compiler framework for recovery code generation in general speculative optimizations

A general framework that integrates both control and data speculation using alias profiling and/or compiler heuristic rules has shown to improve SPEC2000 performance on Itanium systems. However, speculative optimizations require check instructions and recovery code to ensure correct execution when speculation fails at runtime. How to generate check instructions and their associated recovery code efficiently and effectively is an issue yet to be well studied. Also, it is very important that the recovery code generated in the earlier phases integrate gracefully in the later optimization phases. At the very least, it should not hinder later optimizations, thus, ensuring overall performance improvement. This paper proposes a framework that uses an if-block structure to facilitate check instructions and recovery code generation for general speculative optimizations. It allows speculative instructions and their recovery code generated in the early compiler optimization phases to be integrated effectively with the subsequent optimization phases. It also allows multilevel speculation for multilevel pointers and multilevel expression trees to be handled with no additional complexity. The proposed recovery code generation framework has been implemented in the open research compiler (ORC).

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

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

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

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

[5]  Scott Mahlke,et al.  Exploiting Instruction Level Parallelism in the Presence of Conditional Branches , 1997 .

[6]  Fred C. Chow,et al.  Register Promotion by Sparse Partial Redundancy Elimination ofLoads and StoresRaymond , 1998 .

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

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

[9]  Kemal Ebcioglu,et al.  A study on the number of memory ports in multiple instruction issue machines , 1993, MICRO 1993.

[10]  Kishore N. Menezes,et al.  Wavefront scheduling: path based data representation and scheduling of subgraphs , 1999, MICRO-32. Proceedings of the 32nd Annual ACM/IEEE International Symposium on Microarchitecture.

[11]  Scott A. Mahlke,et al.  Speculative execution exception recovery using write-back suppression , 1993, Proceedings of the 26th Annual International Symposium on Microarchitecture.

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

[13]  Roy Dz-Ching Ju,et al.  Applying data speculation in modulo scheduled loops , 2000, Proceedings 2000 International Conference on Parallel Architectures and Compilation Techniques (Cat. No.PR00622).

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

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

[16]  James R. Larus,et al.  Static branch frequency and program profile analysis , 1994, MICRO 27.

[17]  Toshio Nakatani,et al.  Eliminating exception constraints of Java programs for IA-64 , 2002, Proceedings.International Conference on Parallel Architectures and Compilation Techniques.

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

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

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

[21]  Toshio Nakatani,et al.  Effective null pointer check elimination utilizing hardware trap , 2000, SIGP.