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.
CCS Concepts: • Software and its engineering → Compilers.
问问这篇 Paper
智能体会读完全文。
Lune 把这篇 Paper 索引到了每一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。
引用它的顶会 Paper2
- Towards Designing Future-Proof Data Processing SystemsMichael Jungmair, Jana GicevaVLDB 2025 · 被引用 1 次
- Nice to Meet You: Synthesizing Practical MLIR Abstract TransformersXuanyu Peng, Dominic Kennedy, Yuyou Fan, Ben Greenman 等POPL 2026
它引用的顶会 Paper7
- Alive2: bounded translation validation for LLVMNuno P. Lopes, Juneyoung Lee, Chung-Kil Hur, Zhengyang Liu 等PLDI 2021 · 被引用 109 次
- Towards a verified range analysis for JavaScript JITsFraser Brown, John Renner, Andres Nötzli, Sorin Lerner 等PLDI 2020 · 被引用 28 次
- SMT-Based Translation Validation for Machine Learning CompilerSeongwon Bang, Seunghyeon Nam, Inwhan Chun, Ho Young Jhoo 等CAV 2022 · 被引用 12 次
- Hydra: Generalizing Peephole Optimizations with Program SynthesisManasij Mukherjee, John RegehrOOPSLA 2024 · 被引用 11 次
- Speeding up SMT Solving via Compiler OptimizationBenjamin Mikek, Qirun ZhangFSE 2023 · 被引用 11 次
相关 Paper
- Ratte: Fuzzing for Miscompilations in Multi-Level Compilers Using Composable SemanticsPingshi Yu, Nicolas Wu, Alastair F. DonaldsonASPLOS 2025 · 被引用 3 次
- IRDL: an IR definition language for SSA compilersMathieu Fehr, Jeff Niu, River Riddle, Mehdi Amini 等PLDI 2022 · 被引用 13 次
- MLIRSmith: Random Program Generation for Fuzzing MLIR Compiler InfrastructureHaoyu Wang, Junjie Chen, Chuyue Xie, Shuang Liu 等ASE 2023 · 被引用 16 次
- DESIL: Detecting Silent Bugs in MLIR Compiler InfrastructureChenyao Suo, Jianrong Wang, Yongjia Wang, Jiajun Jiang 等OOPSLA 2025 · 被引用 2 次
- Finding Bugs in MLIR Compiler Infrastructure via Lowering Space ExplorationJingjing Liang, Shan Huang, Ting SuASE 2025
