[analyzer][NFC] Remove "V2" from ArrayBoundCheckerV2.cpp (#126094)
[llvm-project.git] / mlir / docs / Tutorials / Toy / _index.md
blobc93eae3fa52f71f8857946ad03ff514ea3d1bcd6
1 # Toy Tutorial
3 This tutorial runs through the implementation of a basic toy language on top of
4 MLIR. The goal of this tutorial is to introduce the concepts of MLIR; in
5 particular, how [dialects](../../LangRef.md/#dialects) can help easily support
6 language specific constructs and transformations while still offering an easy
7 path to lower to LLVM or other codegen infrastructure. This tutorial is based on
8 the model of the
9 [LLVM Kaleidoscope Tutorial](https://llvm.org/docs/tutorial/MyFirstLanguageFrontend/index.html).
11 Another good source of introduction is the online [recording](https://www.youtube.com/watch?v=Y4SvqTtOIDk)
12 from the 2020 LLVM Dev Conference ([slides](https://llvm.org/devmtg/2020-09/slides/MLIR_Tutorial.pdf)).
14 This tutorial assumes you have cloned and built MLIR; if you have not yet done
15 so, see
16 [Getting started with MLIR](../../../getting_started/).
18 This tutorial is divided in the following chapters:
20 -   [Chapter #1](Ch-1.md): Introduction to the Toy language and the definition
21     of its AST.
22 -   [Chapter #2](Ch-2.md): Traversing the AST to emit a dialect in MLIR,
23     introducing base MLIR concepts. Here we show how to start attaching
24     semantics to our custom operations in MLIR.
25 -   [Chapter #3](Ch-3.md): High-level language-specific optimization using
26     pattern rewriting system.
27 -   [Chapter #4](Ch-4.md): Writing generic dialect-independent transformations
28     with Interfaces. Here we will show how to plug dialect specific information
29     into generic transformations like shape inference and inlining.
30 -   [Chapter #5](Ch-5.md): Partially lowering to lower-level dialects. We'll
31     convert some of our high level language specific semantics towards a generic
32     affine oriented dialect for optimization.
33 -   [Chapter #6](Ch-6.md): Lowering to LLVM and code generation. Here we'll
34     target LLVM IR for code generation, and detail more of the lowering
35     framework.
36 -   [Chapter #7](Ch-7.md): Extending Toy: Adding support for a composite type.
37     We'll demonstrate how to add a custom type to MLIR, and how it fits in the
38     existing pipeline.
40 The [first chapter](Ch-1.md) will introduce the Toy language and AST.