[mlir] add types to the transform dialect
authorAlex Zinenko <zinenko@google.com>
Tue, 4 Oct 2022 11:49:21 +0000 (11:49 +0000)
committerAlex Zinenko <zinenko@google.com>
Tue, 11 Oct 2022 09:55:07 +0000 (09:55 +0000)
commitbba85ebdfeffba74d19a22cfb592641d0af6b66a
treeeaba368177e24054b5fa2665bf7806b5c42bccf7
parentb845addae89b6940c1af3c453aab914c6d170d20
[mlir] add types to the transform dialect

Introduce a type system for the transform dialect. A transform IR type
captures the expectations of the transform IR on the payload IR
operations that are being transformed, such as being of a certain kind
or implementing an interface that enables the transformation. This
provides stricter checking and better readability of the transform IR
than using the catch-all "handle" type.

This change implements the basic support for a type system amendable to
dialect extensions and adds a drop-in replacement for the unrestricted
"handle" type. The actual switch of transform dialect ops to that type
will happen in a separate commit.

See https://discourse.llvm.org/t/rfc-type-system-for-the-transform-dialect/65702

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D135164
24 files changed:
mlir/docs/Dialects/Transform.md
mlir/include/mlir/Dialect/Transform/IR/CMakeLists.txt
mlir/include/mlir/Dialect/Transform/IR/TransformDialect.h
mlir/include/mlir/Dialect/Transform/IR/TransformDialect.td
mlir/include/mlir/Dialect/Transform/IR/TransformInterfaces.h
mlir/include/mlir/Dialect/Transform/IR/TransformInterfaces.td
mlir/include/mlir/Dialect/Transform/IR/TransformOps.h
mlir/include/mlir/Dialect/Transform/IR/TransformOps.td
mlir/include/mlir/Dialect/Transform/IR/TransformTypes.h [new file with mode: 0644]
mlir/include/mlir/Dialect/Transform/IR/TransformTypes.td [new file with mode: 0644]
mlir/lib/Dialect/Transform/IR/CMakeLists.txt
mlir/lib/Dialect/Transform/IR/TransformDialect.cpp
mlir/lib/Dialect/Transform/IR/TransformInterfaces.cpp
mlir/lib/Dialect/Transform/IR/TransformOps.cpp
mlir/lib/Dialect/Transform/IR/TransformTypes.cpp [new file with mode: 0644]
mlir/test/Dialect/Transform/ops.mlir
mlir/test/Dialect/Transform/test-dialect-injection.mlir
mlir/test/Dialect/Transform/test-interpreter.mlir
mlir/test/lib/Dialect/Transform/CMakeLists.txt
mlir/test/lib/Dialect/Transform/TestTransformDialectExtension.cpp
mlir/test/lib/Dialect/Transform/TestTransformDialectExtension.h
mlir/test/lib/Dialect/Transform/TestTransformDialectExtension.td
utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
utils/bazel/llvm-project-overlay/mlir/test/BUILD.bazel