[llvm] 144314e - [SLPVectorizer] Avoid repeated hash lookups (NFC) (#107491)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 5 19:04:59 PDT 2024
Author: Kazu Hirata
Date: 2024-09-05T19:04:56-07:00
New Revision: 144314eaa5ca7f44817cf0ac162dbd17a5d88391
URL: https://github.com/llvm/llvm-project/commit/144314eaa5ca7f44817cf0ac162dbd17a5d88391
DIFF: https://github.com/llvm/llvm-project/commit/144314eaa5ca7f44817cf0ac162dbd17a5d88391.diff
LOG: [SLPVectorizer] Avoid repeated hash lookups (NFC) (#107491)
Added:
Modified:
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index a77d236413a968..c87d1055c8bc5d 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -5854,13 +5854,8 @@ void BoUpSLP::reorderBottomToTop(bool IgnoreReorder) {
}
// Build a map between user nodes and their operands order to speedup
// search. The graph currently does not provide this dependency directly.
- for (EdgeInfo &EI : TE->UserTreeIndices) {
- TreeEntry *UserTE = EI.UserTE;
- auto It = Users.find(UserTE);
- if (It == Users.end())
- It = Users.insert({UserTE, {}}).first;
- It->second.emplace_back(EI.EdgeIdx, TE);
- }
+ for (EdgeInfo &EI : TE->UserTreeIndices)
+ Users[EI.UserTE].emplace_back(EI.EdgeIdx, TE);
}
// Erase filtered entries.
for (TreeEntry *TE : Filtered)
More information about the llvm-commits
mailing list