DESIL: Detecting Silent Bugs in MLIR Compiler Infrastructure
Open Access
- 9 October 2025
- journal article
- Published by Association for Computing Machinery (ACM) in Proceedings of the ACM on Programming Languages
- Vol. 9 (OOPSLA2) , 3093-3119
Abstract
MLIR (Multi-Level Intermediate Representation) compiler infrastructure provides an efficient framework for introducing a new abstraction level for programming languages and domain-specific languages. It has attracted widespread attention in recent years and has been applied in various domains, such as deep learning compiler construction. Recently, several MLIR compiler fuzzing techniques, such as MLIRSmith and MLIRod, have been proposed. However, none of them can detect silent bugs, i.e., bugs that incorrectly optimize code silently. The difficulty in detecting silent bugs arises from two main aspects: (1) UB-Free Program Generation: Generates programs that are free from undefined behaviors to suit the non-UB assumptions required by compiler optimizations. (2) Lowering Support: Converts the given MLIR program into an executable form with a suitable lowering path that reduces redundant lowering passes and improves the efficiency of fuzzing. To address the above issues, we propose DESIL. DESIL enables silent bug detection by defining a set of UB-elimination rules based on the MLIR documentation and applying them to input programs. To convert dialects in the MLIR program into executable form, DESIL designs a lowering path optimization strategy to convert the dialects in the given MLIR program into executable form. Furthermore, DESIL incorporates the differential testing for silent bug detection. It introduces an operation-aware optimization recommendation strategy into the compilation process to generate diverse executable files. We applied DESIL to the latest revisions of the MLIR compiler infrastructure. It detected 23 silent bugs and 19 crash bugs, of which 17/16 have been confirmed or fixed.Keywords
All Related Versions
Funding Information
- the national key Research and Development Program of China (2024YFB4506300)
- National Natural Science Foundation of China (62322208, 12411530122, 62232001, 62202324)
This publication has 18 references indexed in Scilit:
- A Tale of Two DL Cities: When Library Tests Meet Compiler2025
- MLIRSmith: Random Program Generation for Fuzzing MLIR Compiler Infrastructure2023
- MLIR: Scaling Compiler Infrastructure for Domain Specific Computation2021
- Random testing for C and C++ compilers with YARPGenProceedings of the ACM on Programming Languages, 2020
- A Survey of Compiler TestingACM Computing Surveys, 2020
- An empirical comparison of compiler testing techniques2016
- Finding and understanding bugs in C compilers2011
- A practical guide for using statistical tests to assess randomized algorithms in software engineering2011
- Augmenting Automatically Generated Unit-Test Suites with Regression Oracle Checking2006
- Efficient computation of interprocedural definition-use chainsACM Transactions on Programming Languages and Systems, 1994