Skip to content

Commit d31b265

Browse files
committed
[OMPIRBuilder] Add support for explicit deallocation points
In this patch, some OMPIRBuilder codegen functions and callbacks are updated to work with arrays of deallocation insertion points. The purpose of this is to enable the replacement of `alloca`s with other types of allocations that require explicit deallocations in a way that makes it possible for `CodeExtractor` instances created during OMPIRBuilder finalization to also use them. The OpenMP to LLVM IR MLIR translation pass is updated to properly store and forward deallocation points together with their matching allocation point to the OMPIRBuilder. Currently, only the `DeviceSharedMemCodeExtractor` uses this feature to get the `CodeExtractor` to use device shared memory for intermediate allocations when outlining a parallel region inside of a Generic kernel (code path that is only used by Flang via MLIR, currently). However, long term this might also be useful to refactor finalization of variables with destructors, potentially reducing the use of callbacks and simplifying privatization and reductions. Instead of a single deallocation point, lists of those are used. This is to cover cases where there are multiple exit blocks originating from a single entry. If an allocation needing explicit deallocation is placed in the entry block of such cases, it would need to be deallocated before each of the exits.
1 parent 6ed5190 commit d31b265

File tree

15 files changed

+630
-514
lines changed

15 files changed

+630
-514
lines changed

clang/lib/CodeGen/CGOpenMPRuntime.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10923,8 +10923,8 @@ void CGOpenMPRuntime::emitTargetDataCalls(
1092310923
llvm::OpenMPIRBuilder::LocationDescription OmpLoc(CodeGenIP);
1092410924
llvm::OpenMPIRBuilder::InsertPointTy AfterIP =
1092510925
cantFail(OMPBuilder.createTargetData(
10926-
OmpLoc, AllocaIP, CodeGenIP, DeviceID, IfCondVal, Info, GenMapInfoCB,
10927-
CustomMapperCB,
10926+
OmpLoc, AllocaIP, CodeGenIP, /*DeallocIPs=*/{}, DeviceID, IfCondVal,
10927+
Info, GenMapInfoCB, CustomMapperCB,
1092810928
/*MapperFunc=*/nullptr, BodyCB, DeviceAddrCB, RTLoc));
1092910929
CGF.Builder.restoreIP(AfterIP);
1093010930
}

clang/lib/CodeGen/CGStmtOpenMP.cpp

