Compiler Autotuning through Multiple-phase Learning
Open Access
- 18 April 2024
- journal article
- research article
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Software Engineering and Methodology
- Vol. 33 (4) , 1-38
Abstract
Widely used compilers like GCC and LLVM usually have hundreds of optimizations controlled by optimization flags, which are enabled or disabled during compilation to improve the runtime performance (e.g., small execution time) of the compiler program. Due to the large number of optimization flags and their combination, it is difficult for compiler users to manually tune compiler optimization flags. In the literature, a number of autotuning techniques have been proposed, which tune optimization flags for a compiled program by comparing its actual runtime performance with different optimization flag combinations. Due to the huge search space and heavy actual runtime cost, these techniques suffer from the widely recognized efficiency problem. To reduce the heavy runtime cost, in this article we propose a lightweight learning approach that uses a small number of actual runtime performance data to predict the runtime performance of a compiled program with various optimization flag combinations. Furthermore, to reduce the search space, we design a novel particle swarm algorithm that tunes compiler optimization flags with the prediction model. To evaluate the performance of the proposed approach, CompTuner, we conduct an extensive experimental study on two popular C compilers, GCC and LLVM, with two widely used benchmarks, cBench and PolyBench. The experimental results show that CompTuner significantly outperforms the six compared techniques, including the state-of-the-art technique BOCA.Keywords
All Related Versions
Funding Information
- National Natural Science Foundation of China (62232001)
- National Natural Science Foundation of China (62322208)
- CCF Young Elite Scientists Sponsorship Program
This publication has 28 references indexed in Scilit:
- Taking the Human Out of the Loop: A Review of Bayesian OptimizationProceedings of the IEEE, 2015
- Performance-influence models for highly configurable systems2015
- Particle swarm optimization2014
- Finding good optimization sequences covering program spaceACM Transactions on Architecture and Code Optimization, 2013
- Deconstructing iterative optimizationACM Transactions on Architecture and Code Optimization, 2012
- Roulette-wheel selection via stochastic acceptancePhysica A: Statistical Mechanics and its Applications, 2012
- Finding effective compilation sequencesACM SIGPLAN Notices, 2004
- Empirical study of particle swarm optimization2003
- Advanced compiler optimizations for supercomputersCommunications of the ACM, 1986
- A survey of compiler optimization techniques1973