An approach toward profit-driven optimization

Although optimizations have been applied for a number of years to improve the performance of software, problems with respect to the application of optimizations have not been adequately addressed. For example, in certain circumstances, optimizations may degrade performance. However, there is no efficient way to know when a degradation will occur. In this research, we investigate the profitability of optimizations, which is useful for determining the benefit of applying optimizations. We develop a framework that enables us to predict profitability using analytic models. The profitability of an optimization depends on code context, the particular optimization, and machine resources. Thus, our framework has analytic models for each of these components. As part of the framework, there is also a profitability engine that uses models to predict the profit. In this paper, we target scalar optimizations and, in particular, describe the models for partial redundancy elimination (PRE), loop invariant code motion (LICM), and value numbering (VN). We implemented the framework for predicting the profitability of these optimizations. Based on the predictions, we can selectively apply profitable optimizations. We compared the profit-driven approach with an approach that uses a heuristic in deciding when optimizations should be applied. Our experiments demonstrate that the profitability of scalar optimizations can be accurately predicted by using models. That is, without actually applying a scalar optimization, we can determine if an optimization is beneficial and should be applied.

[1]  Monica S. Lam,et al.  A data locality optimizing algorithm , 1991, PLDI '91.

[2]  Sang Lyul Min,et al.  Languages, Compilers, and Tools for Embedded Systems , 2001, Lecture Notes in Computer Science.

[3]  Keith D. Cooper,et al.  Adaptive Optimizing Compilers for the 21st Century , 2002, The Journal of Supercomputing.

[4]  Mahmut T. Kandemir,et al.  Improving Cache Locality by a Combination of Loop and Data Transformation , 1999, IEEE Trans. Computers.

[5]  Eric Van Wyk,et al.  Proving correctness of compiler optimizations by temporal logic , 2002, POPL '02.

[6]  Rajiv Gupta,et al.  Register Pressure Sensitive Redundancy Elimination , 1999, CC.

[7]  George C. Necula,et al.  Translation validation for an optimizing compiler , 2000, PLDI '00.

[8]  Vivek Sarkar,et al.  Automatic selection of high-order transformations in the IBM XL FORTRAN compilers , 1997, IBM J. Res. Dev..

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

[10]  Mary Lou Soffa,et al.  Incremental register reallocation , 1990, Softw. Pract. Exp..

[11]  Rajiv Gupta,et al.  A practical framework for demand-driven interprocedural data flow analysis , 1997, TOPL.

[12]  Urs Hölzle,et al.  Reconciling responsiveness with performance in pure object-oriented languages , 1996, TOPL.

[13]  Mary Lou Soffa,et al.  An approach to ordering optimizing transformations , 1990, PPOPP '90.

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

[15]  Keith D. Cooper,et al.  Value Numbering , 1997, Softw. Pract. Exp..

[16]  Sharad Malik,et al.  Cache miss equations: a compiler framework for analyzing and tuning memory behavior , 1999, TOPL.

[17]  Rajiv Gupta,et al.  Comparison checking: an approach to avoid debugging of optimized code , 1999, ESEC/FSE-7.

[18]  Sorin Lerner,et al.  Automatically proving the correctness of compiler optimizations , 2003, PLDI '03.

[19]  Sally A. McKee,et al.  A cost framework for evaluating integrated restructuring optimizations , 2001, Proceedings 2001 International Conference on Parallel Architectures and Compilation Techniques.

[20]  Douglas L. Jones,et al.  Fast searches for effective optimization phase sequences , 2004, PLDI '04.

[21]  Michael F. P. O'Boyle,et al.  Combined Selection of Tile Sizes and Unroll Factors Using Iterative Compilation , 2004, The Journal of Supercomputing.

[22]  Michael F. P. O'Boyle,et al.  Combined Selection of Tile Sizes and Unroll Factors Using Iterative Compilation , 2000, Proceedings 2000 International Conference on Parallel Architectures and Compilation Techniques (Cat. No.PR00622).

[23]  Kathryn S. McKinley,et al.  Tile size selection using cache organization and data layout , 1995, PLDI '95.

[24]  David I. August,et al.  Compiler optimization-space exploration , 2003, International Symposium on Code Generation and Optimization, 2003. CGO 2003..

[25]  Vivek Sarkar,et al.  Linear scan register allocation , 1999, TOPL.

[26]  Mary Lou Soffa,et al.  A model-based framework: an approach for profit-driven optimization , 2005, International Symposium on Code Generation and Optimization.

[27]  Chau-Wen Tseng,et al.  Improving data locality with loop transformations , 1996, TOPL.

[28]  Mary Lou Soffa,et al.  An Incremental Version of Iterative Data Flow Analysis , 1989, IEEE Trans. Software Eng..

[29]  Chun Chen,et al.  Combining models and guided empirical search to optimize for multiple levels of the memory hierarchy , 2005, International Symposium on Code Generation and Optimization.

[30]  L. Almagor,et al.  Finding effective compilation sequences , 2004, LCTES '04.

[31]  Matthew Arnold,et al.  Adaptive optimization in the Jalapeño JVM , 2000, OOPSLA '00.

[32]  Vivek Sarkar,et al.  An analytical model for loop tiling and its solution , 2000, 2000 IEEE International Symposium on Performance Analysis of Systems and Software. ISPASS (Cat. No.00EX422).

[33]  Mary Lou Soffa,et al.  Predicting the impact of optimizations for embedded systems , 2003, LCTES '03.

[34]  William Pugh,et al.  Uniform techniques for loop optimization , 1991, ICS '91.

[35]  Wei Zhang,et al.  Compiler-directed cache polymorphism , 2002, LCTES/SCOPES '02.

[36]  Michael E. Wolf,et al.  Combining Loop Transformations Considering Caches and Scheduling , 2004, International Journal of Parallel Programming.

[37]  Mary Lou Soffa,et al.  An approach for exploring code improving transformations , 1997, TOPL.

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

[39]  Keith D. Cooper,et al.  Practical improvements to the construction and destruction of static single assignment form , 1998, Softw. Pract. Exp..

[40]  PaduaDavid,et al.  A comparison of empirical and model-driven optimization , 2003 .