Skip to content

Commit fa51252

Browse files
committed
Address reviewer comments.
1 parent a157114 commit fa51252

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
@@ -9097,9 +9097,9 @@ void CGOpenMPRuntime::emitUserDefinedMapper(const OMPDeclareMapperDecl *D,
90979097
CGM.getCXXABI().getMangleContext().mangleCanonicalTypeName(Ty, Out);
90989098
std::string Name = getName({"omp_mapper", TyStr, D->getName()});
90999099

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

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
@@ -7703,9 +7703,9 @@ void OpenMPIRBuilder::emitNonContiguousDescriptor(InsertPointTy AllocaIP,
77037703
}
77047704

77057705
void OpenMPIRBuilder::emitUDMapperArrayInitOrDel(
7706-
Function *MapperFn, Value *Handle, Value *Base, Value *Begin, Value *Size,
7707-
Value *MapType, Value *MapName, TypeSize ElementSize, BasicBlock *ExitBB,
7708-
bool IsInit) {
7706+
Function *MapperFn, Value *MapperHandle, Value *Base, Value *Begin,
7707+
Value *Size, Value *MapType, Value *MapName, TypeSize ElementSize,
7708+
BasicBlock *ExitBB, bool IsInit) {
77097709
StringRef Prefix = IsInit ? ".init" : ".del";
77107710

77117711
// Evaluate if this is an array section.
@@ -7764,8 +7764,8 @@ void OpenMPIRBuilder::emitUDMapperArrayInitOrDel(
77647764

77657765
// Call the runtime API __tgt_push_mapper_component to fill up the runtime
77667766
// data structure.
7767-
Value *OffloadingArgs[] = {Handle, Base, Begin,
7768-
ArraySize, MapTypeArg, MapName};
7767+
Value *OffloadingArgs[] = {MapperHandle, Base, Begin,
7768+
ArraySize, MapTypeArg, MapName};
77697769
Builder.CreateCall(
77707770
getOrCreateRuntimeFunction(M, OMPRTL___tgt_push_mapper_component),
77717771
OffloadingArgs);
@@ -7808,7 +7808,7 @@ Function *OpenMPIRBuilder::emitUserDefinedMapper(
78087808
auto SavedIP = Builder.saveIP();
78097809
Builder.SetInsertPoint(EntryBB);
78107810

7811-
Value *Handle = MapperFn->getArg(0);
7811+
Value *MapperHandle = MapperFn->getArg(0);
78127812
Value *BaseIn = MapperFn->getArg(1);
78137813
Value *BeginIn = MapperFn->getArg(2);
78147814
Value *Size = MapperFn->getArg(3);
@@ -7826,8 +7826,9 @@ Function *OpenMPIRBuilder::emitUserDefinedMapper(
78267826
// Emit array initiation if this is an array section and \p MapType indicates
78277827
// that memory allocation is required.
78287828
BasicBlock *HeadBB = BasicBlock::Create(M.getContext(), "omp.arraymap.head");
7829-
emitUDMapperArrayInitOrDel(MapperFn, Handle, BaseIn, BeginIn, Size, MapType,
7830-
MapName, ElementSize, HeadBB, /*IsInit=*/true);
7829+
emitUDMapperArrayInitOrDel(MapperFn, MapperHandle, BaseIn, BeginIn, Size,
7830+
MapType, MapName, ElementSize, HeadBB,
7831+
/*IsInit=*/true);
78317832

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

@@ -7852,7 +7853,7 @@ Function *OpenMPIRBuilder::emitUserDefinedMapper(
78527853

78537854
// Call the runtime API __tgt_mapper_num_components to get the number of
78547855
// pre-existing components.
7855-
Value *OffloadingArgs[] = {Handle};
7856+
Value *OffloadingArgs[] = {MapperHandle};
78567857
Value *PreviousSize = Builder.CreateCall(
78577858
getOrCreateRuntimeFunction(M, OMPRTL___tgt_mapper_num_components),
78587859
OffloadingArgs);
@@ -7953,8 +7954,8 @@ Function *OpenMPIRBuilder::emitUserDefinedMapper(
79537954
CurMapType->addIncoming(FromMapType, FromBB);
79547955
CurMapType->addIncoming(MemberMapType, ToElseBB);
79557956

7956-
Value *OffloadingArgs[] = {Handle, CurBaseArg, CurBeginArg,
7957-
CurSizeArg, CurMapType, CurNameArg};
7957+
Value *OffloadingArgs[] = {MapperHandle, CurBaseArg, CurBeginArg,
7958+
CurSizeArg, CurMapType, CurNameArg};
79587959
Function *ChildMapperFn = nullptr;
79597960
if (CustomMapperCB && CustomMapperCB(I, &ChildMapperFn)) {
79607961
// Call the corresponding mapper function.
@@ -7980,8 +7981,9 @@ Function *OpenMPIRBuilder::emitUserDefinedMapper(
79807981
emitBlock(ExitBB, MapperFn);
79817982
// Emit array deletion if this is an array section and \p MapType indicates
79827983
// that deletion is required.
7983-
emitUDMapperArrayInitOrDel(MapperFn, Handle, BaseIn, BeginIn, Size, MapType,
7984-
MapName, ElementSize, DoneBB, /*IsInit=*/false);
7984+
emitUDMapperArrayInitOrDel(MapperFn, MapperHandle, BaseIn, BeginIn, Size,
7985+
MapType, MapName, ElementSize, DoneBB,
7986+
/*IsInit=*/false);
79857987

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

0 commit comments

Comments
 (0)