[clang] [llvm] [mlir] [OMPIRBuilder] always leave PARALLEL via the same barrier (PR #164586)

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 22 04:48:32 PDT 2025


================
@@ -1800,8 +1779,18 @@ OpenMPIRBuilder::InsertPointOrErrorTy OpenMPIRBuilder::createParallel(
   Instruction *PRegPreFiniTI = PRegPreFiniBB->getTerminator();
 
   InsertPointTy PreFiniIP(PRegPreFiniBB, PRegPreFiniTI->getIterator());
-  if (Error Err = FiniCB(PreFiniIP))
-    return Err;
+  if (!FiniInfo.FiniBB) {
+    if (Error Err = FiniCB(PreFiniIP))
----------------
Meinersbur wrote:

What would set `FiniInfo.FiniBB`?

If it is a call to `createBarrier` that the `FiniCB` is expected to make, that's the kind of devil's contract that makes the callback-driven design so bad.

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


More information about the llvm-commits mailing list