Abstract
The wealth of available compiler optimizations leads to the dual problems of finding the best set of optimizations and the best heuristic parameters to tune each optimization. We describe how machine learning techniques, such as logistic regression, can be used to address these problems. We focus on decreasing the compile time for a static commercial compiler, while preserving the execution time. We show that we can speed up the compile process by at least a factor of two with almost the same generated code quality on the SPEC2000 benchmark suite, and that our logistic classifier achieves the same prediction quality for non-SPEC benchmarks.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
Notes
- 1.
Different optimization levels (e.g., -O2, -O3) can be used to trade off compile time and code quality, but all selected transformations are applied to the whole program.
- 2.
These may well represent a local optimum, not the globally optimal values.
References
Agakov F, Bonilla E, Cavazos J, et al. (2006) Using machine learning to focus iterative optimization. In Proceedings of the 4th international symposium on code generation and optimization (CGO’06), March 2006, pp 295–305
Calder B, Grunwald D, Jones M, Lindsay D, Martin J, Mozer M, Zorn B (1997) Evidence-based static branch prediction using machine learning. ACM Trans Program Lang Syst 19(1):188–222
Cavazos J, Fursin G, Agakov F et al. (2007) Rapidly selecting good compiler optimizations using performance counters. In Proceedings of the 2007 international symposium on code generation and optimization (CGO ’07), March 2007, pp 185–197
Cavazos J, O’Boyle MFP (2006) Method-specific dynamic compilation using logistic regression. In Proceedings of OOPSLA ’06, October 2006, pp 229–240
Cooper KD, Subramanian D, Torczon L (2002) Adaptive optimizing compilers for the 21st century. J Supercomput 23(1):7–22
Fursin G, Miranda C, Temam O, Namolaru M, Yom-Tov E, Zaks A, Mendelson B, Barnard P, Ashton E, Courtois E, Bodin F, Bonilla E, Thomson J, Leather H, Williams C, O’Boyle M (2008) MILEPOST GCC: Machine-learning-based research compiler. In Proceedings of the GCC Developers’ Summit, June 2008
ORC (2008) Open Research Compiler for Itanium Processor Family. http://ipf-orc.sourceforge.net/
PathScale (2004) EKOPath compilers. http://www.pathscale.com/
Pan Z, Eigenmann R (2006) Fast, automatic, procedure-level performance tuning. In Proceedings of the 15th International Conference on Parallel Architecture and Compilation Techniques (PACT’06), September 2006, pp 173–181
Pekhimenko G (2008) Machine learning algorithms for choosing compiler heuristics. Master’s thesis, University of Toronto http://csng.cs.toronto.edu/publication_files/174/pgen_thesis.pdf.
Stephenson M, Amarasinghe S (2005) Predicting unroll factors using supervised classification. In Proceedings of the 2005 international symposium on code generation and optimization (CGO’05), March 2005, pp 123–134
Stephenson M, Amarasinghe S, Martin M, O’Reilly UM (2003) Meta optimization: improving compiler heuristics with machine learning. In Proceedings of the 2003 ACM SIGPLAN Conference on Programing Language Design and Implimentation (PLDI ’03), June 2003, pp 77–90
Seymour K, You H, Dongarra J (2008) A comparison of search heuristics for empirical code optimization. In Proceedings of the 2008 IEEE international conference on cluster computing (3rd Intl Wkshp on Automatic Perf. Tuning), pp 421–429
Standard Performance Evaluation Corporation (2000) SPEC CPU2000 benchmarks. http://www.spec.org/cpu2000/
Tal A (2007) Method and system for managing heuristic properties. US Patent Application No. 20070089104, 19 April 2007
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2011 Springer New York
About this chapter
Cite this chapter
Pekhimenko, G., Brown, A.D. (2011). Efficient Program Compilation Through Machine Learning Techniques. In: Naono, K., Teranishi, K., Cavazos, J., Suda, R. (eds) Software Automatic Tuning. Springer, New York, NY. https://doi.org/10.1007/978-1-4419-6935-4_19
Download citation
DOI: https://doi.org/10.1007/978-1-4419-6935-4_19
Published:
Publisher Name: Springer, New York, NY
Print ISBN: 978-1-4419-6934-7
Online ISBN: 978-1-4419-6935-4
eBook Packages: EngineeringEngineering (R0)