paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Fuzzing Loop Optimizations in Compilers for C++ and Data-Parallel Languages

面向 C++ 与数据并行语言编译器的循环优化模糊测试
PLDI 7(PLDI)2023匹配度 2/10 · 论文聚焦编译器循环优化的模糊测试(动态测试),核心是随机程序生成与UB避免,与用户关注的静态分析、LLM与程序分析交叉、浮点程序分析、贝叶斯程序分析等方向无直接关联。引用 39 inbox
Vsevolod Livinskii, Dmitry Babokin, John Regehr
crossref: 2026-09-10

AI 速览

一句话:重实现 YARPGen,以静态避免 UB 和提升循环多样性来模糊测试编译器循环优化,发现 122 个 bug。

编译器是软件系统的基础,必须尽可能正确,本文关注对循环优化器的压力测试。作者对开源生成式编译器模糊测试器 YARPGen 进行了重大重实现,并提出一种在生成循环时静态避免未定义行为的新方法,使生成程序符合相应语言标准,从而支持自动化测试;同时设计了一组提高生成循环代码多样性的机制。评估表明,这些机制能显著更频繁地触发循环优化,为发现优化器缺陷提供机会。该版本在面向数据并行语言的 Intel ISPC、Intel oneAPI DPC++ 编译器以及 GCC、Clang/LLVM 等 C++ 编译器中累计发现 122 个 bug。

问题
编译器正确性至关重要,而循环优化器复杂且易出错;如何自动生成合法且能有效触发循环优化的测试程序是本文研究问题。
方法
重实现生成式编译器模糊测试器 YARPGen,引入静态避免未定义行为的循环生成方法,并加入多种提升生成循环多样性的机制。
评估
在 Intel ISPC、oneAPI DPC++、GCC、Clang/LLVM 等编译器上测试,发现 122 个 bug,并展示生成机制更频繁触发循环优化。
原文摘要(Abstract)

Compilers are part of the foundation upon which software systems are built; they need to be as correct as possible. This paper is about stress-testing loop optimizers; it presents a major reimplementation of Yet Another Random Program Generator (YARPGen), an open-source generative compiler fuzzer. This new version has found 122 bugs, both in compilers for data-parallel languages, such as the Intel® Implicit SPMD Program Compiler and the Intel® oneAPI DPC++ compiler, and in C++ compilers such as GCC and Clang/LLVM. The first main contribution of our work is a novel method for statically avoiding undefined behavior when generating loops; the resulting programs conform to the relevant language standard, enabling automated testing. The second main contribution is a collection of mechanisms for increasing the diversity of generated loop code; in our evaluation, we demonstrate that these make it possible to trigger loop optimizations significantly more often, providing opportunities to discover bugs in the optimizers.

链接与引用

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

BibTeX
@article{paperbot1994,
  title = {Fuzzing Loop Optimizations in Compilers for C++ and Data-Parallel Languages},
  author = {Vsevolod Livinskii and Dmitry Babokin and John Regehr},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {7},
  number = {PLDI},
  year = {2023},
  doi = {10.1145/3591295}
}