[llvm-commits] [llvm] r167966 - /llvm/trunk/lib/Transforms/Vectorize/BBVectorize.cpp

Hal Finkel hfinkel at anl.gov
Wed Nov 14 11:53:27 PST 2012


Author: hfinkel
Date: Wed Nov 14 13:53:27 2012
New Revision: 167966

URL: http://llvm.org/viewvc/llvm-project?rev=167966&view=rev
Log:
Replace std::vector -> SmallVector in BBVectorize

For now, this uses 8 on-stack elements. I'll need to do some profiling
to see if this is the best number.

Pointed out by Jakob in post-commit review.

Modified:
    llvm/trunk/lib/Transforms/Vectorize/BBVectorize.cpp

Modified: llvm/trunk/lib/Transforms/Vectorize/BBVectorize.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/BBVectorize.cpp?rev=167966&r1=167965&r2=167966&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Vectorize/BBVectorize.cpp (original)
+++ llvm/trunk/lib/Transforms/Vectorize/BBVectorize.cpp Wed Nov 14 13:53:27 2012
@@ -1485,7 +1485,7 @@
       PrunedTree.insert(QTop.first);
 
       // Visit each child, pruning as necessary...
-      std::vector<ValuePairWithDepth> BestChildren;
+      SmallVector<ValuePairWithDepth, 8> BestChildren;
       VPPIteratorPair QTopRange = ConnectedPairs.equal_range(QTop.first);
       for (std::multimap<ValuePair, ValuePair>::iterator K = QTopRange.first;
            K != QTopRange.second; ++K) {
@@ -1517,7 +1517,7 @@
         DenseSet<ValuePair> CurrentPairs;
 
         bool CanAdd = true;
-        for (std::vector<ValuePairWithDepth>::iterator C2
+        for (SmallVector<ValuePairWithDepth, 8>::iterator C2
               = BestChildren.begin(), E2 = BestChildren.end();
              C2 != E2; ++C2) {
           if (C2->first.first == C->first.first ||
@@ -1602,7 +1602,7 @@
         // to an already-selected child. Check for this here, and if a
         // conflict is found, then remove the previously-selected child
         // before adding this one in its place.
-        for (std::vector<ValuePairWithDepth>::iterator C2
+        for (SmallVector<ValuePairWithDepth, 8>::iterator C2
               = BestChildren.begin(); C2 != BestChildren.end();) {
           if (C2->first.first == C->first.first ||
               C2->first.first == C->first.second ||
@@ -1617,7 +1617,7 @@
         BestChildren.push_back(ValuePairWithDepth(C->first, C->second));
       }
 
-      for (std::vector<ValuePairWithDepth>::iterator C
+      for (SmallVector<ValuePairWithDepth, 8>::iterator C
             = BestChildren.begin(), E2 = BestChildren.end();
            C != E2; ++C) {
         size_t DepthF = getDepthFactor(C->first.first);





More information about the llvm-commits mailing list