Switch some std::vector's to SmallVectors. This speeds up -load-vn -gcse
authorChris Lattner <sabre@nondot.org>
Sat, 10 Feb 2007 22:15:31 +0000 (22:15 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 10 Feb 2007 22:15:31 +0000 (22:15 +0000)
by 6% on tramp3d.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34167 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/BasicAliasAnalysis.cpp

index 0ca8d5a38d4417de51e133df0388bdaa022433aa..939fa6de45f5a06cfcef59f497645a79a6843831 100644 (file)
@@ -22,6 +22,7 @@
 #include "llvm/Instructions.h"
 #include "llvm/Pass.h"
 #include "llvm/Target/TargetData.h"
+#include "llvm/ADT/SmallVector.h"
 #include "llvm/Support/Compiler.h"
 #include "llvm/Support/GetElementPtrTypeIterator.h"
 #include "llvm/Support/ManagedStatic.h"
@@ -160,7 +161,8 @@ static const User *isGEP(const Value *V) {
   return 0;
 }
 
-static const Value *GetGEPOperands(const Value *V, std::vector<Value*> &GEPOps){
+static const Value *GetGEPOperands(const Value *V, 
+                                   SmallVector<Value*, 16> &GEPOps){
   assert(GEPOps.empty() && "Expect empty list to populate!");
   GEPOps.insert(GEPOps.end(), cast<User>(V)->op_begin()+1,
                 cast<User>(V)->op_end());
@@ -369,7 +371,7 @@ BasicAliasAnalysis::alias(const Value *V1, unsigned V1Size,
       // non-aliasing.
 
       // Collect all of the chained GEP operands together into one simple place
-      std::vector<Value*> GEP1Ops, GEP2Ops;
+      SmallVector<Value*, 16> GEP1Ops, GEP2Ops;
       BasePtr1 = GetGEPOperands(V1, GEP1Ops);
       BasePtr2 = GetGEPOperands(V2, GEP2Ops);
 
@@ -398,7 +400,7 @@ BasicAliasAnalysis::alias(const Value *V1, unsigned V1Size,
 
   if (V1Size != ~0U && V2Size != ~0U)
     if (isGEP(V1)) {
-      std::vector<Value*> GEPOperands;
+      SmallVector<Value*, 16> GEPOperands;
       const Value *BasePtr = GetGEPOperands(V1, GEPOperands);
 
       AliasResult R = alias(BasePtr, V1Size, V2, V2Size);