From ea93f17b19edb6eade754b565bb54eaddac3b587 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Fri, 21 Feb 2025 11:25:09 -0800 Subject: [PATCH] [SPIRV] Avoid repeated hash lookups (NFC) --- llvm/lib/Target/SPIRV/SPIRVDuplicatesTracker.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/llvm/lib/Target/SPIRV/SPIRVDuplicatesTracker.h b/llvm/lib/Target/SPIRV/SPIRVDuplicatesTracker.h index e574892712298..441e32c1eb695 100644 --- a/llvm/lib/Target/SPIRV/SPIRVDuplicatesTracker.h +++ b/llvm/lib/Target/SPIRV/SPIRVDuplicatesTracker.h @@ -154,22 +154,23 @@ template class SPIRVDuplicatesTrackerBase { if (find(V, MF).isValid()) return; - Storage[V][MF] = R; + auto &S = Storage[V]; + S[MF] = R; if (std::is_same::type>::type>() || std::is_same::type>::type>()) - Storage[V].setIsFunc(true); + S.setIsFunc(true); if (std::is_same::type>::type>()) - Storage[V].setIsGV(true); + S.setIsGV(true); if (std::is_same::type>::type>()) - Storage[V].setIsConst(true); + S.setIsConst(true); } Register find(KeyTy V, const MachineFunction *MF) const {