# Composable and Modular Code Generation in MLIR: A Structured and Retargetable Approach to Tensor Compiler Construction

arXiv: https://arxiv.org/abs/2202.03293 · HTML: https://mlsanity.com/paper/2202.03293/

## Key facts

- Cited by 8 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 7 Feb 2022.

## Built on by (most cited first, 8 of 8)

- [SparseTIR: Composable Abstractions for Sparse Compilation in Deep Learning](https://mlsanity.com/paper/2207.04606/) (2022)
- [Allo: A Programming Model for Composable Accelerator Design](https://mlsanity.com/paper/2404.04815/) (2024)
- [Adaptive Self-improvement LLM Agentic System for ML Library Development](https://mlsanity.com/paper/2502.02534/) (2025)
- [oneDNN Graph Compiler: A Hybrid Approach for High-Performance Deep Learning Compilation](https://mlsanity.com/paper/2301.01333/) (2023)
- [TPU-MLIR: A Compiler For TPU Using MLIR](https://mlsanity.com/paper/2210.15016/) (2022)
- [Advancing Direct Convolution using Convolution Slicing Optimization and ISA Extensions](https://mlsanity.com/paper/2303.04739/) (2023)
- [Nova: An End-to-End MLIR Compiler for Deep Learning](https://mlsanity.com/paper/2608.00029/) (2026)
- [RISC-V and machine learning: a survey](https://mlsanity.com/paper/2609.20677/) (2026)

## Abstract (arXiv)

Despite significant investment in software infrastructure, machine learning systems, runtimes and compilers do not compose properly. We propose a new design aiming at providing unprecedented degrees of modularity, composability and genericity. This paper discusses a structured approach to the construction of domain-specific code generators for tensor compilers, with the stated goal of improving the productivity of both compiler engineers and end-users. The approach leverages the natural structure of tensor algebra. It has been the main driver for the design of progressive lowering paths in MLIR. The proposed abstractions and transformations span data structures and control flow with both functional (SSA form) and imperative (side-effecting) semantics. We discuss the implications of this infrastructure on compiler construction and present preliminary experimental results.
