MLIR supports declarative specification for controlling compiler transformations via the transform dialect. It allows one to request compiler transformations using compiler IR itself, which can be embedded into the original IR that is being transformed (similarly to pragmas) or supplied separately (similarly to scheduling languages). This tutorial presents the concepts of the MLIR transform dialect and related infrastructure. It will be accompanied by a practical demonstration of three use scenarios:
After following the tutorial, one will be able to apply the Transform dialect in their work and extend it when necessary. Basic familiarity with MLIR is a prerequisite. See Toy tutorial for introduction to MLIR.
The tutorial is divided into the following chapters.
The code corresponding to this tutorial is located under mlir/Examples/transform
and the corresponding tests in mlir/test/Examples/transform
.