1 # Standalone Transform Dialect Interpreter
3 This is an example of using the Transform dialect interpreter functionality standalone, that is, outside of the regular pass pipeline. The example is a
4 binary capable of processing MLIR source files similar to `mlir-opt` and other
5 optimizer drivers, with the entire transformation process driven by a Transform
6 dialect script. This script can be embedded into the source file or provided in
7 a separate MLIR source file.
9 Either the input module or the transform module must contain a top-level symbol
10 named `__transform_main`, which is used as the entry point to the transformation
14 mlir-transform-opt payload_with_embedded_transform.mlir
15 mlir-transform-opt payload.mlir -transform=transform.mlir
18 The name of the entry point can be overridden using command-line options.
21 mlir-transform-opt payload-mlir -transform-entry-point=another_entry_point
24 Transform scripts can reference symbols defined in other source files, called
25 libraries, which can be supplied to the binary through command-line options.
26 Libraries will be embedded into the main transformation module by the tool and
27 the interpreter will process everything as a single module. A debug option is
28 available to see the contents of the transform module before it goes into the interpreter.
31 mlir-transform-opt payload.mlir -transform=transform.mlir \
32 -transform-library=external_definitions_1.mlir \
33 -transform-library=external_definitions_2.mlir \
37 Check out the [Transform dialect
38 tutorial](https://mlir.llvm.org/docs/Tutorials/transform/) as well as
39 [documentation](https://mlir.llvm.org/docs/Dialects/Transform/) to learn more