Skip to content

Commit 909efcf

Browse files
kazutakahiratagithub-actions[bot]
authored andcommitted
Automerge: [AMDGPU] Avoid repeated hash lookups (NFC) (#127371)
2 parents b1c6e8c + 8d75246 commit 909efcf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Target/AMDGPU/AMDGPUSwLowerLDS.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -948,12 +948,13 @@ Constant *AMDGPUSwLowerLDS::getAddressesOfVariablesInKernel(
948948

949949
SmallVector<Constant *> Elements;
950950
for (auto *GV : Variables) {
951-
if (!LDSParams.LDSToReplacementIndicesMap.contains(GV)) {
951+
auto It = LDSParams.LDSToReplacementIndicesMap.find(GV);
952+
if (It == LDSParams.LDSToReplacementIndicesMap.end()) {
952953
Elements.push_back(
953954
PoisonValue::get(IRB.getPtrTy(AMDGPUAS::GLOBAL_ADDRESS)));
954955
continue;
955956
}
956-
auto &Indices = LDSParams.LDSToReplacementIndicesMap[GV];
957+
auto &Indices = It->second;
957958
Constant *GEPIdx[] = {ConstantInt::get(Int32Ty, Indices[0]),
958959
ConstantInt::get(Int32Ty, Indices[1]),
959960
ConstantInt::get(Int32Ty, Indices[2])};

0 commit comments

Comments
 (0)