Skip to content

Commit e9bfa1d

Browse files
committed
[OPENMP]Use new interface for task reduction.
Summary: Patch forces codegen to use the new runtime functions for task reductions where the issue with passing the address of the original variables to the UDR initializers is fixed. Also, this patch is required for upcoming support of task modifier inreduction clause. Reviewers: jdoerfert Subscribers: yaxunl, guansong, cfe-commits, caomhin Tags: #clang Differential Revision: https://reviews.llvm.org/D78733
1 parent 2f8b164 commit e9bfa1d

15 files changed

+452
-371
lines changed

clang/lib/CodeGen/CGOpenMPRuntime.cpp

Lines changed: 55 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -705,9 +705,8 @@ enum OpenMPRTLFunction {
705705
// Call to void __kmpc_doacross_wait(ident_t *loc, kmp_int32 gtid, kmp_int64
706706
// *vec);
707707
OMPRTL__kmpc_doacross_wait,
708-
// Call to void *__kmpc_task_reduction_init(int gtid, int num_data, void
709-
// *data);
710-
OMPRTL__kmpc_task_reduction_init,
708+
// Call to void *__kmpc_taskred_init(int gtid, int num_data, void *data);
709+
OMPRTL__kmpc_taskred_init,
711710
// Call to void *__kmpc_task_reduction_get_th_data(int gtid, void *tg, void
712711
// *d);
713712
OMPRTL__kmpc_task_reduction_get_th_data,
@@ -981,27 +980,37 @@ void ReductionCodeGen::emitAggregateInitialization(
981980
}
982981

983982
ReductionCodeGen::ReductionCodeGen(ArrayRef<const Expr *> Shareds,
983+
ArrayRef<const Expr *> Origs,
984984
ArrayRef<const Expr *> Privates,
985985
ArrayRef<const Expr *> ReductionOps) {
986986
ClausesData.reserve(Shareds.size());
987987
SharedAddresses.reserve(Shareds.size());
988988
Sizes.reserve(Shareds.size());
989989
BaseDecls.reserve(Shareds.size());
990-
auto IPriv = Privates.begin();
991-
auto IRed = ReductionOps.begin();
990+
const auto *IOrig = Origs.begin();
991+
const auto *IPriv = Privates.begin();
992+
const auto *IRed = ReductionOps.begin();
992993
for (const Expr *Ref : Shareds) {
993-
ClausesData.emplace_back(Ref, *IPriv, *IRed);
994+
ClausesData.emplace_back(Ref, *IOrig, *IPriv, *IRed);
995+
std::advance(IOrig, 1);
994996
std::advance(IPriv, 1);
995997
std::advance(IRed, 1);
996998
}
997999
}
9981000

999-
void ReductionCodeGen::emitSharedLValue(CodeGenFunction &CGF, unsigned N) {
1000-
assert(SharedAddresses.size() == N &&
1001+
void ReductionCodeGen::emitSharedOrigLValue(CodeGenFunction &CGF, unsigned N) {
1002+
assert(SharedAddresses.size() == N && OrigAddresses.size() == N &&
10011003
"Number of generated lvalues must be exactly N.");
1002-
LValue First = emitSharedLValue(CGF, ClausesData[N].Ref);
1003-
LValue Second = emitSharedLValueUB(CGF, ClausesData[N].Ref);
1004+
LValue First = emitSharedLValue(CGF, ClausesData[N].Shared);
1005+
LValue Second = emitSharedLValueUB(CGF, ClausesData[N].Shared);
10041006
SharedAddresses.emplace_back(First, Second);
1007+
if (ClausesData[N].Shared == ClausesData[N].Ref) {
1008+
OrigAddresses.emplace_back(First, Second);
1009+
} else {
1010+
LValue First = emitSharedLValue(CGF, ClausesData[N].Ref);
1011+
LValue Second = emitSharedLValueUB(CGF, ClausesData[N].Ref);
1012+
OrigAddresses.emplace_back(First, Second);
1013+
}
10051014
}
10061015

10071016
void ReductionCodeGen::emitAggregateType(CodeGenFunction &CGF, unsigned N) {
@@ -2318,14 +2327,12 @@ llvm::FunctionCallee CGOpenMPRuntime::createRuntimeFunction(unsigned Function) {
23182327
RTLFn = CGM.CreateRuntimeFunction(FnTy, /*Name=*/"__kmpc_doacross_wait");
23192328
break;
23202329
}
2321-
case OMPRTL__kmpc_task_reduction_init: {
2322-
// Build void *__kmpc_task_reduction_init(int gtid, int num_data, void
2323-
// *data);
2330+
case OMPRTL__kmpc_taskred_init: {
2331+
// Build void *__kmpc_taskred_init(int gtid, int num_data, void *data);
23242332
llvm::Type *TypeParams[] = {CGM.IntTy, CGM.IntTy, CGM.VoidPtrTy};
23252333
auto *FnTy =
23262334
llvm::FunctionType::get(CGM.VoidPtrTy, TypeParams, /*isVarArg=*/false);
2327-
RTLFn =
2328-
CGM.CreateRuntimeFunction(FnTy, /*Name=*/"__kmpc_task_reduction_init");
2335+
RTLFn = CGM.CreateRuntimeFunction(FnTy, /*Name=*/"__kmpc_taskred_init");
23292336
break;
23302337
}
23312338
case OMPRTL__kmpc_task_reduction_get_th_data: {
@@ -6546,7 +6553,7 @@ static std::string generateUniqueName(CodeGenModule &CGM, StringRef Prefix,
65466553

65476554
/// Emits reduction initializer function:
65486555
/// \code
6549-
/// void @.red_init(void* %arg) {
6556+
/// void @.red_init(void* %arg, void* %orig) {
65506557
/// %0 = bitcast void* %arg to <type>*
65516558
/// store <type> <init>, <type>* %0
65526559
/// ret void
@@ -6556,10 +6563,15 @@ static llvm::Value *emitReduceInitFunction(CodeGenModule &CGM,
65566563
SourceLocation Loc,
65576564
ReductionCodeGen &RCG, unsigned N) {
65586565
ASTContext &C = CGM.getContext();
6566+
QualType VoidPtrTy = C.VoidPtrTy;
6567+
VoidPtrTy.addRestrict();
65596568
FunctionArgList Args;
6560-
ImplicitParamDecl Param(C, /*DC=*/nullptr, Loc, /*Id=*/nullptr, C.VoidPtrTy,
6569+
ImplicitParamDecl Param(C, /*DC=*/nullptr, Loc, /*Id=*/nullptr, VoidPtrTy,
65616570
ImplicitParamDecl::Other);
6571+
ImplicitParamDecl ParamOrig(C, /*DC=*/nullptr, Loc, /*Id=*/nullptr, VoidPtrTy,
6572+
ImplicitParamDecl::Other);
65626573
Args.emplace_back(&Param);
6574+
Args.emplace_back(&ParamOrig);
65636575
const auto &FnInfo =
65646576
CGM.getTypes().arrangeBuiltinFunctionDeclaration(C.VoidTy, Args);
65656577
llvm::FunctionType *FnTy = CGM.getTypes().GetFunctionType(FnInfo);
@@ -6584,28 +6596,25 @@ static llvm::Value *emitReduceInitFunction(CodeGenModule &CGM,
65846596
CGM.getContext().getSizeType(), Loc);
65856597
}
65866598
RCG.emitAggregateType(CGF, N, Size);
6587-
LValue SharedLVal;
6599+
LValue OrigLVal;
65886600
// If initializer uses initializer from declare reduction construct, emit a
65896601
// pointer to the address of the original reduction item (reuired by reduction
65906602
// initializer)
65916603
if (RCG.usesReductionInitializer(N)) {
6592-
Address SharedAddr =
6593-
CGM.getOpenMPRuntime().getAddrOfArtificialThreadPrivate(
6594-
CGF, CGM.getContext().VoidPtrTy,
6595-
generateUniqueName(CGM, "reduction", RCG.getRefExpr(N)));
6604+
Address SharedAddr = CGF.GetAddrOfLocalVar(&ParamOrig);
65966605
SharedAddr = CGF.EmitLoadOfPointer(
65976606
SharedAddr,
65986607
CGM.getContext().VoidPtrTy.castAs<PointerType>()->getTypePtr());
6599-
SharedLVal = CGF.MakeAddrLValue(SharedAddr, CGM.getContext().VoidPtrTy);
6608+
OrigLVal = CGF.MakeAddrLValue(SharedAddr, CGM.getContext().VoidPtrTy);
66006609
} else {
6601-
SharedLVal = CGF.MakeNaturalAlignAddrLValue(
6610+
OrigLVal = CGF.MakeNaturalAlignAddrLValue(
66026611
llvm::ConstantPointerNull::get(CGM.VoidPtrTy),
66036612
CGM.getContext().VoidPtrTy);
66046613
}
66056614
// Emit the initializer:
66066615
// %0 = bitcast void* %arg to <type>*
66076616
// store <type> <init>, <type>* %0
6608-
RCG.emitInitialization(CGF, N, PrivateAddr, SharedLVal,
6617+
RCG.emitInitialization(CGF, N, PrivateAddr, OrigLVal,
66096618
[](CodeGenFunction &) { return false; });
66106619
CGF.FinishFunction();
66116620
return Fn;
@@ -6745,18 +6754,20 @@ llvm::Value *CGOpenMPRuntime::emitTaskReductionInit(
67456754
return nullptr;
67466755

67476756
// Build typedef struct:
6748-
// kmp_task_red_input {
6757+
// kmp_taskred_input {
67496758
// void *reduce_shar; // shared reduction item
6759+
// void *reduce_orig; // original reduction item used for initialization
67506760
// size_t reduce_size; // size of data item
67516761
// void *reduce_init; // data initialization routine
67526762
// void *reduce_fini; // data finalization routine
67536763
// void *reduce_comb; // data combiner routine
67546764
// kmp_task_red_flags_t flags; // flags for additional info from compiler
6755-
// } kmp_task_red_input_t;
6765+
// } kmp_taskred_input_t;
67566766
ASTContext &C = CGM.getContext();
6757-
RecordDecl *RD = C.buildImplicitRecord("kmp_task_red_input_t");
6767+
RecordDecl *RD = C.buildImplicitRecord("kmp_taskred_input_t");
67586768
RD->startDefinition();
67596769
const FieldDecl *SharedFD = addFieldToRecordDecl(C, RD, C.VoidPtrTy);
6770+
const FieldDecl *OrigFD = addFieldToRecordDecl(C, RD, C.VoidPtrTy);
67606771
const FieldDecl *SizeFD = addFieldToRecordDecl(C, RD, C.getSizeType());
67616772
const FieldDecl *InitFD = addFieldToRecordDecl(C, RD, C.VoidPtrTy);
67626773
const FieldDecl *FiniFD = addFieldToRecordDecl(C, RD, C.VoidPtrTy);
@@ -6771,8 +6782,8 @@ llvm::Value *CGOpenMPRuntime::emitTaskReductionInit(
67716782
RDType, ArraySize, nullptr, ArrayType::Normal, /*IndexTypeQuals=*/0);
67726783
// kmp_task_red_input_t .rd_input.[Size];
67736784
Address TaskRedInput = CGF.CreateMemTemp(ArrayRDType, ".rd_input.");
6774-
ReductionCodeGen RCG(Data.ReductionVars, Data.ReductionCopies,
6775-
Data.ReductionOps);
6785+
ReductionCodeGen RCG(Data.ReductionVars, Data.ReductionVars,
6786+
Data.ReductionCopies, Data.ReductionOps);
67766787
for (unsigned Cnt = 0; Cnt < Size; ++Cnt) {
67776788
// kmp_task_red_input_t &ElemLVal = .rd_input.[Cnt];
67786789
llvm::Value *Idxs[] = {llvm::ConstantInt::get(CGM.SizeTy, /*V=*/0),
@@ -6784,20 +6795,24 @@ llvm::Value *CGOpenMPRuntime::emitTaskReductionInit(
67846795
LValue ElemLVal = CGF.MakeNaturalAlignAddrLValue(GEP, RDType);
67856796
// ElemLVal.reduce_shar = &Shareds[Cnt];
67866797
LValue SharedLVal = CGF.EmitLValueForField(ElemLVal, SharedFD);
6787-
RCG.emitSharedLValue(CGF, Cnt);
6798+
RCG.emitSharedOrigLValue(CGF, Cnt);
67886799
llvm::Value *CastedShared =
67896800
CGF.EmitCastToVoidPtr(RCG.getSharedLValue(Cnt).getPointer(CGF));
67906801
CGF.EmitStoreOfScalar(CastedShared, SharedLVal);
6802+
// ElemLVal.reduce_orig = &Origs[Cnt];
6803+
LValue OrigLVal = CGF.EmitLValueForField(ElemLVal, OrigFD);
6804+
llvm::Value *CastedOrig =
6805+
CGF.EmitCastToVoidPtr(RCG.getOrigLValue(Cnt).getPointer(CGF));
6806+
CGF.EmitStoreOfScalar(CastedOrig, OrigLVal);
67916807
RCG.emitAggregateType(CGF, Cnt);
67926808
llvm::Value *SizeValInChars;
67936809
llvm::Value *SizeVal;
67946810
std::tie(SizeValInChars, SizeVal) = RCG.getSizes(Cnt);
6795-
// We use delayed creation/initialization for VLAs, array sections and
6796-
// custom reduction initializations. It is required because runtime does not
6797-
// provide the way to pass the sizes of VLAs/array sections to
6798-
// initializer/combiner/finalizer functions and does not pass the pointer to
6799-
// original reduction item to the initializer. Instead threadprivate global
6800-
// variables are used to store these values and use them in the functions.
6811+
// We use delayed creation/initialization for VLAs and array sections. It is
6812+
// required because runtime does not provide the way to pass the sizes of
6813+
// VLAs/array sections to initializer/combiner/finalizer functions. Instead
6814+
// threadprivate global variables are used to store these values and use
6815+
// them in the functions.
68016816
bool DelayedCreation = !!SizeVal;
68026817
SizeValInChars = CGF.Builder.CreateIntCast(SizeValInChars, CGM.SizeTy,
68036818
/*isSigned=*/false);
@@ -6808,7 +6823,6 @@ llvm::Value *CGOpenMPRuntime::emitTaskReductionInit(
68086823
llvm::Value *InitAddr =
68096824
CGF.EmitCastToVoidPtr(emitReduceInitFunction(CGM, Loc, RCG, Cnt));
68106825
CGF.EmitStoreOfScalar(InitAddr, InitLVal);
6811-
DelayedCreation = DelayedCreation || RCG.usesReductionInitializer(Cnt);
68126826
// ElemLVal.reduce_fini = fini;
68136827
LValue FiniLVal = CGF.EmitLValueForField(ElemLVal, FiniFD);
68146828
llvm::Value *Fini = emitReduceFiniFunction(CGM, Loc, RCG, Cnt);
@@ -6832,16 +6846,15 @@ llvm::Value *CGOpenMPRuntime::emitTaskReductionInit(
68326846
CGF.EmitNullInitialization(FlagsLVal.getAddress(CGF),
68336847
FlagsLVal.getType());
68346848
}
6835-
// Build call void *__kmpc_task_reduction_init(int gtid, int num_data, void
6836-
// *data);
6849+
// Build call void *__kmpc_taskred_init(int gtid, int num_data, void *data);
68376850
llvm::Value *Args[] = {
68386851
CGF.Builder.CreateIntCast(getThreadID(CGF, Loc), CGM.IntTy,
68396852
/*isSigned=*/true),
68406853
llvm::ConstantInt::get(CGM.IntTy, Size, /*isSigned=*/true),
68416854
CGF.Builder.CreatePointerBitCastOrAddrSpaceCast(TaskRedInput.getPointer(),
68426855
CGM.VoidPtrTy)};
6843-
return CGF.EmitRuntimeCall(
6844-
createRuntimeFunction(OMPRTL__kmpc_task_reduction_init), Args);
6856+
return CGF.EmitRuntimeCall(createRuntimeFunction(OMPRTL__kmpc_taskred_init),
6857+
Args);
68456858
}
68466859

68476860
void CGOpenMPRuntime::emitTaskReductionFixups(CodeGenFunction &CGF,
@@ -6859,16 +6872,6 @@ void CGOpenMPRuntime::emitTaskReductionFixups(CodeGenFunction &CGF,
68596872
generateUniqueName(CGM, "reduction_size", RCG.getRefExpr(N)));
68606873
CGF.Builder.CreateStore(SizeVal, SizeAddr, /*IsVolatile=*/false);
68616874
}
6862-
// Store address of the original reduction item if custom initializer is used.
6863-
if (RCG.usesReductionInitializer(N)) {
6864-
Address SharedAddr = getAddrOfArtificialThreadPrivate(
6865-
CGF, CGM.getContext().VoidPtrTy,
6866-
generateUniqueName(CGM, "reduction", RCG.getRefExpr(N)));
6867-
CGF.Builder.CreateStore(
6868-
CGF.Builder.CreatePointerBitCastOrAddrSpaceCast(
6869-
RCG.getSharedLValue(N).getPointer(CGF), CGM.VoidPtrTy),
6870-
SharedAddr, /*IsVolatile=*/false);
6871-
}
68726875
}
68736876

68746877
Address CGOpenMPRuntime::getTaskReductionItem(CodeGenFunction &CGF,

clang/lib/CodeGen/CGOpenMPRuntime.h

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -125,20 +125,26 @@ class ReductionCodeGen {
125125
private:
126126
/// Data required for codegen of reduction clauses.
127127
struct ReductionData {
128-
/// Reference to the original shared item.
128+
/// Reference to the item shared between tasks to reduce into.
129+
const Expr *Shared = nullptr;
130+
/// Reference to the original item.
129131
const Expr *Ref = nullptr;
130132
/// Helper expression for generation of private copy.
131133
const Expr *Private = nullptr;
132134
/// Helper expression for generation reduction operation.
133135
const Expr *ReductionOp = nullptr;
134-
ReductionData(const Expr *Ref, const Expr *Private, const Expr *ReductionOp)
135-
: Ref(Ref), Private(Private), ReductionOp(ReductionOp) {}
136+
ReductionData(const Expr *Shared, const Expr *Ref, const Expr *Private,
137+
const Expr *ReductionOp)
138+
: Shared(Shared), Ref(Ref), Private(Private), ReductionOp(ReductionOp) {
139+
}
136140
};
137141
/// List of reduction-based clauses.
138142
SmallVector<ReductionData, 4> ClausesData;
139143

140-
/// List of addresses of original shared variables/expressions.
144+
/// List of addresses of shared variables/expressions.
141145
SmallVector<std::pair<LValue, LValue>, 4> SharedAddresses;
146+
/// List of addresses of original variables/expressions.
147+
SmallVector<std::pair<LValue, LValue>, 4> OrigAddresses;
142148
/// Sizes of the reduction items in chars.
143149
SmallVector<std::pair<llvm::Value *, llvm::Value *>, 4> Sizes;
144150
/// Base declarations for the reduction items.
@@ -158,12 +164,12 @@ class ReductionCodeGen {
158164
const OMPDeclareReductionDecl *DRD);
159165

160166
public:
161-
ReductionCodeGen(ArrayRef<const Expr *> Shareds,
167+
ReductionCodeGen(ArrayRef<const Expr *> Shareds, ArrayRef<const Expr *> Origs,
162168
ArrayRef<const Expr *> Privates,
163169
ArrayRef<const Expr *> ReductionOps);
164-
/// Emits lvalue for a reduction item.
170+
/// Emits lvalue for the shared and original reduction item.
165171
/// \param N Number of the reduction item.
166-
void emitSharedLValue(CodeGenFunction &CGF, unsigned N);
172+
void emitSharedOrigLValue(CodeGenFunction &CGF, unsigned N);
167173
/// Emits the code for the variable-modified type, if required.
168174
/// \param N Number of the reduction item.
169175
void emitAggregateType(CodeGenFunction &CGF, unsigned N);
@@ -195,6 +201,8 @@ class ReductionCodeGen {
195201
Address PrivateAddr);
196202
/// Returns LValue for the reduction item.
197203
LValue getSharedLValue(unsigned N) const { return SharedAddresses[N].first; }
204+
/// Returns LValue for the original reduction item.
205+
LValue getOrigLValue(unsigned N) const { return OrigAddresses[N].first; }
198206
/// Returns the size of the reduction item (in chars and total number of
199207
/// elements in the item), or nullptr, if the size is a constant.
200208
std::pair<llvm::Value *, llvm::Value *> getSizes(unsigned N) const {
@@ -1434,9 +1442,7 @@ class CGOpenMPRuntime {
14341442

14351443
/// Required to resolve existing problems in the runtime. Emits threadprivate
14361444
/// variables to store the size of the VLAs/array sections for
1437-
/// initializer/combiner/finalizer functions + emits threadprivate variable to
1438-
/// store the pointer to the original reduction item for the custom
1439-
/// initializer defined by declare reduction construct.
1445+
/// initializer/combiner/finalizer functions.
14401446
/// \param RCG Allows to reuse an existing data for the reductions.
14411447
/// \param N Reduction item for which fixups must be emitted.
14421448
virtual void emitTaskReductionFixups(CodeGenFunction &CGF, SourceLocation Loc,

clang/lib/CodeGen/CGStmtOpenMP.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,15 +1186,15 @@ void CodeGenFunction::EmitOMPReductionClauseInit(
11861186
std::advance(IRHS, 1);
11871187
}
11881188
}
1189-
ReductionCodeGen RedCG(Shareds, Privates, ReductionOps);
1189+
ReductionCodeGen RedCG(Shareds, Shareds, Privates, ReductionOps);
11901190
unsigned Count = 0;
1191-
auto ILHS = LHSs.begin();
1192-
auto IRHS = RHSs.begin();
1193-
auto IPriv = Privates.begin();
1191+
auto *ILHS = LHSs.begin();
1192+
auto *IRHS = RHSs.begin();
1193+
auto *IPriv = Privates.begin();
11941194
for (const Expr *IRef : Shareds) {
11951195
const auto *PrivateVD = cast<VarDecl>(cast<DeclRefExpr>(*IPriv)->getDecl());
11961196
// Emit private VarDecl with reduction init.
1197-
RedCG.emitSharedLValue(*this, Count);
1197+
RedCG.emitSharedOrigLValue(*this, Count);
11981198
RedCG.emitAggregateType(*this, Count);
11991199
AutoVarEmission Emission = EmitAutoVarAlloca(*PrivateVD);
12001200
RedCG.emitInitialization(*this, Count, Emission.getAllocatedAddress(),
@@ -3478,12 +3478,12 @@ void CodeGenFunction::EmitOMPTaskBasedDirective(
34783478
}
34793479
(void)FirstprivateScope.Privatize();
34803480
OMPLexicalScope LexScope(CGF, S, CapturedRegion);
3481-
ReductionCodeGen RedCG(Data.ReductionVars, Data.ReductionCopies,
3482-
Data.ReductionOps);
3481+
ReductionCodeGen RedCG(Data.ReductionVars, Data.ReductionVars,
3482+
Data.ReductionCopies, Data.ReductionOps);
34833483
llvm::Value *ReductionsPtr = CGF.Builder.CreateLoad(
34843484
CGF.GetAddrOfLocalVar(CS->getCapturedDecl()->getParam(9)));
34853485
for (unsigned Cnt = 0, E = Data.ReductionVars.size(); Cnt < E; ++Cnt) {
3486-
RedCG.emitSharedLValue(CGF, Cnt);
3486+
RedCG.emitSharedOrigLValue(CGF, Cnt);
34873487
RedCG.emitAggregateType(CGF, Cnt);
34883488
// FIXME: This must removed once the runtime library is fixed.
34893489
// Emit required threadprivate variables for
@@ -3528,9 +3528,9 @@ void CodeGenFunction::EmitOMPTaskBasedDirective(
35283528
// privatized earlier.
35293529
OMPPrivateScope InRedScope(CGF);
35303530
if (!InRedVars.empty()) {
3531-
ReductionCodeGen RedCG(InRedVars, InRedPrivs, InRedOps);
3531+
ReductionCodeGen RedCG(InRedVars, InRedVars, InRedPrivs, InRedOps);
35323532
for (unsigned Cnt = 0, E = InRedVars.size(); Cnt < E; ++Cnt) {
3533-
RedCG.emitSharedLValue(CGF, Cnt);
3533+
RedCG.emitSharedOrigLValue(CGF, Cnt);
35343534
RedCG.emitAggregateType(CGF, Cnt);
35353535
// The taskgroup descriptor variable is always implicit firstprivate and
35363536
// privatized already during processing of the firstprivates.

clang/test/OpenMP/master_taskloop_in_reduction_codegen.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ int main(int argc, char **argv) {
4040

4141
// CHECK-LABEL: @main
4242
// CHECK: void @__kmpc_taskgroup(%struct.ident_t* @0, i32 [[GTID:%.+]])
43-
// CHECK: [[TD1:%.+]] = call i8* @__kmpc_task_reduction_init(i32 [[GTID]], i32 3, i8* %
43+
// CHECK: [[TD1:%.+]] = call i8* @__kmpc_taskred_init(i32 [[GTID]], i32 3, i8* %
4444
// CHECK-NEXT: store i8* [[TD1]], i8** [[TD1_ADDR:%[^,]+]],
4545
// CHECK-NEXT: call void @__kmpc_taskgroup(%struct.ident_t* @0, i32 [[GTID]])
46-
// CHECK: [[TD2:%.+]] = call i8* @__kmpc_task_reduction_init(i32 [[GTID]], i32 2, i8* %
46+
// CHECK: [[TD2:%.+]] = call i8* @__kmpc_taskred_init(i32 [[GTID]], i32 2, i8* %
4747
// CHECK-NEXT: store i8* [[TD2]], i8** [[TD2_ADDR:%[^,]+]],
4848
// CHECK-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @0, i32 5, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32*, i64, i16*, i8**, i8**)* [[OMP_PARALLEL:@.+]] to void (i32*, i32*, ...)*), i32* %{{.+}}, i64 %{{.+}}, i16* %{{.+}}, i8** [[TD1_ADDR]], i8** [[TD2_ADDR]])
4949
// CHECK-NEXT: call void @__kmpc_end_taskgroup(%struct.ident_t* @0, i32 [[GTID]])

0 commit comments

Comments
 (0)