[llvm] f342134 - [CodeGen] Avoid repeated hash lookups (NFC) (#110074)

via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 26 07:57:38 PDT 2024


Author: Kazu Hirata
Date: 2024-09-26T07:57:34-07:00
New Revision: f3421349361fdbad4060689ce601e5665f20af10

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

LOG: [CodeGen] Avoid repeated hash lookups (NFC) (#110074)

Added: 
    

Modified: 
    llvm/lib/CodeGen/MIRVRegNamerUtils.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/MIRVRegNamerUtils.cpp b/llvm/lib/CodeGen/MIRVRegNamerUtils.cpp
index ccfc4565d3a9bc..49c8a0e4663378 100644
--- a/llvm/lib/CodeGen/MIRVRegNamerUtils.cpp
+++ b/llvm/lib/CodeGen/MIRVRegNamerUtils.cpp
@@ -39,8 +39,6 @@ VRegRenamer::getVRegRenameMap(const std::vector<NamedVReg> &VRegs) {
   StringMap<unsigned> VRegNameCollisionMap;
 
   auto GetUniqueVRegName = [&VRegNameCollisionMap](const NamedVReg &Reg) {
-    if (!VRegNameCollisionMap.contains(Reg.getName()))
-      VRegNameCollisionMap[Reg.getName()] = 0;
     const unsigned Counter = ++VRegNameCollisionMap[Reg.getName()];
     return Reg.getName() + "__" + std::to_string(Counter);
   };


        


More information about the llvm-commits mailing list