From cd2492e6ff67d51bafe20412fdb91cb8bcc22095 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 30 Jan 2007 23:15:19 +0000 Subject: [PATCH] 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 --- lib/Transforms/Scalar/SCCP.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp index f09ff0e8e1b..cae743fee50 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 @@ -1093,7 +1094,7 @@ void SCCPSolver::visitCallSite(CallSite CS) { return; } - std::vector Operands; + SmallVector 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); -- 2.34.1