EUVIMEDOpdag EUVIMED
Crossref

First-Class Verification Dialects for MLIR

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

Proceedings of the ACM on Programming Languages · 2025-06-10 · 9 (PLDI) · 1466-1490

DOI: 10.1145/3729309 ↗

At a glance

Journal article in Proceedings of the ACM on Programming Languages, published online on 2025-06-13. Written by Mathieu Fehr and 4 co-authors. Cited 6 times so far (Crossref); 41 references. Funded by: Engineering and Physical Sciences Research Council, HORIZON EUROPE Reforming and enhancing the European Research and Innovation system, National Science Foundation.

AbstractBibliografiske oplysningerCiteRelated studies

Abstract (original language)

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.

Funding

  • Engineering and Physical Sciences Research Council
  • HORIZON EUROPE Reforming and enhancing the European Research and Innovation system
  • National Science Foundation

Cite

APA

Fehr, M., Fan, Y., Pompougnac, H., Regehr, J., & Grosser, T. (2025). First-Class Verification Dialects for MLIR. Proceedings of the ACM on Programming Languages, 9(PLDI), 1466-1490. https://doi.org/10.1145/3729309

Vancouver

Fehr M, Fan Y, Pompougnac H, Regehr J, Grosser T. First-Class Verification Dialects for MLIR. Proceedings of the ACM on Programming Languages. 2025;9(PLDI):1466-1490. doi:10.1145/3729309

BibTeX
@article{Fehr2025,
  author = {Fehr, Mathieu and Fan, Yuyou and Pompougnac, Hugo and Regehr, John and Grosser, Tobias},
  title = {First-Class Verification Dialects for MLIR},
  journal = {Proceedings of the ACM on Programming Languages},
  year = {2025},
  volume = {9},
  number = {PLDI},
  pages = {1466--1490},
  doi = {10.1145/3729309}
}
Start for free →