This is an archive of the discontinued LLVM Phabricator instance.

[mlir] allow region branch spec from parent op to itself
ClosedPublic

Authored by ftynse on Jul 20 2023, 5:29 AM.

Details

Summary

RegionBranchOpInterface did not allow the operation with regions to
specify itself as successors. Therefore, this implied that the control
is always transferred to a region before being transferred back to the
parent op. Since the region can only transfer the control back to the
parent op from a terminator, this transitively implied that the first
block of any region with a RegionBranchOpInterface is always executed
until the terminator can transfer the control flow back. This is
trivially false for any conditional-like operation that may or may not
execute the region, as well as for loop-like operations that may not
execute the body.

Remove the restriction from the interface description and update the
only transform that relied on it.

See
https://discourse.llvm.org/t/rfc-region-control-flow-interfaces-should-encode-region-not-executed-correctly/72103.

Depends On: https://reviews.llvm.org/D155757

Diff Detail

Event Timeline

ftynse created this revision.Jul 20 2023, 5:29 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 20 2023, 5:29 AM
ftynse requested review of this revision.Jul 20 2023, 5:29 AM
springerm accepted this revision.Jul 20 2023, 6:08 AM
This revision is now accepted and ready to land.Jul 20 2023, 6:08 AM
Mogball accepted this revision.Jul 20 2023, 7:43 AM
This revision was landed with ongoing or failed builds.Jul 21 2023, 2:17 AM
This revision was automatically updated to reflect the committed changes.