Multi-Level IR Compiler Framework

Getting Started

Don’t miss the MLIR Tutorial! slides - recording - online step-by-step

Please refer to the LLVM Getting Started in general to build LLVM. Below are quick instructions to build MLIR with LLVM.

The following instructions for compiling and testing MLIR assume that you have git, ninja , and a working C++ toolchain (see LLVM requirements ).

git clone
mkdir llvm-project/build
cd llvm-project/build
cmake -G Ninja ../llvm \

cmake --build . --target check-mlir

It is recommended that you install clang and lld on your machine (sudo apt-get install clang lld on Ubuntu for example) and uncomment the last part of the cmake invocation above.

To compile and test on Windows using Visual Studio 2017:

REM In shell with Visual Studio environment set up, e.g., with command such as
REM   $visual-studio-install\Auxiliary\Build\vcvarsall.bat" x64
REM invoked.
git clone
mkdir llvm-project\build
cd llvm-project\build
cmake --build . --target check-mlir

As a starter, you may try the tutorial on building a compiler for a Toy language.

Getting Started Docs