[Mlir-commits] [mlir] [mlir][transforms] Process RegionBranchOp with empty region (PR #123895)
Xiang Li
llvmlistbot at llvm.org
Sat Feb 1 08:02:28 PST 2025
python3kgae wrote:
> An alternate solution would be to change the code here to look only at the reachable regions by traversing the region successors. If this happens to be the only pass with this issue, I'm okay with the original change if `scf.if` containing an empty region is intentional.
I did a quick scan for the use of RegionBranchOpInterface.
When using getRegions on a RegionBranchOpInterface, most cases use for (Block &block : region).
Some use the region in for (Region ®ion : regionBranchOp->getRegions()) as an argument for other functions, which don’t access inside of the region.
The only place I saw that assumes the region should not be empty is RemoveDeadValues.
https://github.com/llvm/llvm-project/pull/123895
More information about the Mlir-commits
mailing list