[Mlir-commits] [llvm] [mlir] [OMPIRBuilder] - Make offloading input data persist for deferred target tasks (PR #133499)
Sergio Afonso
llvmlistbot at 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) {
+ for (auto *V :
+ {RTArgs.BasePointersArray, RTArgs.PointersArray, RTArgs.MappersArray,
+ RTArgs.MapNamesArray, RTArgs.MapTypesArray, RTArgs.MapTypesArrayEnd,
+ RTArgs.SizesArray}) {
+ if (V && !isa<ConstantPointerNull>(V) && !isa<GlobalVariable>(V)) {
----------------
skatrak wrote:
```suggestion
if (V && !isa<ConstantPointerNull, GlobalVariable>(V)) {
```
https://github.com/llvm/llvm-project/pull/133499
More information about the Mlir-commits
mailing list