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

Michael Kruse via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 30 05:15:31 PDT 2025


================
@@ -6556,13 +6545,14 @@ OpenMPIRBuilder::InsertPointOrErrorTy OpenMPIRBuilder::emitCommonDirectiveExit(
     FinalizationInfo Fi = FinalizationStack.pop_back_val();
     assert(Fi.DK == OMPD && "Unexpected Directive for Finalization call!");
 
-    if (Error Err = Fi.FiniCB(FinIP))
-      return Err;
-
-    BasicBlock *FiniBB = FinIP.getBlock();
-    Instruction *FiniBBTI = FiniBB->getTerminator();
+    if (!Fi.FiniBB) {
+      if (Error Err = Fi.FiniCB(FinIP))
+        return Err;
+      Fi.FiniBB = FinIP.getBlock();
----------------
Meinersbur wrote:

[serious] Is there a guarantee that `FinIP` is a BasicBlock exclusive to finialization, and does not contain other code that would be executed if we reuse that block?

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


More information about the cfe-commits mailing list