arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2604.15041cs.SE
收藏

HintPilot: 基于LLM的编译器提示合成用于代码优化

HintPilot: LLM-based Compiler Hint Synthesis for Code Optimization

The State Key Laboratory of Blockchain and Data Security, Zhejiang University(浙江大学区块链与数据安全国家重点实验室);Purdue University(普渡大学)

Hanyun Jiang, Peisen Yao, Kaiyue Li, Tingting Lin, Chengpeng Wang, Kui Ren

AI总结:

HintPilot通过合成编译器提示注解,结合LLM推理与传统编译器基础设施,提升代码优化效果,实现6.88倍速度提升且保持程序正确性。

摘要:

代码优化仍是软件开发的核心目标,但现代编译器难以应对庞大的优化空间。尽管近期研究尝试利用大语言模型(LLMs)直接优化源代码,但这些技术可能引入语义错误并遗漏细粒度的编译器级优化机会。我们提出了HintPilot,通过合成编译器提示注解,将LLM推理与传统编译器基础设施相结合。HintPilot利用检索增强的合成方法处理编译器文档,并应用基于剖析的迭代精炼来生成语义保持且有效的提示。在PolyBench和HumanEval-CPP基准测试中,HintPilot在保持程序正确性的前提下,相比-Ofast实现了高达6.88倍的几何平均速度提升。

英文摘要:

Code optimization remains a core objective in software development, yet modern compilers struggle to navigate the enormous optimization spaces. While recent research has looked into employing large language models (LLMs) to optimize source code directly, these techniques can introduce semantic errors and miss fine-grained compiler-level optimization opportunities. We present HintPilot, which bridges LLM-based reasoning with traditional compiler infrastructures via synthesizing compiler hints, annotations that steer compiler behavior. HintPilot employs retrieval-augmented synthesis over compiler documentation and applies profiling-guided iterative refinement to synthesize semantics-preserving and effective hints. Upon PolyBench and HumanEval-CPP benchmarks, HintPilot achieves up to 6.88x geometric mean speedup over -Ofast while preserving program correctness.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