Skip to content

Commit e777f95

Browse files
committed
Small merge and rebase tweak
- A small upstream funciton change that required a new argument to be added to an invocation we make downstream - lost some emplace and reset calls in the rebase, need to re-add
1 parent 9cb6fa7 commit e777f95

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4682,7 +4682,7 @@ void OpenMPIRBuilder::setOutlinedTargetRegionFunctionAttributes(
46824682
std::to_string(NumTeamsValue));
46834683

46844684
if (ThreadLimitValue == -1 && Config.isGPU())
4685-
ThreadLimitValue = getGridValue(OutlinedFn).GV_Default_WG_Size;
4685+
ThreadLimitValue = getGridValue(T, OutlinedFn).GV_Default_WG_Size;
46864686

46874687
if (ThreadLimitValue > 0) {
46884688
if (OutlinedFn->getCallingConv() == CallingConv::AMDGPU_KERNEL) {

mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2553,6 +2553,7 @@ convertOmpTarget(Operation &opInst, llvm::IRBuilderBase &builder,
25532553
kernelInput.push_back(useValue);
25542554
}
25552555

2556+
ompBuilder->CurrentTargetInfo.emplace();
25562557
builder.restoreIP(moduleTranslation.getOpenMPBuilder()->createTarget(
25572558
ompLoc, targetOp.isTargetSPMDLoop(), allocaIP, builder.saveIP(), entryInfo,
25582559
kernelInput, genMapInfoCB, bodyCB, argAccessorCB));
@@ -2562,6 +2563,8 @@ convertOmpTarget(Operation &opInst, llvm::IRBuilderBase &builder,
25622563
if (moduleTranslation.getOpenMPBuilder()->Config.isTargetDevice())
25632564
handleDeclareTargetMapVar(mapData, moduleTranslation, builder);
25642565

2566+
ompBuilder->CurrentTargetInfo.reset();
2567+
25652568
return bodyGenStatus;
25662569
}
25672570

0 commit comments

Comments
 (0)