[llvm] r185047 - No need to use a Set when a vector would do.

Nadav Rotem nrotem at apple.com
Wed Jun 26 17:14:13 PDT 2013


Author: nadav
Date: Wed Jun 26 19:14:13 2013
New Revision: 185047

URL: http://llvm.org/viewvc/llvm-project?rev=185047&view=rev
Log:
No need to use a Set when a vector would do.

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=185047&r1=185046&r2=185047&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp Wed Jun 26 19:14:13 2013
@@ -1300,7 +1300,7 @@ void FuncSLP::optimizeGatherSequence() {
   // instructions. TODO: We can further optimize this scan if we split the
   // instructions into different buckets based on the insert lane.
   SmallPtrSet<Instruction*, 16> Visited;
-  SmallPtrSet<Instruction*, 16> ToRemove;
+  SmallVector<Instruction*, 16> ToRemove;
   ReversePostOrderTraversal<Function*> RPOT(F);
   for (ReversePostOrderTraversal<Function*>::rpo_iterator I = RPOT.begin(),
        E = RPOT.end(); I != E; ++I) {
@@ -1318,7 +1318,7 @@ void FuncSLP::optimizeGatherSequence() {
         if (Insert->isIdenticalTo(*v) &&
             DT->dominates((*v)->getParent(), Insert->getParent())) {
           Insert->replaceAllUsesWith(*v);
-          ToRemove.insert(Insert);
+          ToRemove.push_back(Insert);
           Insert = 0;
           break;
         }
@@ -1329,7 +1329,7 @@ void FuncSLP::optimizeGatherSequence() {
   }
 
   // Erase all of the instructions that we RAUWed.
-  for (SmallPtrSet<Instruction*, 16>::iterator v = ToRemove.begin(),
+  for (SmallVector<Instruction*, 16>::iterator v = ToRemove.begin(),
        ve = ToRemove.end(); v != ve; ++v) {
     assert((*v)->getNumUses() == 0 && "Can't remove instructions with uses");
     (*v)->eraseFromParent();





More information about the llvm-commits mailing list