From 19e5a529e8071aa9820291c6c12e99ba2cbc70dc Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sun, 29 Sep 2024 08:54:42 -0700 Subject: [PATCH] [GlobalISel] Avoid repeated hash lookups (NFC) (#110399) --- .../llvm/CodeGen/GlobalISel/LegacyLegalizerInfo.h | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/llvm/include/llvm/CodeGen/GlobalISel/LegacyLegalizerInfo.h b/llvm/include/llvm/CodeGen/GlobalISel/LegacyLegalizerInfo.h index b749d9ef588a..0283fdded7f4 100644 --- a/llvm/include/llvm/CodeGen/GlobalISel/LegacyLegalizerInfo.h +++ b/llvm/include/llvm/CodeGen/GlobalISel/LegacyLegalizerInfo.h @@ -318,11 +318,8 @@ private: const unsigned AddressSpace, const SizeAndActionsVec &SizeAndActions) { const unsigned OpcodeIdx = Opcode - FirstOp; - if (AddrSpace2PointerActions[OpcodeIdx].find(AddressSpace) == - AddrSpace2PointerActions[OpcodeIdx].end()) - AddrSpace2PointerActions[OpcodeIdx][AddressSpace] = {{}}; SmallVector &Actions = - AddrSpace2PointerActions[OpcodeIdx].find(AddressSpace)->second; + AddrSpace2PointerActions[OpcodeIdx][AddressSpace]; setActions(TypeIndex, Actions, SizeAndActions); } @@ -347,11 +344,8 @@ private: const unsigned ElementSize, const SizeAndActionsVec &SizeAndActions) { const unsigned OpcodeIdx = Opcode - FirstOp; - if (NumElements2Actions[OpcodeIdx].find(ElementSize) == - NumElements2Actions[OpcodeIdx].end()) - NumElements2Actions[OpcodeIdx][ElementSize] = {{}}; SmallVector &Actions = - NumElements2Actions[OpcodeIdx].find(ElementSize)->second; + NumElements2Actions[OpcodeIdx][ElementSize]; setActions(TypeIndex, Actions, SizeAndActions); }