Structure-Aware Compiler Auto-Tuning

  • Anderson Faustino da Silva UEM
  • Christian Schwarz TU Dresden
  • Jeronimo Castrillon TU Dresden

Resumo


Modern compilers such as GCC expose large sets of optimization flags whose interactions induce a high-dimensional configuration space, making manual tuning impractical and exhaustive auto-tuning infeasible. Recent approaches, including Bayesian-optimization-based search and critical-flag selection via static analysis, improve sample efficiency but can exhibit premature convergence to locally optimal configurations. We present SACT, a structure-aware compiler auto-tuning framework that integrates static program characterization with surrogate-guided search to reduce stagnation. SACT extracts lightweight structural features, initializes a program embedding, and uses surrogate-sensitivity-based relevance estimates to adaptively focus the search on influential flags while maintaining controlled exploration. The embedding is refined online from compile–execute measurements, enabling the surrogate to capture program-specific flag interactions over the course of tuning. Experiments on GCC 15.2.0 using the PolyBench and MiBench benchmark suites show that SACT achieves a better geometric average speedup than prior methods while requiring a low wall-clock budget.

Palavras-chave: Compiler autotuning, Optimization flags, Iterative compilation, Surrogate-guided search, Program structure, Dimensionality reduction

Referências

Mohamad Faiz Ahmad, Nor Ashidi Mat Isa, Wei Hong Lim, and Koon Meng Ang. 2022. Differential evolution: A recent review based on state-of-the-art works. Alexandria Engineering Journal 61, 5 (2022), 3831–3872. DOI: 10.1016/j.aej.2021.09.013

Mohammed Almakki, Ayman Izzeldin, Qijing Huang, Ameer Haj Ali, and Chris Cummins. 2022. Autophase V2: Towards Function Level Phase Ordering Optimization. MLArchSys 2022. [link]

Amir H. Ashouri, William Killian, John Cavazos, Gianluca Palermo, and Cristina Silvano. 2018. A Survey on Compiler Autotuning Using Machine Learning. Comput. Surveys 51, 5 (2018), 96:1–96:42. DOI: 10.1145/3197978

Amir H. Ashouri, Muhammad Asif Manzoor, Minh Vu, Raymond Zhang, Ziwen Wang, Angel Zhang, Bryan Chan, Tomasz S. Czajkowski, and Yaoqing Gao. 2024. Work-in-Progress: ACPO: An AI-Enabled Compiler Framework. In Proceedings of the International Conference on Compilers, Architecture, and Synthesis for Embedded Systems. IEEE, Raleigh, NC, USA, 21–21. DOI: 10.1109/CASES60062.2024.00011

Amir H. Ashouri, Giovanni Mariani, Gianluca Palermo, and Cristina Silvano. 2014. A Bayesian Network Approach for Compiler Auto-Tuning for Embedded Processors. In Proceedings of the IEEE Symposium on Embedded Systems for Real-Time Multimedia. IEEE, Greater Noida, India, 90–97. DOI: 10.1109/ESTIMedia.2014.6962349

Prasanna Balaprakash, Robert B. Gramacy, and Stefan M. Wild. 2013. Active learning-based surrogate models for empirical performance tuning. In Proceedings of the International Conference on Cluster Computing. IEEE, Indianapolis, IN, USA, 1–8. DOI: 10.1109/CLUSTER.2013.6702683

Alexander Brauckmann, Andrés Goens, Sebastian Ertel, and Jeronimo Castrillon. 2020. Compiler-based graph representations for deep learning models of code. In Proceedings of the International Conference on Compiler Construction (San Diego, CA, USA) (CC 2020). Association for Computing Machinery, New York, NY, USA, 201–211. DOI: 10.1145/3377555.3377894

Martin Chak, Nikolas Kantas, and Grigorios A Pavliotis. 2023. On the Generalized Langevin Equation for Simulated Annealing. SIAM/ASA Journal on Uncertainty Quantification 11, 1 (2023), 139–167. DOI: 10.1137/21M1462970

Junjie Chen, Ningxin Xu, Peiqi Chen, and Hongyu Zhang. 2021. Efficient Compiler Autotuning via Bayesian Optimization. In Proceedings of the International Conference on Software Engineering. IEEE, Spain, 1198–1209. DOI: 10.1109/ICSE43902.2021.00110

Yang Chen, Shuangde Fang, Yuanjie Huang, Lieven Eeckhout, Grigori Fursin, Olivier Temam, and ChengyongWu. 2012. Deconstructing Iterative Optimization. ACM Transactions on Architecture and Code Optimization (TACO) 9, 3 (2012), 21:1–21:30. DOI: 10.1145/2355585.2355594

