Skip to content

Commit 19e5a52

Browse files
[GlobalISel] Avoid repeated hash lookups (NFC) (#110399)
1 parent a341820 commit 19e5a52

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

llvm/include/llvm/CodeGen/GlobalISel/LegacyLegalizerInfo.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -318,11 +318,8 @@ class LegacyLegalizerInfo {
318318
const unsigned AddressSpace,
319319
const SizeAndActionsVec &SizeAndActions) {
320320
const unsigned OpcodeIdx = Opcode - FirstOp;
321-
if (AddrSpace2PointerActions[OpcodeIdx].find(AddressSpace) ==
322-
AddrSpace2PointerActions[OpcodeIdx].end())
323-
AddrSpace2PointerActions[OpcodeIdx][AddressSpace] = {{}};
324321
SmallVector<SizeAndActionsVec, 1> &Actions =
325-
AddrSpace2PointerActions[OpcodeIdx].find(AddressSpace)->second;
322+
AddrSpace2PointerActions[OpcodeIdx][AddressSpace];
326323
setActions(TypeIndex, Actions, SizeAndActions);
327324
}
328325

@@ -347,11 +344,8 @@ class LegacyLegalizerInfo {
347344
const unsigned ElementSize,
348345
const SizeAndActionsVec &SizeAndActions) {
349346
const unsigned OpcodeIdx = Opcode - FirstOp;
350-
if (NumElements2Actions[OpcodeIdx].find(ElementSize) ==
351-
NumElements2Actions[OpcodeIdx].end())
352-
NumElements2Actions[OpcodeIdx][ElementSize] = {{}};
353347
SmallVector<SizeAndActionsVec, 1> &Actions =
354-
NumElements2Actions[OpcodeIdx].find(ElementSize)->second;
348+
NumElements2Actions[OpcodeIdx][ElementSize];
355349
setActions(TypeIndex, Actions, SizeAndActions);
356350
}
357351

0 commit comments

Comments
 (0)