paperbot · PL 论文追踪

全部论文 待读 收藏

P0 LPO: Discovering Missed Peephole Optimizations with Large Language Models

LPO:利用大语言模型发现遗漏的窥孔优化
ASPLOS Proceedings of the 31st ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 22026匹配度 8/10 · 论文将 LLM 与形式化验证闭环结合,用于发现 LLVM 中遗漏的窥孔优化,属于用户关注的 AI→PL 方向(LLM/Agent 辅助形式化验证与程序优化),并在 LLVM 工业生态中验证有效,兼具工程落地与问题驱动特征。但任务聚焦编译器窥孔优化,而非静态分析、浮点或贝叶斯程序分析,因此并非最核心。引用 4 inbox
Zhenyang Xu, Hongxu Xu, Yongqiang Tian, Xintong Zhou, Chengnian Sun
crossref: 2026-09-12dblp: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:结合大语言模型与形式化验证,闭环自动发现 LLVM 中遗漏的窥孔优化。

窥孔优化对代码大小和性能至关重要,但指令集复杂,传统方法难扩展或限制多。LPO 的核心洞察是 LLM 擅长创造性探索却易产生幻觉,而形式验证能提供严格保证却难以发现新优化。该框架将两者结合成闭环反馈:LLM 生成候选窥孔优化,形式验证器验证其正确性,反馈再引导后续搜索。作者在 LLVM 生态中评估,LPO 在 25 个已知遗漏优化中识别出 22 个,优于 Souper 的 15 个和 Minotaur 的 3 个;在 11 个月开发与间歇测试中发现 62 个遗漏窥孔优化,其中 28 个被确认,另有 13 个已在 LLVM 中修复。结果表明该方法能持续发现新优化,并随 LLM 推理能力提升而受益。

问题
指令集复杂庞大,现有自动方法难以扩展或对可发现的窥孔优化施加严格限制,导致编译器遗漏有效优化。
方法
LPO 将 LLM 的创造性候选生成与形式验证器的严格正确性保证结合为闭环反馈,自动发现并验证遗漏的窥孔优化。
评估
在 LLVM 生态中评估:在 25 个已报告遗漏优化上识别出 22 个,优于 Souper 和 Minotaur;长期测试发现 62 个遗漏优化,28 个确认、13 个修复。
原文摘要(Abstract)

Peephole optimization is an essential class of compiler optimizations that targets small, inefficient instruction sequences within programs. By replacing such suboptimal instructions with refined and more optimal sequences, these optimizations not only directly optimize code size and performance, but also enable more transformations in the subsequent optimization pipeline. Despite their importance, discovering new and effective peephole optimizations remains challenging due to the complexity and breadth of instruction sets. Prior approaches either lack scalability or have significant restrictions on the peephole optimizations that they can find. This paper introduces LPO, a novel automated framework to discover missed peephole optimizations. Our key insight is that, Large Language Models (LLMs) are effective at creative exploration but susceptible to hallucinations; conversely, formal verification techniques provide rigorous guarantees but struggle with creative discovery. By synergistically combining the strengths of LLMs and formal verifiers in a closed-loop feedback mechanism, LPO can effectively discover verified peephole optimizations that were previously missed. We comprehensively evaluated LPO within LLVM ecosystems. Our evaluation shows that LPO can successfully identify up to 22 out of 25 previously reported missed optimizations in LLVM. In contrast, the recently proposed superoptimizers for LLVM, Souper and Minotaur detected 15 and 3 of them, respectively. More importantly, within eleven months of development and intermittent testing, LPO found 62 missed peephole optimizations, of which 28 were confirmed and an additional 13 had already been fixed in LLVM. These results demonstrate LPO's strong potential to continuously uncover new optimizations as LLMs' reasoning improves.

链接与引用

DOI 原文 · arXiv · PDF(开放获取) · DBLP

BibTeX
@inproceedings{XuX0ZS26,
  title = {LPO: Discovering Missed Peephole Optimizations with Large Language Models},
  author = {Zhenyang Xu and Hongxu Xu and Yongqiang Tian and Xintong Zhou and Chengnian Sun},
  booktitle = {ASPLOS},
  year = {2026},
  doi = {10.1145/3779212.3790184}
}