Simplify potentially quadratic behavior while erasing elements from std::vector.
[oota-llvm.git] / lib / Transforms / Vectorize / BBVectorize.cpp
index 8c26dd5a51e2da8e0a55a5858191090231b9ee64..1296ef11b99666c151a837635496846c268c6bc8 100644 (file)
@@ -41,7 +41,7 @@
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Support/ValueHandle.h"
-#include "llvm/Target/TargetData.h"
+#include "llvm/DataLayout.h"
 #include "llvm/Transforms/Utils/Local.h"
 #include "llvm/Transforms/Vectorize.h"
 #include <algorithm>
@@ -178,7 +178,7 @@ namespace {
       : BasicBlockPass(ID), Config(C) {
       AA = &P->getAnalysis<AliasAnalysis>();
       SE = &P->getAnalysis<ScalarEvolution>();
-      TD = P->getAnalysisIfAvailable<TargetData>();
+      TD = P->getAnalysisIfAvailable<DataLayout>();
     }
 
     typedef std::pair<Value *, Value *> ValuePair;
@@ -192,7 +192,7 @@ namespace {
 
     AliasAnalysis *AA;
     ScalarEvolution *SE;
-    TargetData *TD;
+    DataLayout *TD;
 
     // FIXME: const correct?
 
@@ -364,7 +364,7 @@ namespace {
     virtual bool runOnBasicBlock(BasicBlock &BB) {
       AA = &getAnalysis<AliasAnalysis>();
       SE = &getAnalysis<ScalarEvolution>();
-      TD = getAnalysisIfAvailable<TargetData>();
+      TD = getAnalysisIfAvailable<DataLayout>();
 
       return vectorizeBB(BB);
     }
@@ -557,7 +557,7 @@ namespace {
       // Now we have a map of all of the pairable instructions and we need to
       // select the best possible pairing. A good pairing is one such that the
       // users of the pair are also paired. This defines a (directed) forest
-      // over the pairs such that two pairs are connected if the second pair
+      // over the pairs such that two pairs are connected iff the second pair
       // uses the first.
 
       // Note that it only matters that both members of the second pair use some