Compiler-R1: Towards Agentic Compiler Auto-tuning with Reinforcement Learning
Haolin Pan, Hongyu Lin, Haoran Luo, Yang Liu, Kaichun Yao, Libo Zhang, Mingjie Xing, Yanjun Wu
Abstract
Compiler auto-tuning optimizes pass sequences to improve performance metrics such as Intermediate Representation (IR) instruction count. Although recent advances leveraging Large Language Models (LLMs) have shown promise in automating compiler tuning, two significant challenges still remain: the absence of high-quality reasoning datasets for agents training, and limited effective interactions with the compilation environment. In this work, we introduce Compiler-R1, the first reinforcement learning (RL)-driven framework specifically augmenting LLM capabilities for compiler auto-tuning. Compiler-R1 features a curated, high-quality reasoning dataset and a novel two-stage end-to-end RL training pipeline, enabling efficient environment exploration and learning through an outcome-based reward. Extensive experiments across seven datasets demonstrate Compiler-R1 achieving an average 8.46% IR instruction count reduction compared to opt -Oz, showcasing the strong potential of RL-trained LLMs for compiler optimization. Our code and datasets are publicly available at https://github.com/Panhaolin2001/Compiler-R1.
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 9209f1fb-08f5-46a8-addc-67f2065c456eCited by top-tier papers4
- TuneAgent: Agentic Operating System Kernel Tuning with Reinforcement LearningHongyu Lin, Yuchen Li, Haoran Luo, Zhenghong Lin et al.KDD 2026 · 3 citations
- ECCO: Evidence-Driven Causal Reasoning for Compiler OptimizationHaolin Pan, Lianghong Huang, Dong Jinyuan, Mingjie Xing et al.ICML 2026 · 2 citations
- Behavioral Embeddings of Programs: A Quasi-Dynamic Approach for Optimization PredictionHaolin Pan, Dong Jinyuan, Hongbin Zhang, Hongyu Lin et al.ICLR 2026
- CIRBench: Evaluating Large Language Models as LLVM IR OptimizersZi Yang, Haifeng Ding, Fei Liu, Yingying Cheng et al.ICML 2026
Builds on6
- Sample Efficient Reinforcement Learning with REINFORCEJunzi Zhang, Jongho Kim, Brendan O'Donoghue, Stephen P. BoydAAAI 2021 · 162 citations
- Efficient Compiler Autotuning via Bayesian OptimizationJunjie Chen, Ningxin Xu, Peiqi Chen, Hongyu ZhangICSE 2021 · 73 citations
- Graph-R1: Towards Agentic GraphRAG Framework via End-to-end Reinforcement LearningHaoran Luo, Haihong E, Guanting Chen, Qika Lin et al.ICML 2026 · 50 citations
- MetaSpatial: Reinforcing 3D Spatial Reasoning in VLMs for the MetaverseZhenyu Pan, Han LiuICLR 2026 · 49 citations
- Learning Compiler Pass Orders using Coreset and Normalized Value PredictionYouwei Liang, Kevin Stone, Ali Shameli, Chris Cummins et al.ICML 2023 · 26 citations
Related papers
- Retro-R1: LLM-based Agentic RetrosynthesisWei Liu, Jiangtao Feng, Hongli Yu, Yuxuan Song et al.NeurIPS 2025 · 8 citations
- Learning from Synthetic Data Improves Multi-hop ReasoningAnmol Kabra, Yilun Yin, Albert Gong, Kamilė Stankevičiūtė et al.ICLR 2026 · 6 citations
- QiMeng-CodeV-R1: Reasoning-Enhanced Verilog GenerationYaoyu Zhu, Di Huang, Han-Qi Lyu, Xiaoyun Zhang et al.NeurIPS 2025 · 46 citations
- PerfDojo: Automated ML Library Generation for Heterogeneous ArchitecturesAndrei Ivanov, Siyuan Shen, Gioele Gottardo, Marcin Chrapek et al.SC 2025 · 2 citations
- AUTOCIRCUIT-RL: Reinforcement Learning-Driven LLM for Automated Circuit Topology GenerationPrashanth Vijayaraghavan, Luyao Shi, Ehsan Degan, Vandana V. Mukherjee et al.ICML 2025
