[llvm] [mlir] [OMPIRBuilder] - Make offloading input data persist for deferred target tasks (PR #133499)

Sergio Afonso via llvm-commits llvm-commits at lists.llvm.org
Thu May 8 05:50:53 PDT 2025


================
@@ -7291,15 +7400,56 @@ OpenMPIRBuilder::InsertPointOrErrorTy OpenMPIRBuilder::emitTargetTask(
   emitBlock(OI.ExitBB, Builder.GetInsertBlock()->getParent(),
             /*IsFinished=*/true);
 
-  OI.PostOutlineCB = [this, ToBeDeleted, Dependencies, HasNoWait,
-                      DeviceID](Function &OutlinedFn) mutable {
+  SmallVector<Value *, 2> OffloadingArraysToPrivatize;
+  if (DeviceID && HasNoWait) {
----------------
skatrak wrote:

Nit: I think it would be good to hoist the `bool NeedsTargetTask = HasNoWait && DeviceID` statement from the callback below and reuse it in both places, to avoid a change in that condition from getting both places out of sync.

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


More information about the llvm-commits mailing list