This is an archive of the discontinued LLVM Phabricator instance.

[mlir][scf] Add insideMutuallyExclusiveBranches helper
ClosedPublic

Authored by springerm on Oct 17 2021, 1:45 AM.

Details

Summary

This helper function checks if two given ops are in mutually exclusive branches of the same scf::IfOp.

Depends On D111928

Diff Detail

Event Timeline

springerm created this revision.Oct 17 2021, 1:45 AM
springerm requested review of this revision.Oct 17 2021, 1:45 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 17 2021, 1:45 AM
springerm added inline comments.Oct 17 2021, 1:48 AM
mlir/include/mlir/Dialect/SCF/SCF.h
55

I think RegionBranchOpInterface does not have the capability to support this atm. I can query the "successor" region of a region (or an op in general). But, in general, after executing a region, another region of the same op may execute. What we are asking here is "execute one region but not the other one".

ftynse accepted this revision.Oct 18 2021, 5:45 AM

LGTM if naming is fixed.

mlir/include/mlir/Dialect/SCF/SCF.h
55

This sounds very specific to "conditional" ops so I suggest to keep it on individual ops for now.

56

s/Mutable/Mutually

Also in the commit description.

This revision is now accepted and ready to land.Oct 18 2021, 5:45 AM
springerm retitled this revision from [mlir][scf] Add insideMutableExclusiveBranches helper to [mlir][scf] Add insideMutuallyExclusiveBranches helper.Oct 18 2021, 5:07 PM
This revision was landed with ongoing or failed builds.Oct 18 2021, 5:14 PM
This revision was automatically updated to reflect the committed changes.
springerm marked 2 inline comments as done.Oct 18 2021, 7:41 PM