Lines changed: 43 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1886,20 +1886,21 @@ void CodeGenFunction::EmitOMPParallelDirective(const OMPParallelDirective &S) {
18861886
const CapturedStmt *CS = S.getCapturedStmt(OMPD_parallel);
18871887
const Stmt *ParallelRegionBodyStmt = CS->getCapturedStmt();
18881888

1889-
auto BodyGenCB = [&, this](InsertPointTy AllocaIP,
1890-
InsertPointTy CodeGenIP) {
1889+
auto BodyGenCB = [&, this](InsertPointTy AllocIP, InsertPointTy CodeGenIP,
1890+
ArrayRef<InsertPointTy> DeallocIPs) {
18911891
OMPBuilderCBHelpers::EmitOMPOutlinedRegionBody(
1892-
*this, ParallelRegionBodyStmt, AllocaIP, CodeGenIP, "parallel");
1892+
*this, ParallelRegionBodyStmt, AllocIP, CodeGenIP, "parallel");
18931893
return llvm::Error::success();
18941894
};
18951895

18961896
CGCapturedStmtInfo CGSI(*CS, CR_OpenMP);
18971897
CodeGenFunction::CGCapturedStmtRAII CapInfoRAII(*this, &CGSI);
18981898
llvm::OpenMPIRBuilder::InsertPointTy AllocaIP(
18991899
AllocaInsertPt->getParent(), AllocaInsertPt->getIterator());
1900-
llvm::OpenMPIRBuilder::InsertPointTy AfterIP = cantFail(
1901-
OMPBuilder.createParallel(Builder, AllocaIP, BodyGenCB, PrivCB, FiniCB,
1902-
IfCond, NumThreads, ProcBind, S.hasCancel()));
1900+
llvm::OpenMPIRBuilder::InsertPointTy AfterIP =
1901+
cantFail(OMPBuilder.createParallel(
1902+
Builder, AllocaIP, /*DeallocIPs=*/{}, BodyGenCB, PrivCB, FiniCB,
1903+
IfCond, NumThreads, ProcBind, S.hasCancel()));
19031904
Builder.restoreIP(AfterIP);
19041905
return;
19051906
}
@@ -4427,21 +4428,23 @@ void CodeGenFunction::EmitOMPSectionsDirective(const OMPSectionsDirective &S) {
44274428
llvm::SmallVector<BodyGenCallbackTy, 4> SectionCBVector;
44284429
if (CS) {
44294430
for (const Stmt *SubStmt : CS->children()) {
4430-
auto SectionCB = [this, SubStmt](InsertPointTy AllocaIP,
4431-
InsertPointTy CodeGenIP) {
4432-
OMPBuilderCBHelpers::EmitOMPInlinedRegionBody(
4433-
*this, SubStmt, AllocaIP, CodeGenIP, "section");
4431+
auto SectionCB = [this, SubStmt](InsertPointTy AllocIP,
4432+
InsertPointTy CodeGenIP,
4433+
ArrayRef<InsertPointTy> DeallocIPs) {
4434+
OMPBuilderCBHelpers::EmitOMPInlinedRegionBody(*this, SubStmt, AllocIP,
4435+
CodeGenIP, "section");
44344436
return llvm::Error::success();
44354437
};
44364438
SectionCBVector.push_back(SectionCB);
44374439
}
44384440
} else {
4439-
auto SectionCB = [this, CapturedStmt](InsertPointTy AllocaIP,
4440-
InsertPointTy CodeGenIP) {
4441-
OMPBuilderCBHelpers::EmitOMPInlinedRegionBody(
4442-
*this, CapturedStmt, AllocaIP, CodeGenIP, "section");
4443-
return llvm::Error::success();
4444-
};
4441+
auto SectionCB =
4442+
[this, CapturedStmt](InsertPointTy AllocIP, InsertPointTy CodeGenIP,
4443+
ArrayRef<InsertPointTy> DeallocIPs) {
4444+
OMPBuilderCBHelpers::EmitOMPInlinedRegionBody(
4445+
*this, CapturedStmt, AllocIP, CodeGenIP, "section");
4446+
return llvm::Error::success();
4447+
};
44454448
SectionCBVector.push_back(SectionCB);
44464449
}
44474450

@@ -4495,10 +4498,11 @@ void CodeGenFunction::EmitOMPSectionDirective(const OMPSectionDirective &S) {
44954498
return llvm::Error::success();
44964499
};
44974500

4498-
auto BodyGenCB = [SectionRegionBodyStmt, this](InsertPointTy AllocaIP,
4499-
InsertPointTy CodeGenIP) {
4501+
auto BodyGenCB = [SectionRegionBodyStmt,
4502+
this](InsertPointTy AllocIP, InsertPointTy CodeGenIP,
4503+
ArrayRef<InsertPointTy> DeallocIPs) {
45004504
OMPBuilderCBHelpers::EmitOMPInlinedRegionBody(
4501-
*this, SectionRegionBodyStmt, AllocaIP, CodeGenIP, "section");
4505+
*this, SectionRegionBodyStmt, AllocIP, CodeGenIP, "section");
45024506
return llvm::Error::success();
45034507
};
45044508

@@ -4580,10 +4584,11 @@ void CodeGenFunction::EmitOMPMasterDirective(const OMPMasterDirective &S) {
45804584
return llvm::Error::success();
45814585
};
45824586

4583-
auto BodyGenCB = [MasterRegionBodyStmt, this](InsertPointTy AllocaIP,
4584-
InsertPointTy CodeGenIP) {
4587+
auto BodyGenCB = [MasterRegionBodyStmt,
4588+
this](InsertPointTy AllocIP, InsertPointTy CodeGenIP,
4589+
ArrayRef<InsertPointTy> DeallocIPs) {
45854590
OMPBuilderCBHelpers::EmitOMPInlinedRegionBody(
4586-
*this, MasterRegionBodyStmt, AllocaIP, CodeGenIP, "master");
4591+
*this, MasterRegionBodyStmt, AllocIP, CodeGenIP, "master");
45874592
return llvm::Error::success();
45884593
};
45894594

@@ -4630,10 +4635,11 @@ void CodeGenFunction::EmitOMPMaskedDirective(const OMPMaskedDirective &S) {
46304635
return llvm::Error::success();
46314636
};
46324637

4633-
auto BodyGenCB = [MaskedRegionBodyStmt, this](InsertPointTy AllocaIP,
4634-
InsertPointTy CodeGenIP) {
4638+
auto BodyGenCB = [MaskedRegionBodyStmt,
4639+
this](InsertPointTy AllocIP, InsertPointTy CodeGenIP,
4640+
ArrayRef<InsertPointTy> DeallocIPs) {
46354641
OMPBuilderCBHelpers::EmitOMPInlinedRegionBody(
4636-
*this, MaskedRegionBodyStmt, AllocaIP, CodeGenIP, "masked");
4642+
*this, MaskedRegionBodyStmt, AllocIP, CodeGenIP, "masked");
46374643
return llvm::Error::success();
46384644
};
46394645

@@ -4673,10 +4679,11 @@ void CodeGenFunction::EmitOMPCriticalDirective(const OMPCriticalDirective &S) {
46734679
return llvm::Error::success();
46744680
};
46754681

4676-
auto BodyGenCB = [CriticalRegionBodyStmt, this](InsertPointTy AllocaIP,
4677-
InsertPointTy CodeGenIP) {
4682+
auto BodyGenCB = [CriticalRegionBodyStmt,
4683+
this](InsertPointTy AllocIP, InsertPointTy CodeGenIP,
4684+
ArrayRef<InsertPointTy> DeallocIPs) {
46784685
OMPBuilderCBHelpers::EmitOMPInlinedRegionBody(
4679-
*this, CriticalRegionBodyStmt, AllocaIP, CodeGenIP, "critical");
4686+
*this, CriticalRegionBodyStmt, AllocIP, CodeGenIP, "critical");
46804687
return llvm::Error::success();
46814688
};
46824689

@@ -5643,8 +5650,8 @@ void CodeGenFunction::EmitOMPTaskgroupDirective(
56435650
InsertPointTy AllocaIP(AllocaInsertPt->getParent(),
56445651
AllocaInsertPt->getIterator());
56455652

5646-
auto BodyGenCB = [&, this](InsertPointTy AllocaIP,
5647-
InsertPointTy CodeGenIP) {
5653+
auto BodyGenCB = [&, this](InsertPointTy AllocIP, InsertPointTy CodeGenIP,
5654+
ArrayRef<InsertPointTy> DeallocIPs) {
56485655
Builder.restoreIP(CodeGenIP);
56495656
EmitStmt(S.getInnermostCapturedStmt()->getCapturedStmt());
56505657
return llvm::Error::success();
@@ -5653,7 +5660,8 @@ void CodeGenFunction::EmitOMPTaskgroupDirective(
56535660
if (!CapturedStmtInfo)
56545661
CapturedStmtInfo = &CapStmtInfo;
56555662
llvm::OpenMPIRBuilder::InsertPointTy AfterIP =
5656-
cantFail(OMPBuilder.createTaskgroup(Builder, AllocaIP, BodyGenCB));
5663+
cantFail(OMPBuilder.createTaskgroup(Builder, AllocaIP,
5664+
/*DeallocIPs=*/{}, BodyGenCB));
56575665
Builder.restoreIP(AfterIP);
56585666
return;
56595667
}
@@ -6233,8 +6241,9 @@ void CodeGenFunction::EmitOMPOrderedDirective(const OMPOrderedDirective &S) {
62336241
return llvm::Error::success();
62346242
};
62356243

6236-
auto BodyGenCB = [&S, C, this](InsertPointTy AllocaIP,
6237-
InsertPointTy CodeGenIP) {
6244+
auto BodyGenCB = [&S, C, this](InsertPointTy AllocIP,
6245+
InsertPointTy CodeGenIP,
6246+
ArrayRef<InsertPointTy> DeallocIPs) {
62386247
Builder.restoreIP(CodeGenIP);
62396248

62406249
const CapturedStmt *CS = S.getInnermostCapturedStmt();
@@ -6251,7 +6260,7 @@ void CodeGenFunction::EmitOMPOrderedDirective(const OMPOrderedDirective &S) {
62516260
OutlinedFn, CapturedVars);
62526261
} else {
62536262
OMPBuilderCBHelpers::EmitOMPInlinedRegionBody(
6254-
*this, CS->getCapturedStmt(), AllocaIP, CodeGenIP, "ordered");
6263+
*this, CS->getCapturedStmt(), AllocIP, CodeGenIP, "ordered");
62556264
}
62566265
return llvm::Error::success();
62576266
};

llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h

Lines changed: 59 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -612,17 +612,19 @@ class OpenMPIRBuilder {
612612
/// such InsertPoints need to be preserved, it can split the block itself
613613
/// before calling the callback.
614614
///
615-
/// AllocaIP and CodeGenIP must not point to the same position.
616-
///
617-
/// \param AllocaIP is the insertion point at which new alloca instructions
618-
/// should be placed. The BasicBlock it is pointing to must
619-
/// not be split.
620-
/// \param CodeGenIP is the insertion point at which the body code should be
621-
/// placed.
622-
///
615+
/// AllocIP and CodeGenIP must not point to the same position.
616+
///
617+
/// \param AllocIP is the insertion point at which new allocations should
618+
/// be placed. The BasicBlock it is pointing to must not be
619+
/// split.
620+
/// \param CodeGenIP is the insertion point at which the body code should be
621+
/// placed.
622+
/// \param DeallocIPs is the list of insertion points where explicit
623+
/// deallocations, if needed, should be placed.
623624
/// \return an error, if any were triggered during execution.
624625
using BodyGenCallbackTy =
625-
function_ref<Error(InsertPointTy AllocaIP, InsertPointTy CodeGenIP)>;
626+
function_ref<Error(InsertPointTy AllocIP, InsertPointTy CodeGenIP,
627+
ArrayRef<InsertPointTy> DeallocIPs)>;
626628

627629
// This is created primarily for sections construct as llvm::function_ref
628630
// (BodyGenCallbackTy) is not storable (as described in the comments of
@@ -631,7 +633,8 @@ class OpenMPIRBuilder {
631633
///
632634
/// \return an error, if any were triggered during execution.
633635
using StorableBodyGenCallbackTy =
634-
std::function<Error(InsertPointTy AllocaIP, InsertPointTy CodeGenIP)>;
636+
std::function<Error(InsertPointTy AllocIP, InsertPointTy CodeGenIP,
637+
ArrayRef<InsertPointTy> DeallocIPs)>;
635638

636639
/// Callback type for loop body code generation.
637640
///
@@ -725,7 +728,9 @@ class OpenMPIRBuilder {
725728
/// Generator for '#omp parallel'
726729
///
727730
/// \param Loc The insert and source location description.
728-
/// \param AllocaIP The insertion points to be used for alloca instructions.
731+
/// \param AllocIP The insertion point to be used for allocations.
732+
/// \param DeallocIPs The insertion points to be used for explicit
733+
/// deallocations, if needed.
729734
/// \param BodyGenCB Callback that will generate the region code.
730735
/// \param PrivCB Callback to copy a given variable (think copy constructor).
731736
/// \param FiniCB Callback to finalize variable copies.
@@ -736,10 +741,10 @@ class OpenMPIRBuilder {
736741
///
737742
/// \returns The insertion position *after* the parallel.
738743
LLVM_ABI InsertPointOrErrorTy createParallel(
739-
const LocationDescription &Loc, InsertPointTy AllocaIP,
740-
BodyGenCallbackTy BodyGenCB, PrivatizeCallbackTy PrivCB,
741-
FinalizeCallbackTy FiniCB, Value *IfCondition, Value *NumThreads,
742-
omp::ProcBindKind ProcBind, bool IsCancellable);
744+
const LocationDescription &Loc, InsertPointTy AllocIP,
745+
ArrayRef<InsertPointTy> DeallocIPs, BodyGenCallbackTy BodyGenCB,
746+
PrivatizeCallbackTy PrivCB, FinalizeCallbackTy FiniCB, Value *IfCondition,
747+
Value *NumThreads, omp::ProcBindKind ProcBind, bool IsCancellable);
743748

744749
/// Generator for the control flow structure of an OpenMP canonical loop.
745750
///
@@ -1363,7 +1368,9 @@ class OpenMPIRBuilder {
13631368
/// Generator for `#omp task`
13641369
///
13651370
/// \param Loc The location where the task construct was encountered.
1366-
/// \param AllocaIP The insertion point to be used for alloca instructions.
1371+
/// \param AllocIP The insertion point to be used for allocations.
1372+
/// \param DeallocIPs The insertion points to be used for explicit
1373+
/// deallocations, if needed.
13671374
/// \param BodyGenCB Callback that will generate the region code.
13681375
/// \param Tied True if the task is tied, false if the task is untied.
13691376
/// \param Final i1 value which is `true` if the task is final, `false` if the
@@ -1379,21 +1386,23 @@ class OpenMPIRBuilder {
13791386
/// \param Mergeable If the given task is `mergeable`
13801387
/// \param priority `priority-value' specifies the execution order of the
13811388
/// tasks that is generated by the construct
1382-
LLVM_ABI InsertPointOrErrorTy
1383-
createTask(const LocationDescription &Loc, InsertPointTy AllocaIP,
1384-
BodyGenCallbackTy BodyGenCB, bool Tied = true,
1385-
Value *Final = nullptr, Value *IfCondition = nullptr,
1386-
SmallVector<DependData> Dependencies = {}, bool Mergeable = false,
1387-
Value *EventHandle = nullptr, Value *Priority = nullptr);
1389+
LLVM_ABI InsertPointOrErrorTy createTask(
1390+
const LocationDescription &Loc, InsertPointTy AllocIP,
1391+
ArrayRef<InsertPointTy> DeallocIPs, BodyGenCallbackTy BodyGenCB,
1392+
bool Tied = true, Value *Final = nullptr, Value *IfCondition = nullptr,
1393+
SmallVector<DependData> Dependencies = {}, bool Mergeable = false,
1394+
Value *EventHandle = nullptr, Value *Priority = nullptr);
13881395

13891396
/// Generator for the taskgroup construct
13901397
///
13911398
/// \param Loc The location where the taskgroup construct was encountered.
1392-
/// \param AllocaIP The insertion point to be used for alloca instructions.
1399+
/// \param AllocIP The insertion point to be used for allocations.
1400+
/// \param DeallocIPs The insertion point to be used for explicit deallocation
1401+
/// instructions, if needed.
13931402
/// \param BodyGenCB Callback that will generate the region code.
1394-
LLVM_ABI InsertPointOrErrorTy createTaskgroup(const LocationDescription &Loc,
1395-
InsertPointTy AllocaIP,
1396-
BodyGenCallbackTy BodyGenCB);
1403+
LLVM_ABI InsertPointOrErrorTy createTaskgroup(
1404+
const LocationDescription &Loc, InsertPointTy AllocIP,
1405+
ArrayRef<InsertPointTy> DeallocIPs, BodyGenCallbackTy BodyGenCB);
13971406

13981407
using FileIdentifierInfoCallbackTy =
13991408
std::function<std::tuple<std::string, uint64_t>()>;
@@ -2262,7 +2271,8 @@ class OpenMPIRBuilder {
22622271
struct OutlineInfo {
22632272
using PostOutlineCBTy = std::function<void(Function &)>;
22642273
PostOutlineCBTy PostOutlineCB;
2265-
BasicBlock *EntryBB, *ExitBB, *OuterAllocaBB;
2274+
BasicBlock *EntryBB, *ExitBB, *OuterAllocBB;
2275+
SmallVector<BasicBlock *> OuterDeallocBBs;
22662276
SmallVector<Value *, 2> ExcludeArgsFromAggregate;
22672277

22682278
LLVM_ABI virtual ~OutlineInfo() = default;
@@ -2335,7 +2345,8 @@ class OpenMPIRBuilder {
23352345
/// \return an error, if any were triggered during execution.
23362346
LLVM_ABI Error emitIfClause(Value *Cond, BodyGenCallbackTy ThenGen,
23372347
BodyGenCallbackTy ElseGen,
2338-
InsertPointTy AllocaIP = {});
2348+
InsertPointTy AllocIP = {},
2349+
ArrayRef<InsertPointTy> DeallocIPs = {});
23392350

23402351
/// Create the global variable holding the offload mappings information.
23412352
LLVM_ABI GlobalVariable *
@@ -2891,11 +2902,13 @@ class OpenMPIRBuilder {
28912902
/// Generator for `#omp distribute`
28922903
///
28932904
/// \param Loc The location where the distribute construct was encountered.
2894-
/// \param AllocaIP The insertion points to be used for alloca instructions.
2905+
/// \param AllocIP The insertion point to be used for allocations.
2906+
/// \param DeallocIPs The insertion points to be used for explicit
2907+
/// deallocations, if needed.
28952908
/// \param BodyGenCB Callback that will generate the region code.
2896-
LLVM_ABI InsertPointOrErrorTy createDistribute(const LocationDescription &Loc,
2897-
InsertPointTy AllocaIP,
2898-
BodyGenCallbackTy BodyGenCB);
2909+
LLVM_ABI InsertPointOrErrorTy createDistribute(
2910+
const LocationDescription &Loc, InsertPointTy AllocIP,
2911+
ArrayRef<InsertPointTy> DeallocIPs, BodyGenCallbackTy BodyGenCB);
28992912

29002913
/// Generate conditional branch and relevant BasicBlocks through which private
29012914
/// threads copy the 'copyin' variables from Master copy to threadprivate
@@ -3223,9 +3236,11 @@ class OpenMPIRBuilder {
32233236
/// Generator for '#omp target data'
32243237
///
32253238
/// \param Loc The location where the target data construct was encountered.
3226-
/// \param AllocaIP The insertion points to be used for alloca instructions.
3239+
/// \param AllocIP The insertion points to be used for allocations.
32273240
/// \param CodeGenIP The insertion point at which the target directive code
32283241
/// should be placed.
3242+
/// \param DeallocIPs The insertion points at which explicit deallocations
3243+
/// should be placed, if needed.
32293244
/// \param IsBegin If true then emits begin mapper call otherwise emits
32303245
/// end mapper call.
32313246
/// \param DeviceID Stores the DeviceID from the device clause.
@@ -3238,10 +3253,10 @@ class OpenMPIRBuilder {
32383253
/// \param DeviceAddrCB Optional callback to generate code related to
32393254
/// use_device_ptr and use_device_addr.
32403255
LLVM_ABI InsertPointOrErrorTy createTargetData(
3241-
const LocationDescription &Loc, InsertPointTy AllocaIP,
3242-
InsertPointTy CodeGenIP, Value *DeviceID, Value *IfCond,
3243-
TargetDataInfo &Info, GenMapInfoCallbackTy GenMapInfoCB,
3244-
CustomMapperCallbackTy CustomMapperCB,
3256+
const LocationDescription &Loc, InsertPointTy AllocIP,
3257+
InsertPointTy CodeGenIP, ArrayRef<InsertPointTy> DeallocIPs,
3258+
Value *DeviceID, Value *IfCond, TargetDataInfo &Info,
3259+
GenMapInfoCallbackTy GenMapInfoCB, CustomMapperCallbackTy CustomMapperCB,
32453260
omp::RuntimeFunction *MapperFunc = nullptr,
32463261
function_ref<InsertPointOrErrorTy(InsertPointTy CodeGenIP,
32473262
BodyGenTy BodyGenType)>
@@ -3250,7 +3265,8 @@ class OpenMPIRBuilder {
32503265
Value *SrcLocInfo = nullptr);
32513266

32523267
using TargetBodyGenCallbackTy = function_ref<InsertPointOrErrorTy(
3253-
InsertPointTy AllocaIP, InsertPointTy CodeGenIP)>;
3268+
InsertPointTy AllocIP, InsertPointTy CodeGenIP,
3269+
ArrayRef<InsertPointTy> DeallocIPs)>;
32543270

32553271
using TargetGenArgAccessorsCallbackTy = function_ref<InsertPointOrErrorTy(
32563272
Argument &Arg, Value *Input, Value *&RetVal, InsertPointTy AllocaIP,
@@ -3262,6 +3278,8 @@ class OpenMPIRBuilder {
32623278
/// \param IsOffloadEntry whether it is an offload entry.
32633279
/// \param CodeGenIP The insertion point where the call to the outlined
32643280
/// function should be emitted.
3281+
/// \param DeallocIPs The insertion points at which explicit deallocations
3282+
/// should be placed, if needed.
32653283
/// \param Info Stores all information realted to the Target directive.
32663284
/// \param EntryInfo The entry information about the function.
32673285
/// \param DefaultAttrs Structure containing the default attributes, including
@@ -3282,8 +3300,9 @@ class OpenMPIRBuilder {
32823300
/// not.
32833301
LLVM_ABI InsertPointOrErrorTy createTarget(
32843302
const LocationDescription &Loc, bool IsOffloadEntry,
3285-
OpenMPIRBuilder::InsertPointTy AllocaIP,
3286-
OpenMPIRBuilder::InsertPointTy CodeGenIP, TargetDataInfo &Info,
3303+
OpenMPIRBuilder::InsertPointTy AllocIP,
3304+
OpenMPIRBuilder::InsertPointTy CodeGenIP,
3305+
ArrayRef<InsertPointTy> DeallocIPs, TargetDataInfo &Info,
32873306
TargetRegionEntryInfo &EntryInfo,
32883307
const TargetKernelDefaultAttrs &DefaultAttrs,
32893308
const TargetKernelRuntimeAttrs &RuntimeAttrs, Value *IfCond,

0 commit comments

Comments
 (0)