]> granicus.if.org Git - llvm/commitdiff
[SLP][NFC] Use pointers to address to ScalarToTreeEntry elements, instead of indexes.
authorDinar Temirbulatov <dtemirbulatov@gmail.com>
Wed, 14 Aug 2019 19:46:50 +0000 (19:46 +0000)
committerDinar Temirbulatov <dtemirbulatov@gmail.com>
Wed, 14 Aug 2019 19:46:50 +0000 (19:46 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368906 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Vectorize/SLPVectorizer.cpp

index e1b2653e50857d40637ba673540b1e2b9c6a765b..e22eea2cbde6eed48ef674e920a9b44f57728464 100644 (file)
@@ -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;