This is an archive of the discontinued LLVM Phabricator instance.

[mlir][interfaces] Add insideMutuallyExclusiveRegions helper
ClosedPublic

Authored by springerm on Nov 18 2021, 9:42 PM.

Details

Summary

Add a helper function to ControlFlowInterfaces for checking if two ops are in mutually exclusive regions according to RegionBranchOpInterface.

Utilize this new helper in Linalg ComprehensiveBufferize. This makes the analysis independent of the SCF dialect and generalizes it to other ops that implement RegionBranchOpInterface.

Depends On D114219

Diff Detail

Event Timeline

springerm created this revision.Nov 18 2021, 9:42 PM
springerm requested review of this revision.Nov 18 2021, 9:42 PM

Could you add a test with a special op that has similar behavior to a loopy-switch (e.g. round-robin) implemented with the RegionBranchOpInterface and make sure you get what you expect?

springerm updated this revision to Diff 389637.Nov 24 2021, 7:08 PM

move insideMutuallyExclusiveRegions to ControlFlowInterfaces

springerm retitled this revision from [mlir][linalg][bufferize] Generalize analysis to use RegionBranchOpInterface to [mlir][interfaces] Add insideMutuallyExclusiveRegions helper.Nov 24 2021, 7:10 PM
springerm edited the summary of this revision. (Show Details)
springerm added a reviewer: rriddle.
This revision is now accepted and ready to land.Nov 25 2021, 12:10 AM
ftynse added inline comments.Nov 25 2021, 12:31 AM
mlir/lib/Interfaces/ControlFlowInterfaces.cpp
238

Nit: could you swap the condition and use continue here?

264

I remember there is a lifetime-related issue with llvm::enumerate and references so please use auto it here instead.

springerm marked 2 inline comments as done.

address comments

This revision was landed with ongoing or failed builds.Nov 25 2021, 12:49 AM
This revision was automatically updated to reflect the committed changes.