arXiv:2602.18511cs.PLcs.AI2026-02被引 3

用大模型显式规划优化意图,让编译器全局协同提速。

Beyond Pass-by-Pass Optimization: Intent-Driven IR Optimization with Large Language Models

  • 分三阶段:先定优化目标,再细化策略,最后生成代码
  • 正确率达90.5%,平均提速2.66倍,最高达272.6倍
  • 适合研究编译优化或想提升程序性能的开发者

现代编译器通过在中间表示(IR)上依次执行多个独立优化模块来改进程序。这种逐阶段优化虽便于工程实现,却存在模块间协调难题:局部有益的变换可能阻塞后续更优的优化。根源在于缺乏对优化意图的明确表达——即为达成全局性能目标而协调多步变换的完整策略。近期基于大模型的方法将优化视为端到端生成任务,绕过传统流程,但优化意图仍隐含于模型内部,迫使模型同时推断策略与生成低级变换,导致正确性与性能受限。我们提出IntOpt,首个显式分离高层优化意图与低层分析变换的编译优化框架。IntOpt将优化过程分为三个阶段:意图形成、意图精炼与意图实现,支持全局协同的变换。实验表明,IntOpt在200个程序测试集上达到90.5%的验证正确率,平均加速2.660倍,优于当前最先进的基于大模型的优化器,在37个基准上超越启用-O3选项的现代编译器,最高速度提升达272.60倍。

原文摘要 · Abstract (English)

Modern compilers optimize programs through a sequence of modular passes over intermediate representations (IR). While this pass-by-pass paradigm offers engineering benefits, it suffers from a pass coordination problem: locally beneficial transformations may block more profitable optimizations in later stages. This limitation stems from the lack of an explicit notion of optimization intent, defined as a holistic strategy for coordinating multiple transformations toward a global performance objective. Recent LLM-based approaches formulate IR optimization as an end-to-end generation task, thereby avoiding the traditional pass-by-pass structure. However, optimization intent remains implicit in these methods, forcing models to jointly infer optimization strategy and generate low-level transformations, which limits both correctness and performance. We propose IntOpt, the first intent-driven IR optimizer that explicitly separates high-level optimization intent from low-level analysis and transformation. IntOpt organizes IR optimization into three stages: intent formulation, intent refinement, and intent realization, enabling globally coordinated transformations. Experiments show that IntOpt achieves 90.5% verified correctness and 2.660x average speedup on 200-program test set, outperforming state-of-the-art LLM-based optimizers in both correctness and performance, and surpassing modern compiler with the -O3 option on 37 benchmarks with speedups of up to 272.60x.

编译优化大模型LLM性能提升

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