diff options
author | Chris Lattner <sabre@nondot.org> | 2007-01-30 23:15:19 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-01-30 23:15:19 +0000 |
commit | cd2492e6ff67d51bafe20412fdb91cb8bcc22095 (patch) | |
tree | bbd25bc65510942aca754994d2ef8ffa9e60b039 | |
parent | 6c1f56574c8a0ba70480b7c65c4ec3847ff70864 (diff) |
use smallvector instead of vector to make constant folding a bit more efficient
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33672 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Scalar/SCCP.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp index f09ff0e8e1..cae743fee5 100644 --- a/lib/Transforms/Scalar/SCCP.cpp +++ b/lib/Transforms/Scalar/SCCP.cpp @@ -33,6 +33,7 @@ #include "llvm/Support/CallSite.h" #include "llvm/Support/Debug.h" #include "llvm/ADT/hash_map" +#include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/STLExtras.h" #include <algorithm> @@ -1093,7 +1094,7 @@ void SCCPSolver::visitCallSite(CallSite CS) { return; } - std::vector<Constant*> Operands; + SmallVector<Constant*, 8> Operands; Operands.reserve(I->getNumOperands()-1); for (CallSite::arg_iterator AI = CS.arg_begin(), E = CS.arg_end(); @@ -1109,7 +1110,7 @@ void SCCPSolver::visitCallSite(CallSite CS) { Operands.push_back(State.getConstant()); } - if (Constant *C = ConstantFoldCall(F, Operands)) + if (Constant *C = ConstantFoldCall(F, &Operands[0], Operands.size())) markConstant(IV, I, C); else markOverdefined(IV, I); |