mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-23 17:24:48 +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:
@ -33,6 +33,7 @@
|
|||||||
#include "llvm/Support/CallSite.h"
|
#include "llvm/Support/CallSite.h"
|
||||||
#include "llvm/Support/Debug.h"
|
#include "llvm/Support/Debug.h"
|
||||||
#include "llvm/ADT/hash_map"
|
#include "llvm/ADT/hash_map"
|
||||||
|
#include "llvm/ADT/SmallVector.h"
|
||||||
#include "llvm/ADT/Statistic.h"
|
#include "llvm/ADT/Statistic.h"
|
||||||
#include "llvm/ADT/STLExtras.h"
|
#include "llvm/ADT/STLExtras.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
@ -1093,7 +1094,7 @@ void SCCPSolver::visitCallSite(CallSite CS) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<Constant*> Operands;
|
SmallVector<Constant*, 8> Operands;
|
||||||
Operands.reserve(I->getNumOperands()-1);
|
Operands.reserve(I->getNumOperands()-1);
|
||||||
|
|
||||||
for (CallSite::arg_iterator AI = CS.arg_begin(), E = CS.arg_end();
|
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());
|
Operands.push_back(State.getConstant());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Constant *C = ConstantFoldCall(F, Operands))
|
if (Constant *C = ConstantFoldCall(F, &Operands[0], Operands.size()))
|
||||||
markConstant(IV, I, C);
|
markConstant(IV, I, C);
|
||||||
else
|
else
|
||||||
markOverdefined(IV, I);
|
markOverdefined(IV, I);
|
||||||
|
Reference in New Issue
Block a user