[llvm] e73d453 - [SPIRV] Avoid repeated hash lookups (NFC) (#109243)

via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 19 09:15:37 PDT 2024


Author: Kazu Hirata
Date: 2024-09-19T09:15:34-07:00
New Revision: e73d45361216f37faee22b86ccb07730feafa3a2

URL: https://github.com/llvm/llvm-project/commit/e73d45361216f37faee22b86ccb07730feafa3a2
DIFF: https://github.com/llvm/llvm-project/commit/e73d45361216f37faee22b86ccb07730feafa3a2.diff

LOG: [SPIRV] Avoid repeated hash lookups (NFC) (#109243)

Added: 
    

Modified: 
    llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.h

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.h b/llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.h
index a5cb86f4f1c638..ed9cfc07132430 100644
--- a/llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.h
+++ b/llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.h
@@ -255,11 +255,7 @@ class SPIRVGlobalRegistry {
 
   // Add a record about forward function call.
   void addForwardCall(const Function *F, MachineInstr *MI) {
-    auto It = ForwardCalls.find(F);
-    if (It == ForwardCalls.end())
-      ForwardCalls[F] = {MI};
-    else
-      It->second.insert(MI);
+    ForwardCalls[F].insert(MI);
   }
 
   // Map a Function to the vector of machine instructions that represents


        


More information about the llvm-commits mailing list