Lune

OOPSLA2024顶会

Hydra: Generalizing Peephole Optimizations with Program Synthesis

Manasij Mukherjee, John Regehr

摘要

Optimizing compilers rely on peephole optimizations to simplify combinations of instructions and remove redundant instructions. Typically, a new peephole optimization is added when a compiler developer notices an optimization opportunity---a collection of dependent instructions that can be improved---and manually derives a more general rewrite rule that optimizes not only the original code, but also other, similar collections of instructions. In this paper, we present Hydra, a tool that automates the process of generalizing peephole optimizations using a collection of techniques centered on program synthesis. One of the most important problems we have solved is finding a version of each optimization that is independent of the bitwidths of the optimization's inputs (when this version exists). We show that Hydra can generalize 75% of the ungeneralized missed peephole optimizations that LLVM developers have posted to the LLVM project's issue tracker. All of Hydra's generalized peephole optimizations have been formally verified, and furthermore we can automatically turn them into C++ code that is suitable for inclusion in an LLVM pass.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 5 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • First-Class Verification Dialects for MLIR 引用了 Alive2: bounded translation validation for LLVM
  • LPO: Discovering Missed Peephole Optimizations with Large Language Models 引用了 Alive2: bounded translation validation for LLVM
  • FlashFill++: Scaling Programming by Example by Cutting to the Chase 引用了 Program synthesis by type-guided abstraction refinement
  • Dataflow-based pruning for speeding up superoptimization 引用了 Program synthesis by type-guided abstraction refinement
  • Scaling Instruction-Selection Verification against Authoritative ISA Semantics 引用了 Alive2: bounded translation validation for LLVM
  • Exploiting Undefined Behavior in C/C++ Programs for Optimization: A Study on the Performance Impact 引用了 Alive2: bounded translation validation for LLVM
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper5

  1. First-Class Verification Dialects for MLIRMathieu Fehr, Yuyou Fan, Hugo Pompougnac, John Regehr 等PLDI 2025 · 5 次引用
  2. Exploiting Undefined Behavior in C/C++ Programs for Optimization: A Study on the Performance ImpactLucian Popescu, Nuno P. LopesPLDI 2025 · 2 次引用
  3. LPO: Discovering Missed Peephole Optimizations with Large Language ModelsZhenyang Xu, Hongxu Xu, Yongqiang Tian, Xintong Zhou 等ASPLOS 2026 · 1 次引用
  4. Optimism in Equality SaturationRussel Arbore, Alvin Cheung, Max WillseyPLDI 2026
  5. Scaling Instruction-Selection Verification against Authoritative ISA SemanticsMichael McLoughlin, Ashley Sheng, Chris Fallin, Bryan Parno 等OOPSLA 2025

它引用的 Paper5

  1. Alive2: bounded translation validation for LLVMNuno P. Lopes, Juneyoung Lee, Chung-Kil Hur, Zhengyang Liu 等PLDI 2021 · 109 次引用
  2. Program synthesis by type-guided abstraction refinementZheng Guo, Michael James, David Justo, Jiaxiao Zhou 等POPL 2020 · 45 次引用
  3. FlashFill++: Scaling Programming by Example by Cutting to the ChaseJosé Cambronero, Sumit Gulwani, Vu Le, Daniel Perelman 等POPL 2023 · 27 次引用
  4. Synthesizing abstract transformersPankaj Kumar Kalita, Sujit Kumar Muduli, Loris D'Antoni, Thomas W. Reps 等OOPSLA 2022 · 21 次引用
  5. Dataflow-based pruning for speeding up superoptimizationManasij Mukherjee, Pranav Kant, Zhengyang Liu, John RegehrOOPSLA 2020 · 21 次引用

相关 Paper

  1. Seeking Evidence of Further Optimization: Detecting Missed Optimizations through Compiler’s Native AnalysesYi Zhang, Yu Wang, Ke Wang, Linzhang WangOOPSLA 2026
  2. Finding missed optimizations through the lens of dead code eliminationTheodoros Theodoridis, Manuel Rigger, Zhendong SuASPLOS 2022 · 48 次引用
  3. Pattern-Based Peephole Optimizations with Java JIT TestsZhiqiang Zang, Aditya Thimmaiah, Milos GligoricISSTA 2023 · 2 次引用
  4. Certified Decision Procedures for Width-Independent Bitvector PredicatesSiddharth Bhat, Léo Stefanesco, Chris Hughes, Tobias GrosserOOPSLA 2025 · 2 次引用
  5. FLUX: Finding Bugs with LLVM IR Based Unit Test CrossoversEric Liu, Shengjie Xu, David LieASE 2023 · 8 次引用
黄昏的海面,两侧是细线勾勒的悬崖