[Mlir-commits] [mlir] [mlir][OpenACC] Barrier seq loops that reuse gang-private slots after worker calls (PR #224437)

Delaram Talaashrafi llvmlistbot at llvm.org
Tue Sep 22 07:01:16 PDT 2026


================
@@ -397,6 +397,22 @@ static bool isThreadXPrivatize(PrivatizeOp privatize) {
   return false;
 }
 
+/// True when \p block is nested in a region that only part of the workgroup
+/// enters, such as an `scf.if` or `fir.if` branch, so a workgroup barrier there
+/// could deadlock. A loop body does not count: every thread agrees on the trip
+/// count here.
+static bool isInsideConditional(Block *block) {
+  if (!block)
+    return false;
+  for (Operation *parent = block->getParentOp();
+       parent && !isa<gpu::LaunchOp, FunctionOpInterface>(parent);
+       parent = parent->getParentOp())
+    if (isa<RegionBranchOpInterface>(parent) &&
+        !isa<LoopLikeOpInterface>(parent))
+      return true;
+  return false;
----------------
delaram-talaashrafi wrote:

Excluded `scf.execute_region` as well in the new revision.

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


More information about the Mlir-commits mailing list