[Mlir-commits] [mlir] [acc] add RegionBranchOpInterface to acc.loop (PR #172940)

Razvan Lupusoru llvmlistbot at llvm.org
Thu Dec 18 20:37:39 PST 2025


================
@@ -444,6 +444,12 @@ void HostDataOp::getSuccessorRegions(
                                     regions);
 }
 
+void LoopOp::getSuccessorRegions(RegionBranchPoint point,
+                                 SmallVectorImpl<RegionSuccessor> &regions) {
+  getSingleRegionOpSuccessorRegions(getOperation(), getRegion(), point,
----------------
razvanlupusoru wrote:

I am not sure this is correct since it doesn't capture the backward branch to self. 

For example, scf.for does the following:
```
void ForOp::getSuccessorRegions(RegionBranchPoint point,
                                SmallVectorImpl<RegionSuccessor> &regions) {
  // Both the operation itself and the region may be branching into the body or
  // back into the operation itself. It is possible for loop not to enter the
  // body.
  regions.push_back(RegionSuccessor(&getRegion(), getRegionIterArgs()));
  regions.push_back(RegionSuccessor(getOperation(), getResults()));
}
```

Can you please investigate what is needed to make it correct? And then see what the test needs to exercise this (namely, without this functionality, the test should fail).

https://github.com/llvm/llvm-project/pull/172940


More information about the Mlir-commits mailing list