AutoPass: Evidence-Guided LLM Agents for Compiler Performance Tuning
Summary
AutoPass is a multi-agent framework designed for LLVM compiler performance tuning, leveraging Large Language Models (LLMs) to guide optimization decisions. Unlike traditional black-box autotuning, AutoPass integrates LLMs directly with compiler-internal optimization states and intermediate representation analysis. Operating in an inference-only, training-free setting, it requires no offline training or task-specific fine-tuning, making it highly adaptable. Implemented on the LLVM compiler, AutoPass was evaluated on server-grade x86-64 and embedded ARM64 systems. It consistently outperformed expert-tuned heuristics and classical autotuning methods, achieving geometric-mean speedups of 1.043x on x86-64 and 1.117x on ARM64 over the LLVM -O3 baseline. The framework comprises a Score Agent for hotspot identification, an Analysis Agent for feature extraction, a Reasoning Agent for core optimization, and an Evaluation Agent for performance feedback, demonstrating architecture-aware optimization and robust iterative refinement.
Key takeaway
For Machine Learning Engineers or Compiler Engineers optimizing code performance, particularly on diverse architectures like x86-64 and ARM64, you should explore multi-agent LLM frameworks for compiler tuning. AutoPass demonstrates that integrating LLMs with compiler-internal feedback and runtime measurements can yield superior speedups over -O3, such as 1.043x on x86-64 and 1.117x on ARM64, without requiring offline training. Implement iterative refinement and a rollback policy to ensure robust, architecture-aware optimization and mitigate initial performance regressions.
Key insights
LLMs effectively guide compiler optimization by integrating compiler-internal signals and runtime feedback without offline training.
Principles
- Context-sensitive LLM reasoning improves compiler tuning.
- Compiler-internal signals enhance LLM optimization decisions.
- Iterative refinement with runtime feedback boosts robustness.
Method
A multi-agent LLM framework iteratively refines compiler pass sequences and parameters, guided by compiler remarks, IR analysis, and measured runtime performance feedback.
In practice
- Query compiler artifacts for transformation effects.
- Employ LLM agents for pass ordering and parameter selection.
- Implement a rollback mechanism for performance regressions.
Topics
- LLM Agents
- Compiler Optimization
- Performance Tuning
- LLVM
- Multi-Agent Systems
- Architecture-Aware Optimization
Best for: AI Engineer, Research Scientist, AI Scientist, Machine Learning Engineer, Software Engineer
Related on AIssential
Editorial summary, takeaway, and curation by AIssential. Original article published by cs.SE updates on arXiv.org.