Skip to main content
QUICK REVIEW

[Paper Review] MLIR: A Compiler Infrastructure for the End of Moore's Law

Chris Lattner, Mehdi Amini|arXiv (Cornell University)|Feb 25, 2020
Parallel Computing and Optimization TechniquesComputer Science47 references120 citations
TL;DR

MLIR presents a reusable, extensible compiler infrastructure with a modular, SSA-based IR and dialects to support heterogeneous hardware and domain-specific compilers, aiming to reduce fragmentation and accelerate compiler development.

ABSTRACT

This work presents MLIR, a novel approach to building reusable and extensible compiler infrastructure. MLIR aims to address software fragmentation, improve compilation for heterogeneous hardware, significantly reduce the cost of building domain specific compilers, and aid in connecting existing compilers together. MLIR facilitates the design and implementation of code generators, translators and optimizers at different levels of abstraction and also across application domains, hardware targets and execution environments. The contribution of this work includes (1) discussion of MLIR as a research artifact, built for extension and evolution, and identifying the challenges and opportunities posed by this novel design point in design, semantics, optimization specification, system, and engineering. (2) evaluation of MLIR as a generalized infrastructure that reduces the cost of building compilers-describing diverse use-cases to show research and educational opportunities for future programming languages, compilers, execution environments, and computer architecture. The paper also presents the rationale for MLIR, its original design principles, structures and semantics.

Motivation & Objective

  • Propose a general, extensible compiler infrastructure to reduce fragmentation across domains and hardware targets.
  • Provide a standard SSA-based IR with customizable dialects to support multiple abstraction levels.
  • Offer infrastructure for parsing, verification, transformation, and debugging to ease compiler development.
  • Demonstrate how MLIR can unify diverse compilation stacks and facilitate research, education, and tooling.

Proposed method

  • Introduce MLIR’s core abstractions: SSA-based IR, regions, operations (Ops), and dialects.
  • Describe the design principles: minimal built-in concepts, progressive lowering, and preserving high-level semantics.
  • Present declarative IR definitions via Operation Descriptions (ODS) and Declarative Rewrite Rules (DRR).
  • Explain the MLIR infrastructure for dialects, passes, verification, and multi-level IR management.
  • Show support for multi-threaded, round-trippable textual IR forms and rich location/tracing data.

Experimental results

Research questions

  • RQ1How can a single IR framework support multiple high-level abstractions (e.g., ML graphs, ASTs, polyhedral forms) without hard-coding concepts?
  • RQ2Can progressive lowering and dialect composition enable efficient, heterogeneous compilation across diverse hardware targets?
  • RQ3How does MLIR enable modular, reusable compiler passes and reliable verification in an extensible ecosystem?
  • RQ4What are the benefits of declarative rewrite patterns and TableGen-based Op descriptions for extensibility and tooling?

Key findings

  • MLIR provides a generalized infrastructure that reduces the cost of building compilers by enabling modular dialects and reusable passes.
  • The design supports progressive lowering from high-level abstractions to hardware targets while preserving necessary semantics.
  • Dialect mixing and region-based IR enable reuse across domains and facilitate heterogeneous compilation.
  • Declarative rewrite patterns and DRR/ODS enable easier, verifiable transformations and extensible optimizations.
  • The infrastructure includes verification, documentation generation, and round-trippable textual IR to aid debugging and education.

Better researchstarts right now

From reading papers to final review, dramatically reduce your research time.

No credit card · Free plan available

This review was created by AI and reviewed by human editors.