Synergy-Guided Compiler Auto-Tuning of Nested LLVM Pass Pipelines

📅 2025-10-15
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
Existing automated pass-tuning methods assume linear pass sequences, rendering them incompatible with LLVM’s new Pass Manager—which employs a nested hierarchical structure—thus yielding syntactically invalid pipelines. Method: We propose the first automated tuning framework for nested optimization pipelines: (i) we formally define a context-free grammar specifying syntactically valid pipelines; (ii) we introduce a forest-based data structure to natively represent nested pass topologies; and (iii) we design a structure-aware, co-evolutionary genetic algorithm augmented with a local refinement mechanism. Results: Evaluated across seven benchmark suites, our generated optimization policies reduce instruction count by 13.62% on average over `opt -Oz`, demonstrating substantial improvement in discovering high-performance, syntactically valid pass combinations under complex structural constraints.

Technology Category

Application Category

📝 Abstract
Compiler optimization relies on sequences of passes to improve program performance. Selecting and ordering these passes automatically, known as compiler auto-tuning, is challenging due to the large and complex search space. Existing approaches generally assume a linear sequence of passes, a model compatible with legacy compilers but fundamentally misaligned with the hierarchical design of the LLVM New Pass Manager. This misalignment prevents them from guaranteeing the generation of syntactically valid optimization pipelines. In this work, we present a new auto-tuning framework built from the ground up for the New Pass Manager. We introduce a formal grammar to define the space of valid nested pipelines and a forest-based data structure for their native representation. Upon this foundation, we develop a structure-aware Genetic Algorithm whose operators manipulate these forests directly, ensuring that all candidate solutions are valid by construction. The framework first mines synergistic pass relationships to guide the search. An optional refinement stage further explores subtle performance variations arising from different valid structural arrangements. We evaluate our approach on seven benchmark datasets using LLVM 18.1.6. The discovered pipelines achieve an average of 13.62% additional instruction count reduction compared to the standard opt -Oz optimization level, showing that our framework is capable of navigating this complex, constrained search space to identify valid and effective pass pipelines.
Problem

Research questions and friction points this paper is trying to address.

Automating selection and ordering of LLVM compiler passes
Ensuring generation of syntactically valid nested optimization pipelines
Navigating large complex search space for performance improvements
Innovation

Methods, ideas, or system contributions that make the work stand out.

Formal grammar defines valid nested pass pipelines
Forest-based data structure represents optimization pipelines natively
Structure-aware genetic algorithm ensures valid pipeline construction
Haolin Pan
Haolin Pan
Institute of Software Chinese Academy of Sciences
AI for CompilerSIMD OptimizationCompiler Technology
J
Jinyuan Dong
Institute of Software, Chinese Academy of Sciences, China and University of Chinese Academy of Sciences, China
M
Mingjie Xing
Institute of Software, Chinese Academy of Sciences, China
Yanjun Wu
Yanjun Wu
Institute of Software, Chinese Academy of Sciences
Computer Science