Skip to content

Commit 599c61f

Browse files
committed
Address reviewer comments.
1 parent 17ae5d7 commit 599c61f

File tree

3 files changed

+19
-17
lines changed

3 files changed

+19
-17
lines changed

clang/lib/CodeGen/CGOpenMPRuntime.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9098,9 +9098,9 @@ void CGOpenMPRuntime::emitUserDefinedMapper(const OMPDeclareMapperDecl *D,
90989098
CGM.getCXXABI().getMangleContext().mangleCanonicalTypeName(Ty, Out);
90999099
std::string Name = getName({"omp_mapper", TyStr, D->getName()});
91009100

9101-
auto *newFn = OMPBuilder.emitUserDefinedMapper(PrivatizeAndGenMapInfoCB,
9101+
auto *NewFn = OMPBuilder.emitUserDefinedMapper(PrivatizeAndGenMapInfoCB,
91029102
ElemTy, Name, CustomMapperCB);
9103-
UDMMap.try_emplace(D, newFn);
9103+
UDMMap.try_emplace(D, NewFn);
91049104
if (CGF)
91059105
FunctionUDMMap[CGF->CurFn].push_back(D);
91069106
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2861,8 +2861,8 @@ class OpenMPIRBuilder {
28612861
/// and whether the \a MapType instructs to delete this section. If \a IsInit
28622862
/// is true, and \a MapType indicates to not delete this array, array
28632863
/// initialization code is generated. If \a IsInit is false, and \a MapType
2864-
/// indicates to not this array, array deletion code is generated.
2865-
void emitUDMapperArrayInitOrDel(Function *MapperFn, llvm::Value *Handle,
2864+
/// indicates to delete this array, array deletion code is generated.
2865+
void emitUDMapperArrayInitOrDel(Function *MapperFn, llvm::Value *MapperHandle,
28662866
llvm::Value *Base, llvm::Value *Begin,
28672867
llvm::Value *Size, llvm::Value *MapType,
28682868
llvm::Value *MapName, TypeSize ElementSize,

llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7706,9 +7706,9 @@ void OpenMPIRBuilder::emitNonContiguousDescriptor(InsertPointTy AllocaIP,
77067706
}
77077707

77087708
void OpenMPIRBuilder::emitUDMapperArrayInitOrDel(
7709-
Function *MapperFn, Value *Handle, Value *Base, Value *Begin, Value *Size,
7710-
Value *MapType, Value *MapName, TypeSize ElementSize, BasicBlock *ExitBB,
7711-
bool IsInit) {
7709+
Function *MapperFn, Value *MapperHandle, Value *Base, Value *Begin,
7710+
Value *Size, Value *MapType, Value *MapName, TypeSize ElementSize,
7711+
BasicBlock *ExitBB, bool IsInit) {
77127712
StringRef Prefix = IsInit ? ".init" : ".del";
77137713

77147714
// Evaluate if this is an array section.
@@ -7767,8 +7767,8 @@ void OpenMPIRBuilder::emitUDMapperArrayInitOrDel(
77677767

77687768
// Call the runtime API __tgt_push_mapper_component to fill up the runtime
77697769
// data structure.
7770-
Value *OffloadingArgs[] = {Handle, Base, Begin,
7771-
ArraySize, MapTypeArg, MapName};
7770+
Value *OffloadingArgs[] = {MapperHandle, Base, Begin,
7771+
ArraySize, MapTypeArg, MapName};
77727772
Builder.CreateCall(
77737773
getOrCreateRuntimeFunction(M, OMPRTL___tgt_push_mapper_component),
77747774
OffloadingArgs);
@@ -7811,7 +7811,7 @@ Function *OpenMPIRBuilder::emitUserDefinedMapper(
78117811
auto SavedIP = Builder.saveIP();
78127812
Builder.SetInsertPoint(EntryBB);
78137813

7814-
Value *Handle = MapperFn->getArg(0);
7814+
Value *MapperHandle = MapperFn->getArg(0);
78157815
Value *BaseIn = MapperFn->getArg(1);
78167816
Value *BeginIn = MapperFn->getArg(2);
78177817
Value *Size = MapperFn->getArg(3);
@@ -7829,8 +7829,9 @@ Function *OpenMPIRBuilder::emitUserDefinedMapper(
78297829
// Emit array initiation if this is an array section and \p MapType indicates
78307830
// that memory allocation is required.
78317831
BasicBlock *HeadBB = BasicBlock::Create(M.getContext(), "omp.arraymap.head");
7832-
emitUDMapperArrayInitOrDel(MapperFn, Handle, BaseIn, BeginIn, Size, MapType,
7833-
MapName, ElementSize, HeadBB, /*IsInit=*/true);
7832+
emitUDMapperArrayInitOrDel(MapperFn, MapperHandle, BaseIn, BeginIn, Size,
7833+
MapType, MapName, ElementSize, HeadBB,
7834+
/*IsInit=*/true);
78347835

78357836
// Emit a for loop to iterate through SizeArg of elements and map all of them.
78367837

@@ -7855,7 +7856,7 @@ Function *OpenMPIRBuilder::emitUserDefinedMapper(
78557856

78567857
// Call the runtime API __tgt_mapper_num_components to get the number of
78577858
// pre-existing components.
7858-
Value *OffloadingArgs[] = {Handle};
7859+
Value *OffloadingArgs[] = {MapperHandle};
78597860
Value *PreviousSize = Builder.CreateCall(
78607861
getOrCreateRuntimeFunction(M, OMPRTL___tgt_mapper_num_components),
78617862
OffloadingArgs);
@@ -7956,8 +7957,8 @@ Function *OpenMPIRBuilder::emitUserDefinedMapper(
79567957
CurMapType->addIncoming(FromMapType, FromBB);
79577958
CurMapType->addIncoming(MemberMapType, ToElseBB);
79587959

7959-
Value *OffloadingArgs[] = {Handle, CurBaseArg, CurBeginArg,
7960-
CurSizeArg, CurMapType, CurNameArg};
7960+
Value *OffloadingArgs[] = {MapperHandle, CurBaseArg, CurBeginArg,
7961+
CurSizeArg, CurMapType, CurNameArg};
79617962
Function *ChildMapperFn = nullptr;
79627963
if (CustomMapperCB && CustomMapperCB(I, &ChildMapperFn)) {
79637964
// Call the corresponding mapper function.
@@ -7983,8 +7984,9 @@ Function *OpenMPIRBuilder::emitUserDefinedMapper(
79837984
emitBlock(ExitBB, MapperFn);
79847985
// Emit array deletion if this is an array section and \p MapType indicates
79857986
// that deletion is required.
7986-
emitUDMapperArrayInitOrDel(MapperFn, Handle, BaseIn, BeginIn, Size, MapType,
7987-
MapName, ElementSize, DoneBB, /*IsInit=*/false);
7987+
emitUDMapperArrayInitOrDel(MapperFn, MapperHandle, BaseIn, BeginIn, Size,
7988+
MapType, MapName, ElementSize, DoneBB,
7989+
/*IsInit=*/false);
79887990

79897991
// Emit the function exit block.
79907992
emitBlock(DoneBB, MapperFn, /*IsFinished=*/true);

0 commit comments

Comments
 (0)