Learning Compiler Pass Orders using Coreset and Normalized Value Prediction
Youwei Liang, Kevin Stone, Ali Shameli, Chris Cummins, Mostafa Elhoushi, Jiadong Guo, Benoit Steiner, Xiaomeng Yang, Pengtao Xie, Hugh James Leather, Yuandong Tian
Abstract
Finding the optimal pass sequence of compilation can lead to a significant reduction in program size and/or improvement in program efficiency. Prior works on compilation pass ordering have two major drawbacks. They either require an excessive budget (in terms of compilation steps) at compile time or fail to generalize to unseen programs. In this paper, for code-size reduction tasks, we propose a novel pipeline to find program-dependent pass sequences within 45 compilation calls. It first identifies a coreset of 50 pass sequences via greedy optimization of a submodular function, and then learns a policy with Graph Neural Network (GNN) to pick the optimal sequence by predicting the normalized values of the pass sequences in the coreset. Despite its simplicity, our pipeline outperforms the default -Oz flag by an average of 4.7% over a large collection (4683) of unseen code repositories from diverse domains across 14 datasets. In comparison, previous approaches like reinforcement learning on the raw pass sequence space may take days to train due to sparse reward, and may not generalize well in held-out ones from different domains. Our results demonstrate that existing human-designed compiler flags can be improved with a simple yet effective technique that transforms the raw action space into a small one with denser rewards.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext b190c75e-b79c-4507-9528-5112c22d12c2Cited by top-tier papers3
- Compiler-R1: Towards Agentic Compiler Auto-tuning with Reinforcement LearningHaolin Pan, Hongyu Lin, Haoran Luo, Yang Liu et al.NeurIPS 2025 · 14 citations
- ECCO: Evidence-Driven Causal Reasoning for Compiler OptimizationHaolin Pan, Lianghong Huang, Dong Jinyuan, Mingjie Xing et al.ICML 2026 · 2 citations
- CompilerDream: Learning a Compiler World Model for General Code OptimizationChaoyi Deng, Jialong Wu, Ningya Feng, Jianmin Wang et al.KDD 2025
Builds on5
- How Attentive are Graph Attention Networks?Shaked Brody, Uri Alon, Eran YahavICLR 2022 · 1,717 citations
- GraphCodeBERT: Pre-training Code Representations with Data FlowDaya Guo, Shuo Ren, Shuai Lu, Zhangyin Feng et al.ICLR 2021 · 1,644 citations
- CURL: Contrastive Unsupervised Representations for Reinforcement LearningMichael Laskin, Aravind Srinivas, Pieter AbbeelICML 2020 · 1,261 citations
- ProGraML: A Graph-based Program Representation for Data Flow Analysis and Compiler OptimizationsChris Cummins, Zacharias V. Fisches, Tal Ben-Nun, Torsten Hoefler et al.ICML 2021 · 140 citations
- Transferable Graph Optimizers for ML CompilersYanqi Zhou, Sudip Roy, AmirAli Abdolrashidi, Daniel Wong et al.NeurIPS 2020 · 63 citations
Related papers
- Reinforced Genetic Algorithm Learning for Optimizing Computation GraphsAditya Paliwal, Felix Gimeno, Vinod Nair, Yujia Li et al.ICLR 2020 · 70 citations
- Neural Topological Ordering for Computation GraphsMukul Gagrani, Corrado Rainone, Yang Yang, Harris Teague et al.NeurIPS 2022 · 21 citations
- Learning Execution through Neural Code fusionZhan Shi, Kevin Swersky, Daniel Tarlow, Parthasarathy Ranganathan et al.ICLR 2020 · 32 citations
- Behavioral Embeddings of Programs: A Quasi-Dynamic Approach for Optimization PredictionHaolin Pan, Dong Jinyuan, Hongbin Zhang, Hongyu Lin et al.ICLR 2026
- Optimizing Tensor Network Contraction Using Reinforcement LearningEli A. Meirom, Haggai Maron, Shie Mannor, Gal ChechikICML 2022 · 21 citations
