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