[mlir][transform] Utilize op interface instead of tensor::TrackingListener
authorMatthias Springer <me@m-sp.org>
Fri, 2 Jun 2023 12:42:56 +0000 (14:42 +0200)
committerMatthias Springer <me@m-sp.org>
Fri, 2 Jun 2023 12:50:43 +0000 (14:50 +0200)
commit000bc58b633e841dff58266b1406e73937c425c3
tree4d12ea8a2f7f1ed9cc0718541f7aa30ff6212456
parenta584f0f553453627e10d870c74530576338b1c1e
[mlir][transform] Utilize op interface instead of tensor::TrackingListener

Add a new interface `FindPayloadReplacementOpInterface` to specify ops that should be skipped when looking for payload replacement ops. Such ops are typically metadata-only ops.

With this change, we no longer need to maintain a custom TrackingListener in the tensor dialect.

Note: `CastOpInterface` by itself is not sufficient. Some metadata-only ops such as "tensor.reshape" are not casts, and it would be incorrect for them to implement the `CastOpInterface`.

Differential Revision: https://reviews.llvm.org/D151888
mlir/include/mlir/Dialect/Tensor/TransformOps/TensorTransformOps.h
mlir/include/mlir/Dialect/Transform/IR/TransformInterfaces.td
mlir/include/mlir/Dialect/Transform/IR/TransformOps.h
mlir/include/mlir/InitAllDialects.h
mlir/lib/Dialect/Tensor/TransformOps/TensorTransformOps.cpp
mlir/lib/Dialect/Transform/IR/TransformOps.cpp
mlir/test/lib/Dialect/Tensor/CMakeLists.txt
mlir/test/lib/Dialect/Tensor/TestTensorTransforms.cpp
utils/bazel/llvm-project-overlay/mlir/test/BUILD.bazel