---
title: "Understanding Agent-Based Patching of Compiler Missed Optimizations"
source: "arXiv AI/CL/LG（论文）"
source_tier: "t2"
url: "https://arxiv.org/abs/2607.02370v1"
permalink: "https://feed.astralor.com/items/itm_d9fcb110e60c9ce816c7708a"
published: "2026-07-02T16:12:32.000Z"
score: 56
channel: "ai"
tags: ["LLVM","Historical Knowledge Enhancement","Agent","Compiler Optimization","Patch Generation"]
---

# Understanding Agent-Based Patching of Compiler Missed Optimizations

## At a glance

This paper systematically studies how AI agents patch compiler missed optimizations, constructing a benchmark of real-world LLVM issues. It finds that agent-generated patches often cover only part of the developer-intended scope or over-generalize. The authors propose historical-knowledge augmentation techniques (retrieval and distillation) using prior optimization pull requests, which significantly improve generalization alignment and show practical benefits on real IR.

## Key points

- Patching compiler missed optimizations requires generalization to similar cases, not just fixing the reported instance.
- Agent-generated patches often diverge from developer-intended scope (partial coverage or over-generalization).
- Retrieving and distilling historical LLVM optimization pull requests improves generalization alignment of patches.

## Full text

Compiler missed optimizations refer to cases in which compilers failed to optimize certain code. It takes many compiler developers' efforts to implement or patch such missed optimizations. In this paper, we present a systematic study of how well agents patch compiler missed optimizations. We identify a significant challenge that patching a missed optimization requires more than just fixing the reported case, and instead requires generalizing to similar cases. We construct a benchmark of real-world LLVM missed optimization issues and compare agent-generated patches with patches from developers in terms of optimization scope. Our results show that coding agents often optimize the given examples, but many generated patches either cover only part of the developer-intended scope or partially overlap with it; in some cases, they further generalize beyond the reference patch. We further introduce historical-knowledge augmentation techniques that leverage prior LLVM optimization pull requests through retrieval and distillation, showing that they improve developer-aligned generalization and yield practical benefits when applied to real-world IR.

---

Verify against the original before citing; curated by Astral Feed: https://feed.astralor.com/items/itm_d9fcb110e60c9ce816c7708a
