This is an archive of the discontinued LLVM Phabricator instance.

[mlir] move PDL-related transform ops into an extension
ClosedPublic

Authored by ftynse on May 22 2023, 7:42 AM.

Details

Summary

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.

Diff Detail

Event Timeline

ftynse created this revision.May 22 2023, 7:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 22 2023, 7:42 AM
ftynse requested review of this revision.May 22 2023, 7:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 22 2023, 7:42 AM
springerm accepted this revision.May 22 2023, 7:52 AM
springerm added inline comments.
mlir/include/mlir/Dialect/Transform/PDLExtension/PDLExtensionOps.td
19

Is this op now deprecated?

This revision is now accepted and ready to land.May 22 2023, 7:52 AM
ftynse updated this revision to Diff 524320.May 22 2023, 8:07 AM
ftynse marked an inline comment as done.

Add dedicated test for the constraint injection

ftynse added inline comments.May 22 2023, 8:12 AM
mlir/include/mlir/Dialect/Transform/PDLExtension/PDLExtensionOps.td
19

Not really, there may be cases where using PDL matching is interesting, but not necessarily in the Linalg/Vector case.

ftynse updated this revision to Diff 524349.May 22 2023, 9:10 AM

Add some more Bazel

ftynse updated this revision to Diff 524600.May 23 2023, 1:08 AM

More bazel.

ftynse updated this revision to Diff 524609.May 23 2023, 1:37 AM

Bazel is annoying.

This revision was automatically updated to reflect the committed changes.