[mlir] add OperationType to the Transform dialect
authorAlex Zinenko <zinenko@google.com>
Mon, 10 Oct 2022 14:33:59 +0000 (14:33 +0000)
committerAlex Zinenko <zinenko@google.com>
Tue, 11 Oct 2022 09:55:19 +0000 (09:55 +0000)
commit3e1f6d02f755e34a0a12a8dd439fb65f84d6621f
treeacf2531c582ed1850f71c92a6fab79ce9cdd1e3f
parent6bb997c032f509d4f61461aa461c8431325cbb2a
[mlir] add OperationType to the Transform dialect

Add a new OperationType handle type to the Transform dialect. This
transform type is parameterized by the name of the payload operation it
can point to. It is intended as a constraint on transformations that are
only applicable to a specific kind of payload operations. If a
transformation is applicable to a small set of operation classes, it can
be wrapped into a transform op by using a disjunctive constraint, such
as `Type<Or<[Transform_ConcreteOperation<"foo">.predicate,
Transform_ConcreteOperation<"bar">.predicate]>>` for its operand without
modifying this type. Broader sets of accepted operations should be
modeled as specific types.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D135586
21 files changed:
mlir/include/mlir-c/Dialect/Transform.h [new file with mode: 0644]
mlir/include/mlir/Dialect/Transform/IR/TransformDialect.td
mlir/include/mlir/Dialect/Transform/IR/TransformInterfaces.td
mlir/include/mlir/Dialect/Transform/IR/TransformTypes.td
mlir/lib/Bindings/Python/DialectTransform.cpp [new file with mode: 0644]
mlir/lib/CAPI/Dialect/CMakeLists.txt
mlir/lib/CAPI/Dialect/Transform.cpp [new file with mode: 0644]
mlir/lib/Dialect/Transform/IR/TransformDialect.cpp
mlir/lib/Dialect/Transform/IR/TransformTypes.cpp
mlir/python/CMakeLists.txt
mlir/python/mlir/_mlir_libs/_mlir/dialects/transform/__init__.pyi [new file with mode: 0644]
mlir/python/mlir/dialects/_transform_ops_ext.py
mlir/python/mlir/dialects/transform/__init__.py
mlir/test/CAPI/CMakeLists.txt
mlir/test/CAPI/transform.c [new file with mode: 0644]
mlir/test/CMakeLists.txt
mlir/test/Dialect/Transform/ops.mlir
mlir/test/Dialect/Transform/test-interpreter.mlir
mlir/test/lit.cfg.py
mlir/test/python/dialects/transform.py
utils/bazel/llvm-project-overlay/mlir/BUILD.bazel