This CL adds a new RegionBranchTerminatorOpInterface to query information about operands that can be passed to
passed to successor regions. Similar to the BranchOpInterface, it allows to freely define the involved operands. However, init allows to freely define the
involved operands. However, in contrast to the BranchOpInterface, it expects an additional region number to distinguish between various use cases
which might require different operands passed to different regions.
Moreover, we added a sample implementation to the SCF.ConditionOp to demonstrate its applicability. We alsnumber to distinguish between various use cases which might require different operands passed to
adapted the BudifferViewFlowAnalysis implementation to consider the new interfaceent regions.
TODO: add test cases to reproduce issues without implementing the RegionBranchTerminatorOpInterface.Moreover, we added new utility functions (namely getMutableRegionBranchSuccessorOperands and
getRegionBranchSuccessorOperands) to query (mutable) operand ranges for operations equiped with the
ReturnLike trait and/or implementing the newly added interface. This simplifies reasoning about
terminators in the scope of the nested regions.
We also adjusted the SCF.ConditionOp to benefit from the newly added capabilities.
See also: [[ https://llvm.discourse.group/t/memory-leak-for-structure-while-op-when-using-buffer-deallocation-pass/3550/3 | discussion on Discourse ]]