This is an archive of the discontinued LLVM Phabricator instance.

[mlir][transform] Clean up SplitHandlesOp
ClosedPublic

Authored by springerm on May 5 2023, 1:45 AM.

Details

Summary
  • Rename to SplitHandleOp: it splits a single handle.
  • Drop num_result_handles attribute: it is redundant and can be inferred from the number of results.
  • Improve documentation and minor code cleanups.

Depends On: D149929

Diff Detail

Event Timeline

springerm created this revision.May 5 2023, 1:45 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 5 2023, 1:45 AM
springerm requested review of this revision.May 5 2023, 1:45 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 5 2023, 1:45 AM
ftynse added a comment.May 5 2023, 3:51 AM

While we are at it, could we generalize this operation a bit? I'd like to see additional behavior, potentially controlled by attributes:

  • if there are more ops than handles, put all the remaining ops into the first/last handle instead of failing (depending on the attribute);
  • if there are less ops than handles, keep trailing handles empty (default, can be disabled by attribute);
  • maybe some wraparound where each n-th op goes to n-th handle.

I have always found this op barely usable and very narrow as we rarely know the exact number of operations associated with a handle in the general case.

Also, https://reviews.llvm.org/D149652.

mlir/include/mlir/Dialect/Transform/IR/TransformOps.td
526–529

This bit of the documentation is outdated.

ftynse accepted this revision.May 5 2023, 3:57 AM
This revision is now accepted and ready to land.May 5 2023, 3:57 AM
This revision was automatically updated to reflect the committed changes.
springerm marked an inline comment as done.