skip to main content
article

In search of near-optimal optimization phase orderings

Published:14 June 2006Publication History
Skip Abstract Section

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.

References

  1. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  2. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  3. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  4. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  5. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  6. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  7. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  8. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  9. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  10. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  11. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  12. 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 ScholarGoogle Scholar
  13. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  14. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  15. Elana D. Granston and Anne Holler. Automatic recommendation of compiler options. 4th Workshop of Feedback-Directed and Dynamic Optimization, December 2001.Google ScholarGoogle Scholar
  16. K. Chow and Y. Wu. Feedback-directed selection and characterization of compiler optimizatons. Proc. 2nd Workshop on Feedback Directed Optimization, 1999.Google ScholarGoogle Scholar
  17. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  18. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  19. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  20. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  21. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  22. Doug Burger and Todd M. Austin. The SimpleScalar tool set, version 2.0. SIGARCH Comput. Archit. News, 25(3):13--25, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  24. W. Peterson and D. Brown. Cyclic codes for error detection. In Proceedings of the IRE, volume 49, pages 228--235, January 1961.Google ScholarGoogle ScholarCross RefCross Ref
  25. 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 ScholarGoogle ScholarCross RefCross Ref

Index Terms

  1. In search of near-optimal optimization phase orderings

          Recommendations

          Comments

          Login options

          Check if you have access through your login credentials or your institution to get full access on this article.

          Sign in

          Full Access

          • Published in

            cover image ACM SIGPLAN Notices
            ACM SIGPLAN Notices  Volume 41, Issue 7
            Proceedings of the 2006 LCTES Conference
            July 2006
            208 pages
            ISSN:0362-1340
            EISSN:1558-1160
            DOI:10.1145/1159974
            Issue’s Table of Contents
            • cover image ACM Conferences
              LCTES '06: Proceedings of the 2006 ACM SIGPLAN/SIGBED conference on Language, compilers, and tool support for embedded systems
              June 2006
              220 pages
              ISBN:159593362X
              DOI:10.1145/1134650

            Copyright © 2006 ACM

            Publisher

            Association for Computing Machinery

            New York, NY, United States

            Publication History

            • Published: 14 June 2006

            Check for updates

            Qualifiers

            • article

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader
          About Cookies On This Site

          We use cookies to ensure that we give you the best experience on our website.

          Learn more

          Got it!