[llvm] 5901bda - [Vectorize] Avoid repeated hash lookups (NFC) (#126345)

via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 8 00:48:54 PST 2025


Author: Kazu Hirata
Date: 2025-02-08T00:48:51-08:00
New Revision: 5901bda5a0ed31e024abc8a7af52b272400daa08

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

LOG: [Vectorize] Avoid repeated hash lookups (NFC) (#126345)

Added: 
    

Modified: 
    llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp b/llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
index 0b40b733ffe7ee..04b392829f0d78 100644
--- a/llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
@@ -1335,8 +1335,9 @@ void Vectorizer::mergeEquivalenceClasses(EquivalenceClassMap &EQClasses) const {
     const auto &Key = EC.first;
     EqClassReducedKey RedKey{std::get<1>(Key), std::get<2>(Key),
                              std::get<3>(Key)};
-    RedKeyToUOMap[RedKey].insert(std::get<0>(Key));
-    if (RedKeyToUOMap[RedKey].size() > 1)
+    auto &UOMap = RedKeyToUOMap[RedKey];
+    UOMap.insert(std::get<0>(Key));
+    if (UOMap.size() > 1)
       FoundPotentiallyOptimizableEC = true;
   }
   if (!FoundPotentiallyOptimizableEC)


        


More information about the llvm-commits mailing list