Lune

PLDI2025顶会

First-Class Verification Dialects for MLIR

Mathieu Fehr, Yuyou Fan, Hugo Pompougnac, John Regehr, Tobias Grosser

摘要

MLIR is a toolkit supporting the development of extensible and composable intermediate representations (IRs) called dialects; it was created in response to rapid changes in hardware platforms, programming languages, and application domains such as machine learning. MLIR supports development teams creating compilers and compiler-adjacent tools by factoring out common infrastructure such as parsers and printers. A major limitation of MLIR is that it is syntax-focused: it has no support for directly encoding the semantics of operations in its dialects. Thus, at present, the parts of MLIR tools that depend on semantics-optimizers, analyzers, verifiers, transformers-must all be engineered by hand.

Our work makes formal semantics a first-class citizen in the MLIR ecosystem. We designed and implemented a collection of semantics-supporting MLIR dialects for encoding the semantics of compiler IRs. These dialects support a separation of concerns between three domains of expertise when building formal-methods-based tooling for compilers. First, compiler developers define their dialect's semantics as a lowering (compilation transformation) from their dialect to one or more of ours. Second, SMT solver experts provide tools to optimize domain-specific high-level semantics and lower them to SMT queries. Third, tool builders create dialect-independent verification tools.

We validate our work by defining semantics for five key MLIR dialects, defining a state-of-the-art SMT encoding for memory-based semantics, and building three dialect-agnostic tools, which we used to find five miscompilation bugs in upstream MLIR, verify a canonicalization pass, and also formally verify transfer functions for two dataflow analyses: "known bits" (that finds individual bits that are always zero or one in all executions) and "demanded bits" (that finds don't-care bits). The transfer functions that we verify are improved versions of those in upstream MLIR; they detect on average 36.6% more known bits in real-world MLIR programs compared to the upstream implementation.

问 Lune

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

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

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

可以从这些问题问起

Lune 可以查阅

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

获取答案

免费开始,无需绑卡

脉络

  • Hydra: Generalizing Peephole Optimizations with Program Synthesis 引用了 Alive2: bounded translation validation for LLVM
  • Speeding up SMT Solving via Compiler Optimization 引用了 Alive2: bounded translation validation for LLVM
  • Speeding up SMT Solving via Compiler Optimization 引用了 Towards a verified range analysis for JavaScript JITs
  • Towards Designing Future-Proof Data Processing Systems 引用了 SMT-Based Translation Validation for Machine Learning Compiler
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper2

  1. Towards Designing Future-Proof Data Processing SystemsMichael Jungmair, Jana GicevaVLDB 2025 · 1 次引用
  2. Nice to Meet You: Synthesizing Practical MLIR Abstract TransformersXuanyu Peng, Dominic Kennedy, Yuyou Fan, Ben Greenman 等POPL 2026

它引用的 Paper7

  1. Alive2: bounded translation validation for LLVMNuno P. Lopes, Juneyoung Lee, Chung-Kil Hur, Zhengyang Liu 等PLDI 2021 · 109 次引用
  2. Towards a verified range analysis for JavaScript JITsFraser Brown, John Renner, Andres Nötzli, Sorin Lerner 等PLDI 2020 · 28 次引用
  3. SMT-Based Translation Validation for Machine Learning CompilerSeongwon Bang, Seunghyeon Nam, Inwhan Chun, Ho Young Jhoo 等CAV 2022 · 12 次引用
  4. Hydra: Generalizing Peephole Optimizations with Program SynthesisManasij Mukherjee, John RegehrOOPSLA 2024 · 11 次引用
  5. Speeding up SMT Solving via Compiler OptimizationBenjamin Mikek, Qirun ZhangFSE 2023 · 11 次引用

相关 Paper

  1. Ratte: Fuzzing for Miscompilations in Multi-Level Compilers Using Composable SemanticsPingshi Yu, Nicolas Wu, Alastair F. DonaldsonASPLOS 2025 · 3 次引用
  2. IRDL: an IR definition language for SSA compilersMathieu Fehr, Jeff Niu, River Riddle, Mehdi Amini 等PLDI 2022 · 13 次引用
  3. MLIRSmith: Random Program Generation for Fuzzing MLIR Compiler InfrastructureHaoyu Wang, Junjie Chen, Chuyue Xie, Shuang Liu 等ASE 2023 · 16 次引用
  4. Finding Bugs in MLIR Compiler Infrastructure via Lowering Space ExplorationJingjing Liang, Shan Huang, Ting SuASE 2025
  5. DESIL: Detecting Silent Bugs in MLIR Compiler InfrastructureChenyao Suo, Jianrong Wang, Yongjia Wang, Jiajun Jiang 等OOPSLA 2025 · 2 次引用
黄昏的海面,两侧是细线勾勒的悬崖