paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Optimization-Aware Compiler-Level Event Profiling

优化感知的编译器级事件剖析
TOPLAS 45(2)2023匹配度 2/10 · 该论文研究编译器内部的事件剖析与优化扰动,属于PL/编译工程方向,但与用户核心关注的静态分析、LLM/Agent与静态分析交叉、浮点程序分析或贝叶斯程序分析均无直接关系;仅在“编译器/程序分析”大方向上有轻微关联。引用 9 inbox
Matteo Basso, Aleksandar Prokopec, Andrea Rosà, Walter Binder
crossref: 2026-09-10

AI 速览

一句话:提出在编译器内部、推迟至优化之后插桩的事件剖析技术,降低剖析对编译优化的扰动,并在 Graal 上验证。

动态分析常需统计程序执行中的特定事件(如对象分配、锁获取),但编译器优化会使这类事件的量化变得困难:插桩会扰动编译器原本的优化决策,导致被剖析程序的行为与原始程序不一致。本文提出一种量化优化后代码中编译器内部事件的新技术,通过在编译器内部插桩,并把插桩推迟到编译流水线中此后不再有优化能删除该事件的位置,从而减少剖析对优化的扰动。作者基于路径剖析(path profiling)给出两种实现策略,并修改标准路径剖析算法以适配现代 JIT 编译器。作者用该技术分析 JVM 上先进编译器 Graal 中各优化的行为,解释了某一优化性能提升的原因以及另一优化出现意外变慢的原因。评估结果表明,两种实现相比朴素实现显著降低了执行时间开销。

问题
在存在编译器优化时,插桩式剖析会扰动优化决策,使被剖析程序行为偏离原始程序,导致事件计数不准确。
方法
在编译器内部插桩,并将插桩推迟到编译流水线中后续优化无法再删除该事件之后的位置;基于路径剖析提出两种实现策略,并改造标准路径剖析算法以适用于现代 JIT 编译器。
评估
在 Graal(JVM 的先进编译器)上分析优化行为,解释了某优化的性能提升与另一优化的意外变慢;实验表明两种实现相比朴素实现的执行时间开销显著更低。
原文摘要(Abstract)

Tracking specific events in a program’s execution, such as object allocation or lock acquisition, is at the heart of dynamic analysis. Despite the apparent simplicity of this task, quantifying these events is challenging due to the presence of compiler optimizations. Profiling perturbs the optimizations that the compiler would normally do—a profiled program usually behaves differently than the original one.In this article, we propose a novel technique for quantifying compiler-internal events in the optimized code, reducing the profiling perturbation on compiler optimizations. Our technique achieves this by instrumenting the program from within the compiler, and by delaying the instrumentation until the point in the compilation pipeline after which no subsequent optimizations can remove the events. We propose two different implementation strategies of our technique based on path-profiling, and a modification to the standard path-profiling algorithm that facilitates the use of the proposed strategies in a modernjust-in-time (JIT)compiler. We use our technique to analyze the behaviour of the optimizations in Graal, a state-of-the-art compiler for the Java Virtual Machine, identifying the reasons behind a performance improvement of a specific optimization, and the causes behind an unexpected slowdown of another. Finally, our evaluation results show that the two proposed implementations result in a significantly lower execution-time overhead w.r.t. a naive implementation.

链接与引用

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

BibTeX
@article{paperbot2130,
  title = {Optimization-Aware Compiler-Level Event Profiling},
  author = {Matteo Basso and Aleksandar Prokopec and Andrea Rosà and Walter Binder},
  journal = {ACM Transactions on Programming Languages and Systems},
  volume = {45},
  number = {2},
  year = {2023},
  doi = {10.1145/3591473}
}