This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Transform dialect: add named sequences
ClosedPublic

Authored by ftynse on Mar 20 2023, 9:22 AM.

Details

Summary

Named sequences introduce an additional abstraction and reuse capability
to the transform dialect. They can be though of as macros parameterized
with handles that can be invoked in places where a transform dialect
operation is expected. Such reuse was previously not possible in the
dialect and required dynamic construction of the transform IR from the
client language. Named sequences are intentionally restricted to
disallow recursion, as it could make the dialect accidentally
Turing-complete, which isn't desired at this point.

Diff Detail

Event Timeline

ftynse created this revision.Mar 20 2023, 9:22 AM
ftynse requested review of this revision.Mar 20 2023, 9:22 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 20 2023, 9:22 AM
springerm accepted this revision.Mar 21 2023, 12:58 AM
springerm added inline comments.
mlir/include/mlir/Dialect/Transform/IR/TransformOps.td
271

Is there a reason why the terminology is "named_sequence, include, yield" instead of "function, call, return"?

mlir/lib/Dialect/Transform/IR/TransformOps.cpp
786

Should there be a check for the correct terminator operation here?

This revision is now accepted and ready to land.Mar 21 2023, 12:58 AM
ftynse updated this revision to Diff 506959.Mar 21 2023, 6:45 AM
ftynse marked an inline comment as done.

Address review.

mlir/include/mlir/Dialect/Transform/IR/TransformOps.td
271

Because these are not functions, and are closer to macros, so I don't want somebody to think they are functions and use that to, e.g., justify adding recursion.

This revision was landed with ongoing or failed builds.Mar 21 2023, 7:54 AM
This revision was automatically updated to reflect the committed changes.