arXiv:2607.02370cs.SEcs.AI2026-07

研究智能体如何修复编译器遗漏优化,发现其泛化能力不足。

Understanding Agent-Based Patching of Compiler Missed Optimizations

论文配图:Understanding Agent-Based Patching of Compiler Missed Optimizations
图 1 · 摘自论文原文
  • 用真实LLVM问题构建基准,对比智能体与开发者补丁
  • 智能体多仅修复单例,泛化范围常小于或超出人工补丁
  • 引入历史补丁知识增强,提升泛化效果,适用于实际IR修复

编译器遗漏优化指编译器未能对特定代码进行优化的情况。本文系统研究智能体修复此类问题的效果。我们发现,修复一个遗漏优化不仅需解决报告案例,还需推广至类似场景。为此,我们构建了包含真实世界LLVM遗漏优化问题的基准数据集,并对比智能体生成补丁与开发者补丁在优化范围上的差异。结果表明,编码智能体虽能修复给定示例,但多数生成补丁仅覆盖部分开发者意图范围,或与之部分重叠;少数情况下甚至过度泛化。进一步提出基于历史补丁检索与提炼的历史知识增强技术,显著提升智能体在开发者对齐意义上的泛化能力,在实际IR修复中展现实用价值。

原文摘要 · Abstract (English)

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.

编译器优化智能体修复代码生成知识增强

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。