Exploiting phase inter-dependencies for faster iterative compiler optimization phase order searches

The problem of finding the most effective set and ordering of optimization phases to generate the best quality code is a fundamental issue in compiler optimization research. Unfortunately, the exorbitantly large phase order search spaces in current compilers make both exhaustive as well as heuristic approaches to search for the ideal optimization phase combination impractical in most cases. In this paper we show that one important reason existing search techniques are so expensive is because they make no attempt to exploit well-known independence relationships between optimization phases to reduce the search space, and correspondingly improve the search time. We explore the impact of two complementary techniques to prune typical phase order search spaces. Our first technique studies the effect of implicit application of cleanup phases, while the other partitions the set of phases into mutually independent groups and develops new multi-stage search algorithms that substantially reduce the search time with no effect on best delivered code performance. Together, our techniques prune the exhaustive phase order search space size by 89%, on average, (96.75% total search space reduction) and show immense potential at making iterative phase order searches more feasible and practical. The pruned search space enables us to find a small set of distinct phase sequences that reach near-optimal phase ordering performance for all our benchmark functions as well as to improve the behavior of our genetic algorithm based heuristic search.

[1]  Bruce R. Schatz,et al.  An Overview of the Production-Quality Compiler-Compiler Project , 1980, Computer.

[2]  Steven R. Vegdahl Phase coupling and constant generation in an optimizing microcode compiler , 1982, MICRO 15.

[3]  Thomas R. Gross,et al.  Postpass Code Optimization of Pipeline Constraints , 1983, TOPL.

[4]  Philip J. Fleming,et al.  How not to lie with statistics: the correct way to summarize benchmark results , 1986, CACM.

[5]  J. Goodman,et al.  Code scheduling and register allocation in large basic blocks , 1988, ICS '88.

[6]  Manuel E. Benitez,et al.  A portable global optimizer and linker , 1988, PLDI '88.

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

[8]  W. Pugh,et al.  A framework for unifying reordering transformations , 1993 .

[9]  Shlomit S. Pinter,et al.  Register allocation with instruction scheduling , 1993, PLDI '93.

[10]  Andreas Krall,et al.  Dependence-Conscious Global Register Allocation , 1994, Programming Languages and System Architectures.

[11]  R. K. Shyamasundar,et al.  Introduction to algorithms , 1996 .

[12]  Dorothea Heiss-Czedik,et al.  An Introduction to Genetic Algorithms. , 1997, Artificial Life.

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

[14]  Todd M. Austin,et al.  The SimpleScalar tool set, version 2.0 , 1997, CARN.

[15]  Michael F. P. O'Boyle,et al.  A Feasibility Study in Iterative Compilation , 1999, ISHPC.

[16]  Keith D. Cooper,et al.  Optimizing for reduced code space using genetic algorithms , 1999, LCTES '99.

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

[18]  Trevor Mudge,et al.  MiBench: A free, commercially representative embedded benchmark suite , 2001 .

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

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

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

[22]  Keith D. Cooper,et al.  ACME: adaptive compilation made efficient , 2005, LCTES '05.

[23]  Grigori Fursin,et al.  A heuristic search algorithm based on unified transformation framework , 2005, 2005 International Conference on Parallel Processing Workshops (ICPPW'05).

[24]  Gary S. Tyson,et al.  In search of near-optimal optimization phase orderings , 2006, LCTES '06.

[25]  Denis Barthou,et al.  On the decidability of phase ordering problem in optimizing compilation , 2006, CF '06.

[26]  Michael F. P. O'Boyle,et al.  Using machine learning to focus iterative optimization , 2006, International Symposium on Code Generation and Optimization (CGO'06).

[27]  Gary S. Tyson,et al.  Exhaustive optimization phase order space exploration , 2006, International Symposium on Code Generation and Optimization (CGO'06).

[28]  Gary S. Tyson,et al.  In search of near-optimal optimization phase orderings , 2006 .

[29]  Gary S. Tyson,et al.  Evaluating Heuristic Optimization Phase Order Search Algorithms , 2007, International Symposium on Code Generation and Optimization (CGO'07).

[30]  Lieven Eeckhout,et al.  Cole: compiler optimization level exploration , 2008, CGO '08.

[31]  Gary S. Tyson,et al.  Practical exhaustive optimization phase order exploration and evaluation , 2009, TACO.

[32]  Michael F. P. O'Boyle,et al.  Milepost GCC: Machine Learning Enabled Self-tuning Compiler , 2011, International Journal of Parallel Programming.

[33]  Prasad A. Kulkarni,et al.  Eliminating false phase interactions to reduce optimization phase order search space , 2010, CASES '10.

[34]  Prasad A. Kulkarni,et al.  Analyzing and addressing false interactions during compiler optimization phase ordering , 2014, Softw. Pract. Exp..