Chris Cummins, Zacharias V. Fisches, Tal Ben-Nun, Torsten Hoefler, Michael F. P. O’Boyle, and Hugh Leather. 2021. ProGraML: A Graph-based Program Representation for Data Flow Analysis and Compiler Optimizations. In Proceedings of the International Conference on Machine Learning (Proceedings of Machine Learning Research, Vol. 139), Marina Meila and Tong Zhang (Eds.). PMLR, Virtual Event, 2244–2253. [link]

Chris Cummins, Volker Seeker, Dejan Grubisic, Mostafa Elhoushi, Youwei Liang, Baptiste Roziere, Jonas Gehring, Fabian Gloeckle, Kim Hazelwood, Gabriel Synnaeve, and Hugh Leather. 2023. Large Language Models for Compiler Optimization. arXiv:2309.07062 [cs.PL] [link]

Chris Cummins, Bram Wasti, Jiadong Guo, Brandon Cui, Jason Ansel, Sahir Gomez, Somya Jain, Jia Liu, Olivier Teytaud, Benoit Steiner, Yuandong Tian, and Hugh Leather. 2022. CompilerGym: robust, performant compiler optimization environments for AI research. In Proceedings of the International Symposium on Code Generation and Optimization (Virtual Event, Republic of Korea) (CGO ’22). IEEE Press, Seoul, Republic of Korea, 92–105. DOI: 10.1109/CGO53902.2022.9741258

Chaoyi Deng, Jialong Wu, Ningya Feng, Jianmin Wang, and Mingsheng Long. 2025. CompilerDream: Learning a Compiler World Model for General Code Optimization. In Proceedings of the 31st ACM SIGKDD Conference on Knowledge Discovery and Data Mining V.2. Association for Computing Machinery, Toronto, ON, Canada, 486–497. DOI: 10.1145/3711896.3736887

Grigori Fursin, Yuriy Kashnikov, Abdul Wahid Memon, Zbigniew Chamski, Olivier Temam, Mircea Namolaru, Elad Yom-Tov, Bilha Mendelson, Ayal Zaks, Eric Courtois, François Bodin, Phil Barnard, Elton Ashton, Edwin Bonilla, John Thomson, Christopher Williams, and Michael O’Boyle. 2011. Milepost GCC: Machine Learning Enabled Self-tuning Compiler. International Journal of Parallel Programming 39, 3 (2011), 296–327. DOI: 10.1007/s10766-010-0161-2

Unai Garciarena and Roberto Santana. 2016. Evolutionary Optimization of Compiler Flag Selection by Learning and Exploiting Flags Interactions. In Proceedings of the Genetic and Evolutionary Computation Conference Companion (Denver, Colorado, USA). Association for Computing Machinery, New York, NY, USA, 1159–1166. DOI: 10.1145/2908961.2931696

M. R. Guthaus, J. S. Ringenberg, D. Ernst, T. M. Austin, T. Mudge, and R. B. Brown. 2001. MiBench: A free, commercially representative embedded benchmark suite. In Proceedings of the International Workshop on Workload Characterization. IEEE Computer Society, USA, 3–14. DOI: 10.1109/WWC.2001.990739

Mohd. Sayemul Haque, Md. Fahim, and Muhammad Ibrahim. 2023. An Exploratory Study on Simulated Annealing for Feature Selection in Learning-to-Rank. arXiv:2310.13269 [cs.LG] [link]

Erik Orm Hellsten, Artur Souza, Johannes Lenfers, Rubens Lacouture, Olivia Hsu, Adel Ejjeh, Fredrik Kjolstad, Michel Steuwer, Kunle Olukotun, and Luigi Nardi. 2023. BaCO: A Fast and Portable Bayesian Compiler Optimization Framework. In Proceedings of the International Conference on Architectural Support for Programming Languages and Operating Systems (Vancouver, BC, Canada) (ASPLOS ’23). Association for Computing Machinery, New York, NY, USA, 19–42. DOI: 10.1145/3623278.3624770

Shalini Jain, Yashas Andaluri, S. VenkataKeerthy, and Ramakrishna Upadrasta. 2022. POSET-RL: Phase Ordering for Optimizing Size and Execution Time Using Reinforcement Learning. In Proceedings of the IEEE International Symposium on Performance Analysis of Systems and Software. IEEE, Singapore, Singapore, 121–131. DOI: 10.1109/ISPASS55109.2022.00012

Jian-Yu Li, Zhi-Hui Zhan, and Jun Zhang. 2022. Evolutionary computation for expensive optimization: A survey. Machine Intelligence Research 19, 1 (2022), 3–23. DOI: 10.1007/s11633-022-1317-4

San-Chih Lin, Chi-Kuang Chang, and Nai-Wei Lin. 2008. Automatic selection of GCC optimization options using a gene weighted genetic algorithm. In Proceedings of the Asia-Pacific Computer Systems Architecture Conference. IEEE, Hsinchu, Taiwan, 1–8. DOI: 10.1109/APCSAC.2008.4625477

