Ensuring the correctness of compiler optimizations is critical, but existing fuzzers struggle to test optimizations effectively. First, most fuzzers use optimization pipelines (heuristics-based, fixed sequences of passes) as their harness. The phase-ordering problem can enable or preempt transformations, so pipelines inevitably miss optimization interactions; moreover, many optimizations are not scheduled, even at aggressive levels. Second, optimizations typically fire only when inputs satisfy specific structural relationships, which existing generators and mutations struggle to produce. We propose targeted fuzzing of individual optimizations to complement pipeline-based testing. Our key idea is to exploit composition styles - structural relations over program constructs (adjacency, nesting, repetition, ordering) - that optimizations look for. We build a general-purpose, grammar-based mutational fuzzer, TargetFuzz, that (i) mines composition styles from an optimization-relevant corpus, then (ii) rebuilds them inside different contexts offered by a larger, generic corpus via synthesized mutations to test variations of optimization logic. TargetFuzz is adaptable to a new programming language by lightweight, grammar-based, construct annotations - and it automatically synthesizes mutators and crossovers to rebuild composition styles. No need for hand-coded generators or language-specific mutators, which is particularly useful for modular frameworks such as MLIR, whose dialect-based, rapidly evolving ecosystem makes optimizations difficult to fuzz. Our evaluation on LLVM and MLIR shows that TargetFuzz improves coverage by 8% and 11% and triggers optimizations 2.8$\times$ and 2.6$\times$, compared to baseline fuzzers under the targeted fuzzing mode. We show that targeted fuzzing is complementary: it effectively tests all 37 sampled LLVM optimizations, while pipeline-fuzzing missed 12.


翻译:确保编译器优化的正确性至关重要,但现有模糊测试工具难以有效测试优化过程。首先,多数模糊测试工具采用优化流水线(基于启发式的固定传递序列)作为测试框架。阶段排序问题可能激活或阻止特定转换,导致流水线不可避免地遗漏优化间的交互作用;此外,即使采用激进优化级别,许多优化仍未被调度执行。其次,优化通常仅在输入满足特定结构关系时触发,而现有生成器和变异策略难以产生此类输入。我们提出针对单个优化的定向模糊测试方法,以补充基于流水线的测试。核心思想是利用优化所依赖的组合模式——即程序构造间的结构关系(相邻性、嵌套性、重复性、顺序性)。我们构建了通用的基于语法的变异模糊测试工具TargetFuzz,其能够(i)从优化相关语料库中挖掘组合模式,随后(ii)通过合成变异在更大规模通用语料库提供的不同上下文中重构这些模式,以测试优化逻辑的变体。TargetFuzz可通过轻量级、基于语法的构造注解适配新编程语言,并自动合成变异器和交叉算子以重建组合模式。该方法无需手动编写生成器或语言特定变异器,对于MLIR等模块化框架尤为实用——其基于方言的快速演进生态系统使得优化过程难以进行模糊测试。在LLVM和MLIR上的评估表明,与定向模糊测试模式下的基线工具相比,TargetFuzz分别提升覆盖率8%和11%,触发优化次数增加2.8倍和2.6倍。我们证明定向测试具有互补性:它能有效测试全部37个抽样LLVM优化,而流水线模糊测试遗漏了其中12个。

0
下载
关闭预览

相关内容

【NeurIPS2024】IPO: 面向视觉-语言模型的可解释提示优化
专知会员服务
22+阅读 · 2024年10月23日
【CVPR2024】VidLA: 大规模视频-语言对齐
专知会员服务
20+阅读 · 2024年3月31日
专知会员服务
25+阅读 · 2021年9月25日
专知会员服务
22+阅读 · 2021年4月15日
【AAAI2021】协同挖掘:用于稀疏注释目标检测的自监督学习
【ICML2020】持续终身学习的神经主题建模
专知会员服务
40+阅读 · 2020年6月22日
使用 Keras Tuner 调节超参数
TensorFlow
15+阅读 · 2020年2月6日
语义分割中的深度学习方法全解:从FCN、SegNet到DeepLab
炼数成金订阅号
26+阅读 · 2017年7月10日
MNIST入门:贝叶斯方法
Python程序员
23+阅读 · 2017年7月3日
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
43+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
12+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
11+阅读 · 2013年12月31日
Arxiv
18+阅读 · 2024年12月27日
Arxiv
175+阅读 · 2023年4月20日
A Survey of Large Language Models
Arxiv
499+阅读 · 2023年3月31日
Arxiv
27+阅读 · 2023年3月17日
VIP会员
相关基金
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
43+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
12+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
11+阅读 · 2013年12月31日
Top
微信扫码咨询专知VIP会员