1# Transform Dialect Tutorial 2 3MLIR supports declarative specification for controlling compiler transformations 4via the transform dialect. It allows one to request compiler transformations 5using compiler IR itself, which can be embedded into the original IR that is 6being transformed (similarly to pragmas) or supplied separately (similarly to 7scheduling languages). This tutorial presents the concepts of the MLIR transform 8dialect and related infrastructure. It will be accompanied by a practical 9demonstration of three use scenarios: 10 11- Composing Transform dialect operations available in (upstream) MLIR to perform 12 a sequence of optimizing transformations that results in efficient code for an 13 MLIR linear algebra operation. 14- Defining new Transform dialect operations and adapting existing transformation 15 code to work with the Transform dialect infrastructure. 16- Setting up and using the Transform dialect infrastructure in a downstream 17 out-of-tree project with custom dialects, transformations and passes. 18 19After following the tutorial, one will be able to apply the Transform dialect in 20their work and extend it when necessary. Basic familiarity with MLIR is a 21prerequisite. See [Toy tutorial](../Toy) for introduction to MLIR. 22 23The tutorial is divided into the following chapters. 24 25- [Chapter #0](Ch0.md): A Primer on “Structured” Linalg Operations 26- [Chapter #1](Ch1.md): Combining Existing Transformations 27- [Chapter #2](Ch2.md): Adding a Simple New Transformation Operation 28- [Chapter #3](Ch3.md): More than Simple Transform Operations 29- [Chapter #4](Ch4.md): Matching Payload with Transform Operations 30- [Chapter H](ChH.md): Reproducing Halide Schedule 31 32The code corresponding to this tutorial is located under 33`mlir/Examples/transform` and the corresponding tests in 34`mlir/test/Examples/transform`. 35