Abstract
Phase ordering is a long standing challenge for traditional optimizing compilers. Varying the order of applying optimization phases to a program can produce different code, with potentially significant performance variation amongst them. A key insight to addressing the phase ordering problem is that many different optimization sequences produce the same code. In an earlier study, we used this observation to restate the phase ordering problem to concentrate on finding all distinct function instances that can be produced due to different phase orderings, instead of attempting to generate code for all possible optimization sequences. Using a novel search algorithm we were able to show that it is possible to exhaustively enumerate the set of all possible function instances that can be produced by different phase orderings in our compiler for most of the functions in our benchmark suite [1]. Finding the optimal function instance within this set for almost any dynamic measure of performance still appears impractical since that would involve execution/simulation of all generated function instances. To find the dynamically optimal function instance we exploit the observation that the enumeration space for a function typically contains a very small number of distinct control flow paths. We simulate only one function instance from each group of function instances having the identical control flow, and use that information to estimate the dynamic performance of the remaining functions in that group. We further show that the estimated dynamic frequency counts obtained by using our method correlate extremely well to simulated processor cycle counts. Thus, by using our measure of dynamic frequencies to identify a small number of the best performing function instances we can often find the optimal phase ordering for a function within a reasonable amount of time. Finally, we perform a case study to evaluate how adept our genetic algorithm is for finding optimal phase orderings within our compiler, and demonstrate how the algorithm can be improved.
- P. Kulkarni, D. Whalley, G. Tyson, and J. Davidson. Exhaustive optimization phase order space exploration. In Proceedings of the Fourth Annual IEEE/ACM International Symposium on Code Generation and Optimization, March 26--29 2006. Google Scholar
Digital Library
- Steven R. Vegdahl. Phase coupling and constant generation in an optimizing microcode compiler. In Proceedings of the 15th annual workshop on Microprogramming, pages 125--133. IEEE Press, 1982. Google Scholar
Digital Library
- D. Whitfield and M. L. Soffa. An approach to ordering optimizing transformations. In Proceedings of the second ACM SIGPLAN symposium on Principles & Practice of Parallel Programming, pages 137--146. ACM Press, 1990. Google Scholar
Digital Library
- Keith D. Cooper, Philip J. Schielke, and Devika Subramanian. Optimizing for reduced code space using genetic algorithms. In Workshop on Languages, Compilers, and Tools for Embedded Systems, pages 1--9, May 1999. Google Scholar
Digital Library
- Prasad Kulkarni, Wankang Zhao, Hwashin Moon, Kyunghwan Cho, David Whalley, Jack Davidson, Mark Bailey, Yunheung Paek, and Kyle Gallivan. Finding effective optimization phase sequences. In Proceedings of the 2003 ACM SIGPLAN conference on Language, Compiler, and Tool for Embedded Systems, pages 12--23. ACM Press, 2003. Google Scholar
Digital Library
- T. Kisuki, P. Knijnenburg, , and M.F.P. O'Boyle. Combined selection of tile sizes and unroll factors using iterative compilation. In Proc. PACT, pages 237--246, 2000. Google Scholar
Digital Library
- Spyridon Triantafyllis, Manish Vachharajani, Neil Vachharajani, and David I. August. Compiler optimization-space exploration. In Proceedings of the international symposium on Code Generation and Optimization, pages 204--215. IEEE Computer Society, 2003. Google Scholar
Digital Library
- P. Kulkarni, S. Hines, J. Hiser, D. Whalley, J. Davidson, and D. Jones. Fast searches for effective optimization phase sequences. In Proceedings of the ACM SIGPLAN '04 Conference on Programming Language Design and Implementation, June 2004. Google Scholar
Digital Library
- Deborah L. Whitfield and Mary Lou Soffa. An approach for exploring code improving transformations. ACM Trans. Program. Lang. Syst., 19(6):1053--1084, 1997. Google Scholar
Digital Library
- Min Zhao, Bruce R. Childers, and Mary Lou Soffa. A model-based framework: An approach for profit-driven optimization. In Proceedings of the international symposium on Code generation and optimization, pages 317--327, Washington, DC, USA, 2005. Google Scholar
Digital Library
- L. Almagor, Keith D. Cooper, Alexander Grosul, Timothy J. Harvey, Steven W. Reeves, Devika Subramanian, Linda Torczon, and Todd Waterman. Finding effective compilation sequences. In LCTES '04: Proceedings of the 2004 ACM SIGPLAN/SIGBED conference on Languages, Compilers, and Tools for Embedded Systems, pages 231--239, New York, NY, USA, 2004. ACM Press. Google Scholar
Digital Library
- F. Bodin, T. Kisuki, P.M.W. Knijnenburg, M.F.P. O'Boyle, , and E. Rohou. Iterative compilation in a non-linear optimisation space. Proc. Workshop on Profile and Feedback Directed Compilation. Organized in conjuction with PACT'98, 1998.Google Scholar
- Prasad A. Kulkarni, Stephen R. Hines, David B. Whalley, Jason D. Hiser, Jack W. Davidson, and Douglas L. Jones. Fast and efficient searches for effective optimization-phase sequences. ACM Trans. Archit. Code Optim., 2(2):165--198, 2005. Google Scholar
Digital Library
- T. Kisuki, P.M.W. Knijnenburg, M.F.P. O'Boyle, F. Bodin, , and H.A.G. Wijshoff. A feasibility study in iterative compilation. In Proc. ISHPC'99, volume 1615 of Lecture Notes in Computer Science, pages 121--132, 1999. Google Scholar
Digital Library
- Elana D. Granston and Anne Holler. Automatic recommendation of compiler options. 4th Workshop of Feedback-Directed and Dynamic Optimization, December 2001.Google Scholar
- K. Chow and Y. Wu. Feedback-directed selection and characterization of compiler optimizatons. Proc. 2nd Workshop on Feedback Directed Optimization, 1999.Google Scholar
- M. Haneda, P. M. W. Knijnenburg, and H. A. G. Wijshoff. Generating new general compiler optimization settings. In ICS '05: Proceedings of the 19th annual international conference on Supercomputing, pages 161--168, New York, NY, USA, 2005. ACM Press. Google Scholar
Digital Library
- P.M.W. Knijnenburg, T. Kisuki, K. Gallivan, and M.F.P. O'Boyle. The effect of cache models on iterative compilation for combined tiling and unrolling. In Proc. FDDO-3, pages 31--40, 2000. Google Scholar
Digital Library
- Tim A. Wagner, Vance Maverick, Susan L. Graham, and Michael A. Harrison. Accurate static estimators for program optimization. SIGPLAN Not., 29(6):85--96, 1994. Google Scholar
Digital Library
- K. Cooper, A. Grosul, T. Harvey, S. Reeves, D. Subramanian, L. Torczon, and T. Waterman. Acme: Adaptive compilation made efficient. In Proceedings of the ACM SIGPLAN/SIGBED Conference on Languages, Compilers, and Tools for Embedded Systems, pages 69--78, June 15--17 2005. Google Scholar
Digital Library
- M. E. Benitez and J. W. Davidson. A portable global optimizer and linker. In Proceedings of the SIGPLAN'88 conference on Programming Language Design and Implementation, pages 329--338. ACM Press, 1988. Google Scholar
Digital Library
- Doug Burger and Todd M. Austin. The SimpleScalar tool set, version 2.0. SIGARCH Comput. Archit. News, 25(3):13--25, 1997. Google Scholar
Digital Library
- Matthew R. Guthaus, Jeffrey S. Ringenberg, Dan Ernst, Todd M. Austin, Trevor Mudge, and Richard B. Brown. MiBench: A free, commercially representative embedded benchmark suite. IEEE 4th Annual Workshop on Workload Characterization, December 2001. Google Scholar
Digital Library
- W. Peterson and D. Brown. Cyclic codes for error detection. In Proceedings of the IRE, volume 49, pages 228--235, January 1961.Google Scholar
Cross Ref
- Jack W. Davidson and David B. Whalley. A design environment for addressing architecture and compiler interactions. Microprocessors and Microsystems, 15(9):459--472, November 1991.Google Scholar
Cross Ref
Index Terms
In search of near-optimal optimization phase orderings
Recommendations
Practical exhaustive optimization phase order exploration and evaluation
Choosing the most appropriate optimization phase ordering has been a long-standing problem in compiler optimizations. Exhaustive evaluation of all possible orderings of optimization phases for each function is generally dismissed as infeasible for ...
Analyzing and addressing false interactions during compiler optimization phase ordering
Compiler optimization phase ordering is a fundamental, pervasive, and long-standing problem for optimizing compilers. This problem is caused by interacting optimization phases producing different codes when applied in different orders. Producing the ...
Eliminating false phase interactions to reduce optimization phase order search space
CASES '10: Proceedings of the 2010 international conference on Compilers, architectures and synthesis for embedded systemsCompiler optimization phase ordering is a long-standing problem, and is of particular relevance to the performance-oriented and cost constrained domain of embedded systems applications. Optimization phases are known to interact with each other, enabling ...






Comments