Vivek Nair, Zhe Yu, Tim Menzies, Norbert Siegmund, and Sven Apel. 2020. Finding Faster Configurations Using FLASH. IEEE Transactions on Software Engineering 46, 7 (2020), 794–811. DOI: 10.1109/TSE.2018.2870895

Zhelong Pan and Rudolf Eigenmann. 2006. Fast and Effective Orchestration of Compiler Optimizations for Automatic Performance Tuning. In Proceedings of the International Symposium on Code Generation and Optimization (CGO ’06). IEEE Computer Society, USA, 319–332. DOI: 10.1109/CGO.2006.38

Louis-Noël Pouchet. 2012. PolyBench/C: The Polyhedral Benchmark Suite. Software benchmark suite, version 3.2. [link]

Anderson Faustino da Silva, Bernardo N. B. de Lima, and Fernando Magno Quintão Pereira. 2021. Exploring the space of optimization sequences for codesize reduction: insights and tools. In Proceedings of the International Conference on Compiler Construction (Virtual, Republic of Korea) (CC 2021). Association for Computing Machinery, New York, NY, USA, 47–58. DOI: 10.1145/3446804.3446849

Jacob O. Tørring, Carl Hvarfner, Luigi Nardi, and Magnus Själander. 2025. CATBench: A Compiler Autotuning Benchmarking Suite for Black-box Optimization. In Proceedings of the Fourth International Conference on Automated Machine Learning (Proceedings of Machine Learning Research, Vol. 293), Leman Akoglu, Carola Doerr, Jan N. van Rijn, Roman Garnett, and Jacob R. Gardner (Eds.). PMLR, New York, NY, USA, 24/1–20. [link]

Mircea Trofin, Yundi Qian, Eugene Brevdo, Zinan Lin, Krzysztof Choromanski, and David Li. 2021. MLGO: A Machine Learning Guided Compiler Optimizations Framework. arXiv:2101.04808 [cs.PL] [link]

S. VenkataKeerthy, Rohit Aggarwal, Shalini Jain, Maunendra Sankar Desarkar, Ramakrishna Upadrasta, and Y. N. Srikant. 2020. IR2VEC: LLVM IR Based Scalable Program Embeddings. ACM Trans. Archit. Code Optim. 17, 4, Article 32 (Dec. 2020), 27 pages. DOI: 10.1145/3418463

Gaurav Verma, Siddhisanket Raskar, Murali Emani, and Barbara Chapman. 2024. Cross-Feature Transfer Learning for Efficient Tensor Program Generation. Applied Sciences 14, 2 (2024). DOI: 10.3390/app14020513

Zheng Wang and Michael F. P. O’Boyle. 2018. Machine Learning in Compiler Optimization. Proc. IEEE 106, 11 (2018), 1879–1901. DOI: 10.1109/JPROC.2018.2817118

Guojian Xiao, Haoxuan Pi, Yifan Bai, Kuan Li, and Jianping Yin. 2025. PreTuner: Compiler Flag Auto-Tuning Based on Iterative Compilation and Predictive Model. In Proceedings of the International Conference on Computer Supported Cooperative Work in Design, Weiming Shen, Marie-Hélène Abel, Nada Matta, Jean-Paul A. Barthès, Junzhou Luo, Jinghui Zhang, Haibin Zhu, and Kunkun Peng (Eds.). IEEE, Compiegne, France, 1998–2004. DOI: 10.1109/CSCWD64889.2025.11033656

Haigang Zhang and Da Wang. 2022. An External Selection Mechanism for Differential Evolution Algorithm. Computational Intelligence and Neuroscience 2022 (2022), 1–18. DOI: 10.1155/2022/4544818

Mingxuan Zhu and Dan Hao. 2023. Compiler Auto-Tuning via Critical Flag Selection. In Proceedings of the International Conference on Automated Software Engineering. IEEE Press, Echternach, Luxembourg, 1000–1011. DOI: 10.1109/ASE56229.2023.00209

Mingxuan Zhu, Dan Hao, and Junjie Chen. 2024. Compiler Autotuning through Multiple-phase Learning. ACM Transactions on Software Engineering and Methodology 33, 4, Article 100 (April 2024), 38 pages. DOI: 10.1145/3640330
Publicado
08/09/2026
SILVA, Anderson Faustino da; SCHWARZ, Christian; CASTRILLON, Jeronimo. Structure-Aware Compiler Auto-Tuning. In: SIMPÓSIO BRASILEIRO DE LINGUAGENS DE PROGRAMAÇÃO (SBLP), 30. , 2026, São Paulo/SP. Anais [...]. Porto Alegre: Sociedade Brasileira de Computação, 2026 . p. 1-9. DOI: https://doi.org/10.5753/sblp.2026.27435.