mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-18 10:32:48 +02:00
[SLP][NFC] Use pointers to address to ScalarToTreeEntry elements, instead of indexes.
llvm-svn: 368906
This commit is contained in:
parent
4e31bed4b9
commit
3cdc6b371a
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user