Table of Contents
Fetching ...

ECCO: Evidence-Driven Causal Reasoning for Compiler Optimization

Haolin Pan, Lianghong Huang, Jinyuan Dong, Mingjie Xing, Yanjun Wu

TL;DR

ECCO tackles compiler phase-ordering by integrating evidence-driven causal reasoning with a cooperative search framework. It builds a reverse-engineered Chain-of-Thought dataset linking static IR features to verifiable performance evidence, trains via a Two-Stage Policy Optimization, and deploys a Strategist-Tactician collaboration to guide a Genetic Algorithm. On seven benchmark suites, ECCO achieves a relative cycle reduction of $24.44\%$ over LLVM -O3, outperforming traditional heuristics and direct LLM prompting, demonstrating that grounding decisions in verifiable IR evidence yields superior performance and transparency. The results underscore the importance of causal alignment, scalable reasoning, and modular collaboration for practical ML-assisted compilation and provide datasets for community use.

Abstract

Compiler auto-tuning faces a dichotomy between traditional black-box search methods, which lack semantic guidance, and recent Large Language Model (LLM) approaches, which often suffer from superficial pattern matching and causal opacity. In this paper, we introduce ECCO, a framework that bridges interpretable reasoning with combinatorial search. We first propose a reverse engineering methodology to construct a Chain-of-Thought dataset, explicitly mapping static code features to verifiable performance evidence. This enables the model to learn the causal logic governing optimization decisions rather than merely imitating sequences. Leveraging this interpretable prior, we design a collaborative inference mechanism where the LLM functions as a strategist, defining optimization intents that dynamically guide the mutation operations of a genetic algorithm. Experimental results on seven datasets demonstrate that ECCO significantly outperforms the LLVM opt -O3 baseline, achieving an average 24.44% reduction in cycles.

ECCO: Evidence-Driven Causal Reasoning for Compiler Optimization

TL;DR

ECCO tackles compiler phase-ordering by integrating evidence-driven causal reasoning with a cooperative search framework. It builds a reverse-engineered Chain-of-Thought dataset linking static IR features to verifiable performance evidence, trains via a Two-Stage Policy Optimization, and deploys a Strategist-Tactician collaboration to guide a Genetic Algorithm. On seven benchmark suites, ECCO achieves a relative cycle reduction of over LLVM -O3, outperforming traditional heuristics and direct LLM prompting, demonstrating that grounding decisions in verifiable IR evidence yields superior performance and transparency. The results underscore the importance of causal alignment, scalable reasoning, and modular collaboration for practical ML-assisted compilation and provide datasets for community use.

Abstract

Compiler auto-tuning faces a dichotomy between traditional black-box search methods, which lack semantic guidance, and recent Large Language Model (LLM) approaches, which often suffer from superficial pattern matching and causal opacity. In this paper, we introduce ECCO, a framework that bridges interpretable reasoning with combinatorial search. We first propose a reverse engineering methodology to construct a Chain-of-Thought dataset, explicitly mapping static code features to verifiable performance evidence. This enables the model to learn the causal logic governing optimization decisions rather than merely imitating sequences. Leveraging this interpretable prior, we design a collaborative inference mechanism where the LLM functions as a strategist, defining optimization intents that dynamically guide the mutation operations of a genetic algorithm. Experimental results on seven datasets demonstrate that ECCO significantly outperforms the LLVM opt -O3 baseline, achieving an average 24.44% reduction in cycles.
Paper Structure (27 sections, 4 equations, 4 figures, 10 tables, 1 algorithm)

This paper contains 27 sections, 4 equations, 4 figures, 10 tables, 1 algorithm.

Figures (4)

  • Figure 1: Overview of the compiler phase-ordering task.
  • Figure 2: Overview of the ECCO. The pipeline consists of three distinct phases: (1) Causal Dataset Creation, where raw optimization trajectories are pruned and reverse-engineered into evidence-rich rationales; (2) Two-Stage Policy Optimization, which aligns the model via SFT and enhances exploration via GRPO; and (3) Collaborative Inference Framework, utilizing a Strategist-Tactician paradigm where the LLM's semantic intent directs the local search of a Genetic Algorithm.
  • Figure 3: The histogram illustrates the percentage of passes removed from original sequences without performance loss.
  • Figure 4: Scaling Analysis across Benchmarks. We plot the Best-of-$N$ performance ($\mathcal{I}_{O3}$) for different model scales (1.5B, 3B, 7B) and ablated variants. The bottom-right plot shows the aggregated average. Note that the performance of the 1.5B, 3B, and 7B models converges at higher sampling budgets ($N=32$), while removing Evidence or CoT results in a consistent performance deficit.