MLIRSmith: Random Program Generation for Fuzzing MLIR Compiler Infrastructure
Haoyu Wang, Junjie Chen, Chuyue Xie, Shuang Liu, Zan Wang, Qingchao Shen, Yingquan Zhao
Abstract
MLIR (Multi-Level Intermediate Representation) compiler infrastructure has gained popularity in recent years to support the construction of many compilers. Instead of designing a new IR with a single abstraction for each domain, MLIR compiler infrastructure provides systematic passes to support a wide range of functionalities for benefiting multiple domains together and introduces dialects to support different levels of abstraction in MLIR. Due to its fundamental role in compiler community, ensuring its quality is very critical. In this work, we propose MLIRSmith, the first fuzzing technique for MLIR compiler infrastructure. MLIRSmith employs a two-phase strategy to generate valid and diverse MLIR programs, which first constructs diverse program templates guided by extended MLIR syntax rules and then generates valid MLIR programs through template instantiation guided by our designed context-sensitive grammar. After applying MLIRSmith to the latest revision of MLIR compiler infrastructure, we detected 53 previously unknown bugs, among which 49/38 have been confirmed/fixed by developers. We also transform the high-level programs generated by NNSmith (a high-level program generator for deep learning compilers) to MLIR programs for indirectly fuzzing MLIR compiler infrastructure. During the same testing time, MLIRSmith largely outperforms such an indirect technique by detecting 328.57% more bugs and covering 194.67%/225.87% more lines/branches in MLIR compiler infrastructure.
Ask about this paper
Ask your agent about it.
Lune has read the top-tier papers around this one, so every answer names the papers it rests on.
Your agent calls
Lunesearch_papers
Free to start. No credit card required.
Terminal
Install the CLIlune papers get 6450db94-68d1-45e8-b5cb-316afd5efa29Cited by top-tier papers16
- SoK: Prudent Evaluation Practices for FuzzingMoritz Schloegel, Nils Bars, Nico Schiller, Lukas Bernhard et al.S&P 2024 · 69 citations
- Fuzzing MLIR Compiler Infrastructure via Operation Dependency AnalysisChenyao Suo, Junjie Chen, Shuang Liu, Jiajun Jiang et al.ISSTA 2024 · 12 citations
- Your Compiler is Backdooring Your Model: Understanding and Exploiting Compilation Inconsistency Vulnerabilities in Deep Learning CompilersSimin Chen, Jinjun Peng, Yixin He, Junfeng Yang et al.S&P 2026 · 11 citations
- Fuzzing MLIR Compilers with Custom Mutation SynthesisBen Limpanukorn, Jiyuan Wang, Hong Jin Kang, Eric Zitong Zhou et al.ICSE 2025 · 3 citations
- DESIL: Detecting Silent Bugs in MLIR Compiler InfrastructureChenyao Suo, Jianrong Wang, Yongjia Wang, Jiajun Jiang et al.OOPSLA 2025 · 2 citations
Related papers
- Directed Testing in MLIR: Unleashing Its Potential by Overcoming the Limitations of Random FuzzingWeiyuan Tong, Zixu Wang, Zhanyong Tang, Jianbin Fang et al.FSE 2025 · 1 citation
- Interleaved Learning and Exploration: A Self-Adaptive Fuzz Testing Framework for MLIRZeyu Sun, Jingjing Liang, Weiyi Wang, Chenyao Suo et al.ASE 2025 · 1 citation
- NNSmith: Generating Diverse and Valid Test Cases for Deep Learning CompilersJiawei Liu, Jinkun Lin, Fabian Ruffy, Cheng Tan et al.ASPLOS 2023 · 90 citations
- Ratte: Fuzzing for Miscompilations in Multi-Level Compilers Using Composable SemanticsPingshi Yu, Nicolas Wu, Alastair F. DonaldsonASPLOS 2025 · 3 citations
- Finding Bugs in MLIR Compiler Infrastructure via Lowering Space ExplorationJingjing Liang, Shan Huang, Ting SuASE 2025
