MLIR News, 2nd edition (3/6/2020)

Welcome to the second issue of the MLIR (bi)Weekly, a newsletter (published on Friday) covering developments in MLIR, and related projects in the ecosystem. MLIR (bi)Weekly is brought to you by a collective effort of contributors, we welcome your contributions!

See the previous published edition.


  • The C4ML workshop took place last week: we announced public MLIR exactly one year ago at the same workshop! This year multiple talks are using MLIR (see detail below).
  • Tatiana and Chris delivered the keynote at the CGO conference (see below). Chris took this opportunity to present his thoughts on a possible path for using MLIR in Clang! See slides and discuss here
  • There is now a canonical publication for MLIR: A Compiler Infrastructure for the End of Moore’s Law


On Discourse


Table-driven Infrastructure

  • The requirements for builders using variadic operands gets simplified ads operand_segment_sizes is now automatically populated in the declarative assembly format, as well as the auto-generated builders.

Code Generation

  • Loops and Ifs can now return values.
  • Loops and parallel loops with reductions can now be lowered to CFG and further to LLVM.
  • A simple greedy parallel loop to GPU kernel mapper, using attributes, has been implemented.
  • Simple parallel-loop fusion and tiling have landed.
  • Introduced atomic read-modify-write operation to the standard dialect, with lowerings to LLVM.
  • Expose llvm.intr.matrix_multiply


  • The SPIR-V dialect now properly supports integer signedness.
  • The mlir-vulkan-runner now can output basic timing metrics for kernel launches.


Added support for OpenMP barrier and its translation. This is the first operation in the OpenMP Dialect!

In the Ecosystem


The Fortran IR (FIR) dialect is up for review in the master branch.


SPIR-V structured ops compilation pipeline

  • continues to support more ops and models: CLs pending to enable reduction, etc. and support mnist, unidirectional lstm, etc.
  • work in progress to threading target environment support across the whole stack.

(ModelBuilder) runs end-to-end on CPU: aiming for C++ programmable MLIR that is delightful to use and offers unsurprising perf behavior.


  • pmlc-vulkan-runner accepting GPU MLIR inputs is using the recently added upstream VulkanRuntime.

Recent Talks

The C4ML workshop took place last week, multiple talks were involving MLIR:

MLIR: Multi-Level Intermediate Representation Compiler Infrastructure

Chris Lattner, Tatiana Shpeisman
Keynote @ International Symposium on Code Generation and Optimization (CGO’20)

End-to-end Dynamic Shape Support in MLIR-HLO CodeGen

This talk from Alibaba PAI explores the challenge of optimizations and CodeGen in presence of dynamic shape, starting from an equivalent to HLO (the XLA IR).
Slides and recording are available
This triggered interesting discussions here and here about some aspects of fusion in the Linalg dialect.

Recent Publications

MLIR: A Compiler Infrastructure for the End of Moore’s Law

Chris Lattner, Mehdi Amini, Uday Bondhugula, Albert Cohen, Andy Davis, Jacques Pienaar, River Riddle, Tatiana Shpeisman, Nicolas Vasilache, Oleksandr Zinenko

High Performance Code Generation in MLIR: An Early Case Study with GEMM

Uday Bondhugula