paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Graph IRs for Impure Higher-Order Languages: Making Aggressive Optimizations Affordable with Precise Effect Dependencies

面向非纯高阶语言的图中间表示:以精确效应依赖实现可负担的激进优化
OOPSLA 7(OOPSLA2)2023匹配度 3/10 · 论文属于编程语言与编译器方向,提出结合可达性类型与效应系统的图IR以优化非纯高阶语言,涉及类型系统和编译优化,但未涉及LLM/Agent、ML系统中的静态分析、浮点程序分析或贝叶斯程序分析等画像核心问题。引用 13 inbox
Oliver Bračevac, Guannan Wei, Songlin Jia, Supun Abeysinghe, Yuxuan Jiang, Yuyan Bao, Tiark Rompf
crossref: 2026-09-10

AI 速览

一句话:提出结合可达性类型与效应系统的类型化图IR,为含副作用与高阶函数的语言提供精确依赖与廉价激进优化。

图中间表示广泛用于编译器优化,但此前只在纯函数语言中支持过程间优化,或在命令式语言中支持过程内优化。对于同时具有副作用与高阶函数的语言,别名与间接控制转移使依赖信息难以保持足够精细,从而阻碍激进的全局优化。本文提出一种新型类型化图IR,将可达性类型与表达力强的效应系统结合,以可负担的代价计算精确且细粒度的效应依赖,同时支持局部推理与分离编译。该图IR通过词法结构表示结构化控制流与嵌套,使针对非纯高阶程序的代码移动等优化既激进又廉价。作者基于带可达性类型-效应系统的λ演算形式化了该图IR,并给出多种优化的规约。在Scala LMS编译框架中,通过张量循环融合、CUDA核融合、LLVM IR符号执行与SQL查询编译等案例评估,最高获得21倍加速。

问题
现有图IR难以同时支持含副作用与高阶函数语言的激进全局优化,因为别名和间接控制转移导致依赖信息粒度不足。
方法
提出一种类型化图IR,结合可达性类型与效应系统来精确计算细粒度效应依赖,并用词法结构表示结构化控制流,基于λ演算形式化并规约多种优化。
评估
在Scala LMS编译框架中开展张量循环融合、CUDA核融合、LLVM IR符号执行与SQL查询编译等性能案例研究,观察到最高21倍加速。
原文摘要(Abstract)

Graph-based intermediate representations (IRs) are widely used for powerful compiler optimizations, either interprocedurally in pure functional languages, or intraprocedurally in imperative languages. Yet so far, no suitable graph IR exists for aggressive global optimizations in languages with both effects and higher-order functions: aliasing and indirect control transfers make it difficult to maintain sufficiently granular dependency information for optimizations to be effective. To close this long-standing gap, we propose a novel typed graph IR combining a notion of reachability types with an expressive effect system to compute precise and granular effect dependencies at an affordable cost while supporting local reasoning and separate compilation. Our high-level graph IR imposes lexical structure to represent structured control flow and nesting, enabling aggressive and yet inexpensive code motion and other optimizations for impure higher-order programs. We formalize the new graph IR based on a λ-calculus with a reachability type-and-effect system along with a specification of various optimizations. We present performance case studies for tensor loop fusion, CUDA kernel fusion, symbolic execution of LLVM IR, and SQL query compilation in the Scala LMS compiler framework using the new graph IR. We observe significant speedups of up to 21 x .

链接与引用

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

BibTeX
@article{paperbot1870,
  title = {Graph IRs for Impure Higher-Order Languages: Making Aggressive Optimizations Affordable with Precise Effect Dependencies},
  author = {Oliver Bračevac and Guannan Wei and Songlin Jia and Supun Abeysinghe and Yuxuan Jiang and Yuyan Bao and Tiark Rompf},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {7},
  number = {OOPSLA2},
  year = {2023},
  doi = {10.1145/3622813}
}