Skip to content

Commit 3765bce

Browse files
committed
[OpenMP] Fix OpenMPIRBuilder generating incorrect duplicate SrcLocInfo
1 parent 48e1eb4 commit 3765bce

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3426,11 +3426,6 @@ OpenMPIRBuilder::InsertPointTy OpenMPIRBuilder::createReductionsGPU(
34263426
else
34273427
Config.setGridValue(getGridValue(T, ReductionFunc));
34283428

3429-
uint32_t SrcLocStrSize;
3430-
Constant *SrcLocStr = getOrCreateDefaultSrcLocStr(SrcLocStrSize);
3431-
Value *RTLoc =
3432-
getOrCreateIdent(SrcLocStr, SrcLocStrSize, omp::IdentFlag(0), 0);
3433-
34343429
// Build res = __kmpc_reduce{_nowait}(<gtid>, <n>, sizeof(RedList),
34353430
// RedList, shuffle_reduce_func, interwarp_copy_func);
34363431
// or
@@ -3483,7 +3478,7 @@ OpenMPIRBuilder::InsertPointTy OpenMPIRBuilder::createReductionsGPU(
34833478
Builder.CreatePointerBitCastOrAddrSpaceCast(SarFunc, PtrTy);
34843479
Value *WcFuncCast =
34853480
Builder.CreatePointerBitCastOrAddrSpaceCast(WcFunc, PtrTy);
3486-
Value *Args[] = {RTLoc, ReductionDataSize, RL, SarFuncCast, WcFuncCast};
3481+
Value *Args[] = {SrcLocInfo, ReductionDataSize, RL, SarFuncCast, WcFuncCast};
34873482
Function *Pv2Ptr = getOrCreateRuntimeFunctionPtr(
34883483
RuntimeFunction::OMPRTL___kmpc_nvptx_parallel_reduce_nowait_v2);
34893484
Res = Builder.CreateCall(Pv2Ptr, Args);
@@ -3506,7 +3501,7 @@ OpenMPIRBuilder::InsertPointTy OpenMPIRBuilder::createReductionsGPU(
35063501
Value *KernelTeamsReductionPtr = Builder.CreateCall(
35073502
RedFixedBuferFn, {}, "_openmp_teams_reductions_buffer_$_$ptr");
35083503

3509-
Value *Args3[] = {RTLoc,
3504+
Value *Args3[] = {SrcLocInfo,
35103505
KernelTeamsReductionPtr,
35113506
Builder.getInt32(ReductionBufNum),
35123507
ReductionDataSize,

0 commit comments

Comments
 (0)