Skip to content

Commit

Permalink
[GlobalISel] Avoid repeated hash lookups (NFC) (#128633)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazutakahirata authored Feb 25, 2025
1 parent 6c17380 commit 3083aea
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions llvm/lib/CodeGen/GlobalISel/LegacyLegalizerInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,10 @@ LegacyLegalizerInfo::findScalarLegalAction(const InstrAspect &Aspect) const {
ArrayRef<SizeAndActionsVec> Actions;
if (Aspect.Type.isPointer()) {
auto &PA = AddrSpace2PointerActions[OpcodeIdx];
if (PA.find(Aspect.Type.getAddressSpace()) == PA.end())
auto It = PA.find(Aspect.Type.getAddressSpace());
if (It == PA.end())
return {NotFound, LLT()};
Actions = PA.find(Aspect.Type.getAddressSpace())->second;
Actions = It->second;
} else {
Actions = ScalarActions[OpcodeIdx];
}
Expand Down

0 comments on commit 3083aea

Please sign in to comment.