mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-14 17:34:41 +00:00
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
This commit is contained in:
parent
6c1f56574c
commit
cd2492e6ff
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user