2020 LLVM Developers’ Meeting: M. Amini & R. Riddle “MLIR Tutorial”
LLVM LLVM
14.1K subscribers
26,521 views
0

 Published On Nov 9, 2020

https://llvm.org/devmtg/2020-09/

MLIR Tutorial - Mehdi Amini, River Riddle

Slides: https://llvm.org/devmtg/2020-09/slide...

MLIR is a flexible infrastructure for defining custom compiler abstractions and transformations, recently introduced to LLVM. It aims at generalizing the success of LLVM’s intermediate representation to new domains, ranging from device instruction sets, to loop abstractions, to graphs of operators used in machine learning, to HW design. More LLVM sub-projects are using MLIR: flang has already been merged and is using MLIR for FIR, its own high-level IR.

Two new projects are proposed for incubation in LLVM mlir-npcomp, a numpy compiler ; and CIRCT, which is applying MLIR to the domain of hardware design tools.

 
In this tutorial, we will explain how the few core concepts present in MLIR can be combined to represent and transform various IRs, including LLVM IR itself, by demonstrating the development of an optimizing compiler for a custom DSL step by step. The tutorial should be sufficient for the developers of compilers, IRs and similar tools to start using MLIR to implement custom operations with parsing and printing, define custom type systems and implement generic passes over the combination of those. We will provide an overview of MLIR ecosystem and related efforts, building the analogy with existing LLVM subsystems and frequently discussed LLVM extension proposals, e.g. loop optimizations or GPU-specific abstractions.

show more

Share/Embed