[llvm-branch-commits] [clang] [llvm] [mlir] [OMPIRBuilder] Add support for explicit deallocation points (PR #154752)

Sergio Afonso via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Aug 26 02:19:17 PDT 2025


================
@@ -1870,9 +1821,12 @@ OpenMPIRBuilder::InsertPointOrErrorTy OpenMPIRBuilder::createParallel(
     };
   }
 
-  OI->OuterAllocaBB = OuterAllocaBlock;
+  OI->OuterAllocBB = OuterAllocaBlock;
   OI->EntryBB = PRegEntryBB;
   OI->ExitBB = PRegExitBB;
+  OI->OuterDeallocBBs.reserve(OuterDeallocIPs.size());
+  for (InsertPointTy DeallocIP : OuterDeallocIPs)
+    OI->OuterDeallocBBs.push_back(DeallocIP.getBlock());
----------------
skatrak wrote:

I'd agree with that. The reason I didn't do it was that we already discard the specific insert point information for the allocation point, and just pass the block.

Since `InsertPointTy` is defined in `IRBuilder`, we'd either have to move it or copy it into the `CodeExtractor` or store both block and iterator separately for each of these points in the `CodeExtractor`. Not sure if this is worth doing here, but let me know if you'd like to see that change.

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


More information about the llvm-branch-commits mailing list