ABSTRACT
Modern compilers implement a large number of optimizations which all interact in complex ways, and which all have a different impact on code quality, compilation time, code size, energy consumption, etc. For this reason, compilers typically provide a limited number of standard optimization levels, such as -O1, -O2, -O3 and -Os, that combine various optimizations providing a number of trade-offs between multiple objective functions (such as code quality, compilation time and code size). The construction of these optimization levels, i.e., choosing which optimizations to activate at each level, is a manual process typically done using high-level heuristics based on the compiler developer's experience.
This paper proposes COLE, Compiler Optimization Level Exploration, a framework for automatically finding Pareto optimal optimization levels through multi-objective evolutionary searching. Our experimental results using GCC and the SPEC CPU benchmarks show that the automatic construction of optimization levels is feasible in practice, and in addition, yields better optimization levels than GCC's manually derived (-Os, -O1, -O2 and -O3) optimization levels, as well as the optimization levels obtained through random sampling. We also demonstrate that COLE can be used to gain insight into the effectiveness of compiler optimizations as well as to better understand a benchmark's sensitivity to compiler optimizations.
- F. Agakov, E. Bonilla, J. Cavazos, B.Franke, G. Fursin, M. O'Boyle, J. Thomson, M. Toussaint, and C. Williams. Using machine learning to focus iterative optimization. In Proceedings of the International Symposium on Code Generation and Optimization (CGO), pages 295--305, Mar. 2006. Google ScholarDigital Library
- L. Almagor, K. D. Cooper, A. Grosul, T. J. Harvey, S. Reeves, D. Subramanian, L. Torczon, and T. Waterman. Compilation order matters: Exploring the structure of the space of compilation sequences using randomized search algorithms. In Proceedings of the ACM SIGPLAN Symposium on Languages, Compilers, and Tools for Embedded Systems (LCTES), pages 231--239, June 2004.Google Scholar
- M. Arnold, S. Finka, D. Grove, M. Hind, and P. F. Sweeney. Adaptive optimization in the Jalapeno JVM. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA), pages 47--65, Oct. 2000. Google ScholarDigital Library
- M. Arnold, M. Hind, and B. G. Ryder. Online feedback--directed optimization in Java. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA), pages 111--129, Oct. 2002. Google ScholarDigital Library
- F. Bodin, T. Kisuki, P. Knijnenburg, M. O'Boyle, and E. Rohou. Iterative compilation in a non-linear optimisation space. In Proceedings of the Workshop on Profile and Feedback-Directed Compilation, in Conjunction with the Intl. Conf. on Parallel Architectures and Compilation Techniques (PACT), Oct. 1998.Google Scholar
- J. Cavazos, G. Fursin, F. Agakov, E. Bonilla, M. F. P. O'Boyle, and O. Temam. Rapidly selecting good compiler optimizations using performance counters. In Proceedings of the International Symposium on Code Generation and Optimization (CGO), pages 185--197, Mar. 2007. Google ScholarDigital Library
- J. Cavazos and M. O'Boyle. Automatic tuning of inlining heuristics. In Proceedings of the Supercomputing Conference on High Performance Networking and Computing, Nov. 2005. Google ScholarDigital Library
- J. Cavazos and M. O'Boyle. Method-specific dynamic compilation using logistic regression. In Proceedings of the ACM SIGPLAN Conference on Object--Oriented Programming Systems, Languages, and Applications (OOPSLA), pages 229--240, Oct. 2006. Google ScholarDigital Library
- K. Chow and Y. Wu. Feedback-directed selection and characterization of compiler optimizations. In Proceedings of the Workshop on Feedback--Directed and Dynamic Optimization (FDDO), Nov. 1999.Google Scholar
- K. D. Cooper, P. J. Schielke, and D. Subramanian. Optimizing for reduced code space using genetic algorithms. In Proceedings of the ACM SIGPLAN/SIGBED Conference on Languages, Compilers, and Tools for Embedded Systems (LCTES), pages 1--9, May 1999. Google ScholarDigital Library
- K. Deb. Multi-Objective Optimization using Evolutionary Algorithms. Wiley, 2001. Google ScholarDigital Library
- G. Fursin, A. Cohen, M. O'Boyle, and O. Temam. Quick and practical run--time evaluation of multiple program optimizations. Transactions on High Performance Embedded Architectures and Compilation Techniques (HiPEAC), 1(1):13--31, 2006.Google Scholar
- S. V. Gheorghita, H. Corporaal, and T. Basten. Iterative compilation for energy reduction. Journal of Embedded Computing}, 1(4):509--520, July 2005. Google ScholarDigital Library
- E. Granston and A. Holler. Automatic recommendation of compiler options. In Proceedings of the Workshop on Feedback-Directed and Dynamic Optimization (FDDO), Dec. 2001.Google Scholar
- M. Haneda, P. M. W. Knijnenburg, and H. A. G. Wijshoff. Optimizing general purpose compiler optimization. In Proceedings of the International Conference on Computing Frontiers, pages 180---188, May 2005. Google ScholarDigital Library
- J. L. Henning. SPEC CPU2000: Measuring CPU performance in the new millennium. IEEE Computer, 33(7):28--35, July 2000. Google ScholarDigital Library
- K. Ishizaki, T. M., K. Kawachiya, T. Suganuma, O. Gohda, T. Inagaki, A. Koseki, K. Ogata, M. Kawahito, T. Yasue, T. Ogasawara, T. Onodera, H. Komatsu, and T. Nakatani. Effectiveness of cross-platform optimizations for a Java just-in-time compiler. In Proceedings of the ACM SIGPLAN Conference on Object--Oriented Programming Systems, Languages, and Applications (OOPSLA), pages 187--204, Oct. 2003. Google ScholarDigital 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 Conference on Programming Language Design and Implementation (PLDI), pages 171--182, June 2004. Google ScholarDigital Library
- D. Maier, P. Ramarao, M. Stoodley, and V. Sundaresan. Experiences with multithreading and dynamic class loading in a Java just-in-time compiler. In Proceedings of the International Symposium on Code Generation and Optimization (CGO), pages 87--97, Mar. 2006. Google ScholarDigital Library
- Z. Pan and R. Eigenmann. Fast, automatic, procedure-level performance tuning. In Proceedings of the International Conference on Parallel Architectures and Compilation Techniques (PACT), pages 173--181, Sept. 2006. Google ScholarDigital Library
- T. Suganuma, T. Yasue, M. Kawahito, H. Komatsu, and T. Nakatani. Design and evaluation of dynamic optimizations for a Java just-in-time compiler. ACM Transactions on Programming Languages and Systems (TOPLAS), 27(4):732---785, July 2005. Google ScholarDigital Library
- S. Triantafyllis, M. Vachharajani, and D. I. August. Compiler optimization--space exploration. Journal of Instruction--level Parallelism, Jan. 2005. Accessible at http://www.jilp.org/vol7.Google Scholar
- H. Wu, E. Park, M. Kaplarevic, and Y. Zhang. Dynamic optimization option search in GCC. In Proceedings of the GCC Developers Summit 2007, June 2007.Google Scholar
- M. Zhao, B. R. Childers, and M. L. Soffa. Predicting the impact of optimizations for embedded systems. In Proceedings of the ACM SIGPLAN Symposium on Languages, Compilers, and Tools for Embedded Systems (LCTES), pages 1--11, June 2003. Google ScholarDigital Library
- E. Zitzler, M. Laumanns, and L. Thiele. SPEA2: Improving the strength pareto evolutionary algorithm. Technical Report TIK--Report 103, Swiss Federal Institute of Technology (ETH) Zurich, May 2001.Google Scholar
- E. Zitzler and L. Thiele. Multiobjective evolutionary algorithms: A comparative case study and the strength perato approach. IEEE Transactions on Evolutionary Computation, 3(4):257--271, Nov. 1999. Google ScholarDigital Library
Index Terms
- Cole: compiler optimization level exploration
Recommendations
The Intel labs Haskell research compiler
Haskell '13The Glasgow Haskell Compiler (GHC) is a well supported optimizing compiler for the Haskell programming language, along with its own extensions to the language and libraries. Haskell's lazy semantics imposes a runtime model which is in general difficult ...
The Intel labs Haskell research compiler
Haskell '13: Proceedings of the 2013 ACM SIGPLAN symposium on HaskellThe Glasgow Haskell Compiler (GHC) is a well supported optimizing compiler for the Haskell programming language, along with its own extensions to the language and libraries. Haskell's lazy semantics imposes a runtime model which is in general difficult ...
Automatic SIMD vectorization for Haskell
ICFP '13: Proceedings of the 18th ACM SIGPLAN international conference on Functional programmingExpressing algorithms using immutable arrays greatly simplifies the challenges of automatic SIMD vectorization, since several important classes of dependency violations cannot occur. The Haskell programming language provides libraries for programming ...
Comments