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.


翻译:窥孔优化是一类重要的编译器优化技术,其针对程序中的低效短指令序列进行优化。通过将此类次优指令替换为精炼且更优的序列,这些优化不仅能直接改善代码大小与性能,还能为后续优化流程开启更多转换可能。尽管其重要性显著,但由于指令集的复杂性与广泛性,发现新颖有效的窥孔优化仍具挑战。现有方法或缺乏可扩展性,或对可发现的窥孔优化存在严重限制。本文提出LPO,一种用于发现遗漏窥孔优化的新型自动化框架。我们的核心洞见在于:大型语言模型(LLMs)擅长创造性探索但易产生幻觉;反之,形式化验证技术能提供严格保证却难以进行创造性发现。通过将LLMs与形式化验证器在闭环反馈机制中协同结合,LPO能够有效发现先前被遗漏的已验证窥孔优化。我们在LLVM生态系统中对LPO进行了全面评估。实验表明,LPO成功识别出LLVM中25个已报告遗漏优化中的22个;相比之下,近期提出的LLVM超级优化器Souper与Minotaur分别仅检测到15个与3个。更重要的是,在十一个月的开发与间歇测试中,LPO共发现62个遗漏窥孔优化,其中28个已获确认,另有13个已在LLVM中被修复。这些结果证明,随着LLMs推理能力的提升,LPO具有持续发现新优化方案的强大潜力。

0
下载
关闭预览

相关内容

大语言模型在序列推荐中的应用
专知会员服务
19+阅读 · 2024年11月12日
一文速览大语言模型提示最新进展
专知会员服务
80+阅读 · 2023年12月24日
《大型语言模型指令调优》综述
专知会员服务
74+阅读 · 2023年8月27日
稀疏大模型简述:从MoE、Sparse Attention到GLaM
夕小瑶的卖萌屋
14+阅读 · 2022年3月22日
视线估计(Gaze Estimation)简介(一):概述
CVer
10+阅读 · 2020年3月18日
入门 | 深度学习模型的简单优化技巧
机器之心
10+阅读 · 2018年6月10日
TextInfoExp:自然语言处理相关实验(基于sougou数据集)
全球人工智能
12+阅读 · 2017年11月12日
从浅层模型到深度模型:概览机器学习优化算法
机器之心
27+阅读 · 2017年7月9日
国家自然科学基金
4+阅读 · 2017年12月31日
国家自然科学基金
6+阅读 · 2017年12月31日
国家自然科学基金
18+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
最新内容
高效视频扩散模型:进展与挑战
专知会员服务
0+阅读 · 50分钟前
乌克兰前线的五项创新
专知会员服务
4+阅读 · 今天6:14
 军事通信系统与设备的技术演进综述
专知会员服务
3+阅读 · 今天5:59
《北约标准:医疗评估手册》174页
专知会员服务
3+阅读 · 今天5:51
《提升生成模型的安全性与保障》博士论文
专知会员服务
3+阅读 · 今天5:47
美国当前高超音速导弹发展概述
专知会员服务
4+阅读 · 4月19日
无人机蜂群建模与仿真方法
专知会员服务
12+阅读 · 4月19日
澳大利亚发布《国防战略(2026年)》
专知会员服务
6+阅读 · 4月19日
相关基金
国家自然科学基金
4+阅读 · 2017年12月31日
国家自然科学基金
6+阅读 · 2017年12月31日
国家自然科学基金
18+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员