Toy Tutorial - MLIR (original) (raw)

Toy Tutorial

This tutorial runs through the implementation of a basic toy language on top of MLIR. The goal of this tutorial is to introduce the concepts of MLIR; in particular, howdialects can help easily support language specific constructs and transformations while still offering an easy path to lower to LLVM or other codegen infrastructure. This tutorial is based on the model of theLLVM Kaleidoscope Tutorial.

Another good source of introduction is the onlinerecordingfrom the 2020 LLVM Dev Conference (slides).

This tutorial assumes you have cloned and built MLIR; if you have not yet done so, seeGetting started with MLIR.

This tutorial is divided in the following chapters:

Thefirst chapter will introduce the Toy language and AST.

Toy Tutorial Docs