[mlir] move PDL-related transform ops into an extension
authorAlex Zinenko <zinenko@google.com>
Mon, 22 May 2023 14:36:58 +0000 (14:36 +0000)
committerAlex Zinenko <zinenko@google.com>
Wed, 24 May 2023 12:25:06 +0000 (12:25 +0000)
commit94d608d410267db693aa85070263e2b4ef0be913
tree46650b61471bd509ce31e13969a12e0556c1ac60
parent3590945a11c79a539738dcecd5d7706b6449d0c4
[mlir] move PDL-related transform ops into an extension

The initial bring-up of the Transform dialect relied on PDL to provide
the default handle type (`!pdl.operation`) and the matching capability.
Both are now provided natively by the Transform dialect removing the
reason to have a hard dependency on the PDL dialect and its interpreter.
Move PDL-related transform operations into a separate extension.

This requires us to introduce a dialect state extension mechanism into
the Transform dialect so it no longer needs to know about PDL constraint
functions that may be injected by extensions similarly to operations and
types. This mechanism will be reused to connect pattern application
drivers and the Transform dialect.

This completes the restructuring of the Transform dialect to remove
overrilance on PDL.

Note to downstreams: flow that are using `!pdl.operation` with Transform
dialect operations will now require `transform::PDLExtension` to be
applied to the transform dialect in order to provide the transform
handle type interface for `!pdl.operation`.

Reviewed By: springerm

Differential Revision: https://reviews.llvm.org/D151104
33 files changed:
mlir/include/mlir/Dialect/Transform/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/TransformOps.h
mlir/include/mlir/Dialect/Transform/IR/TransformOps.td
mlir/include/mlir/Dialect/Transform/PDLExtension/CMakeLists.txt [new file with mode: 0644]
mlir/include/mlir/Dialect/Transform/PDLExtension/PDLExtension.h [new file with mode: 0644]
mlir/include/mlir/Dialect/Transform/PDLExtension/PDLExtensionOps.h [new file with mode: 0644]
mlir/include/mlir/Dialect/Transform/PDLExtension/PDLExtensionOps.td [new file with mode: 0644]
mlir/include/mlir/InitAllDialects.h
mlir/lib/Dialect/Transform/CMakeLists.txt
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/PDLExtension/CMakeLists.txt [new file with mode: 0644]
mlir/lib/Dialect/Transform/PDLExtension/PDLExtension.cpp [new file with mode: 0644]
mlir/lib/Dialect/Transform/PDLExtension/PDLExtensionOps.cpp [new file with mode: 0644]
mlir/python/CMakeLists.txt
mlir/python/mlir/dialects/TransformPDLExtensionOps.td [new file with mode: 0644]
mlir/python/mlir/dialects/_transform_ops_ext.py
mlir/python/mlir/dialects/_transform_pdl_extension_ops_ext.py [new file with mode: 0644]
mlir/python/mlir/dialects/transform/pdl.py [new file with mode: 0644]
mlir/test/Dialect/Transform/test-interpreter.mlir
mlir/test/Dialect/Transform/test-pdl-extension.mlir [new file with mode: 0644]
mlir/test/lib/Dialect/Transform/CMakeLists.txt
mlir/test/lib/Dialect/Transform/TestTransformDialectExtension.cpp
mlir/test/python/dialects/transform.py
mlir/test/python/dialects/transform_structured_ext.py
utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
utils/bazel/llvm-project-overlay/mlir/python/BUILD.bazel
utils/bazel/llvm-project-overlay/mlir/test/BUILD.bazel