MLIR Reference Manual
A Beginner’s Guide
1 About
GitHub: PlatinumCD/mlir-reference-manual
This manual is a beginner-focused guide to MLIR dialects, operations, transformations, conversions, and their roles in compiler pipelines. It is written for readers who want a practical map of MLIR: what each dialect means, when it matters, what operations it provides, what transformations and conversions are associated with it, and how it fits into a larger compiler flow.
The manual covers upstream MLIR dialects first, then expands into third-party MLIR ecosystems such as ONNX-MLIR, torch-mlir, StableHLO, IREE, CIRCT, IMEX, and DaCe. The goal is not only to list operations, but to explain why each dialect exists and how it participates in real compiler pipelines.
1.3 Reading Path
- Start with Introduction and What Is MLIR?.
- Learn core IR structure:
builtin,func,cf,scf, andindex. - Read basic computation:
arith,math,complex, andub. - Move into tensor, shape, and memory modeling:
tensor,memref,bufferization,shape,sparse_tensor,quant,ptr, anddlti. - Study structured computation and optimization:
affine,linalg, andvector. - Read ML and model-level IR:
tosaandml_program. - Explore parallelism, accelerators, and distributed compute:
async,gpu,acc,omp,mpi, andshard. - Learn rewrite, transform, and metaprogramming dialects:
transform,pdl,pdl_interp,irdl, andsmt. - Follow target and architecture-specific lowering:
llvm,spirv,emitc,wasmssa, GPU vendor dialects, and CPU architecture dialects. - Read The External MLIR Ecosystem before entering third-party dialects.
- Choose an ecosystem path: frontend/model dialects, IREE runtime compiler dialects, CIRCT hardware dialects, or array and data-centric extensions.