[llvm] r368906 - [SLP][NFC] Use pointers to address to ScalarToTreeEntry elements, instead of indexes.
Dinar Temirbulatov via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 14 12:46:51 PDT 2019
Author: dinar
Date: Wed Aug 14 12:46:50 2019
New Revision: 368906
URL: http://llvm.org/viewvc/llvm-project?rev=368906&view=rev
Log:
[SLP][NFC] Use pointers to address to ScalarToTreeEntry elements, instead of indexes.
Modified:
llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp
Modified: llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp?rev=368906&r1=368905&r2=368906&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp Wed Aug 14 12:46:50 2019
@@ -1310,7 +1310,7 @@ private:
if (Vectorized) {
for (int i = 0, e = VL.size(); i != e; ++i) {
assert(!getTreeEntry(VL[i]) && "Scalar already in tree!");
- ScalarToTreeEntry[VL[i]] = Last->Idx;
+ ScalarToTreeEntry[VL[i]] = Last;
}
} else {
MustGather.insert(VL.begin(), VL.end());
@@ -1340,19 +1340,19 @@ private:
TreeEntry *getTreeEntry(Value *V) {
auto I = ScalarToTreeEntry.find(V);
if (I != ScalarToTreeEntry.end())
- return VectorizableTree[I->second].get();
+ return I->second;
return nullptr;
}
const TreeEntry *getTreeEntry(Value *V) const {
auto I = ScalarToTreeEntry.find(V);
if (I != ScalarToTreeEntry.end())
- return VectorizableTree[I->second].get();
+ return I->second;
return nullptr;
}
/// Maps a specific scalar to its tree entry.
- SmallDenseMap<Value*, int> ScalarToTreeEntry;
+ SmallDenseMap<Value*, TreeEntry *> ScalarToTreeEntry;
/// A list of scalars that we found that we need to keep as scalars.
ValueSet MustGather;
More information about the llvm-commits
mailing list