Skip to content

Commit 3083aea

Browse files
[GlobalISel] Avoid repeated hash lookups (NFC) (llvm#128633)
1 parent 6c17380 commit 3083aea

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/CodeGen/GlobalISel/LegacyLegalizerInfo.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,10 @@ LegacyLegalizerInfo::findScalarLegalAction(const InstrAspect &Aspect) const {
308308
ArrayRef<SizeAndActionsVec> Actions;
309309
if (Aspect.Type.isPointer()) {
310310
auto &PA = AddrSpace2PointerActions[OpcodeIdx];
311-
if (PA.find(Aspect.Type.getAddressSpace()) == PA.end())
311+
auto It = PA.find(Aspect.Type.getAddressSpace());
312+
if (It == PA.end())
312313
return {NotFound, LLT()};
313-
Actions = PA.find(Aspect.Type.getAddressSpace())->second;
314+
Actions = It->second;
314315
} else {
315316
Actions = ScalarActions[OpcodeIdx];
316317
}

0 commit comments

Comments
 (0)