[llvm] 70f4e6a - [ExecutionEngine] Avoid repeated hash lookups (NFC) (#129356)

via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 1 08:15:02 PST 2025


Author: Kazu Hirata
Date: 2025-03-01T08:15:00-08:00
New Revision: 70f4e6abf653afadd29e91ef2bfa4b2db46a4013

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

LOG: [ExecutionEngine] Avoid repeated hash lookups (NFC) (#129356)

Added: 
    

Modified: 
    llvm/lib/ExecutionEngine/Orc/Layer.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/ExecutionEngine/Orc/Layer.cpp b/llvm/lib/ExecutionEngine/Orc/Layer.cpp
index d97336c914ea6..eb144275da589 100644
--- a/llvm/lib/ExecutionEngine/Orc/Layer.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/Layer.cpp
@@ -76,10 +76,11 @@ IRMaterializationUnit::IRMaterializationUnit(
 
       // Otherwise we just need a normal linker mangling.
       auto MangledName = Mangle(G.getName());
-      SymbolFlags[MangledName] = JITSymbolFlags::fromGlobalValue(G);
+      auto &Flags = SymbolFlags[MangledName];
+      Flags = JITSymbolFlags::fromGlobalValue(G);
       if (G.getComdat() &&
           G.getComdat()->getSelectionKind() != Comdat::NoDeduplicate)
-        SymbolFlags[MangledName] |= JITSymbolFlags::Weak;
+        Flags |= JITSymbolFlags::Weak;
       SymbolToDefinition[MangledName] = &G;
     }
 


        


More information about the llvm-commits mailing list