Skip to content

Commit acbcb87

Browse files
kazutakahiratagithub-actions[bot]
authored andcommitted
Automerge: [GlobalISel] Avoid repeated hash lookups (NFC) (#127372)
2 parents 909efcf + 0323554 commit acbcb87

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/lib/CodeGen/GlobalISel/LegacyLegalizerInfo.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -305,10 +305,10 @@ LegacyLegalizerInfo::findScalarLegalAction(const InstrAspect &Aspect) const {
305305
if (Aspect.Opcode < FirstOp || Aspect.Opcode > LastOp)
306306
return {NotFound, LLT()};
307307
const unsigned OpcodeIdx = getOpcodeIdxForOpcode(Aspect.Opcode);
308-
if (Aspect.Type.isPointer() &&
309-
AddrSpace2PointerActions[OpcodeIdx].find(Aspect.Type.getAddressSpace()) ==
310-
AddrSpace2PointerActions[OpcodeIdx].end()) {
311-
return {NotFound, LLT()};
308+
if (Aspect.Type.isPointer()) {
309+
auto &PA = AddrSpace2PointerActions[OpcodeIdx];
310+
if (PA.find(Aspect.Type.getAddressSpace()) == PA.end())
311+
return {NotFound, LLT()};
312312
}
313313
const SmallVector<SizeAndActionsVec, 1> &Actions =
314314
Aspect.Type.isPointer()

0 commit comments

Comments
 (0)