mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 11:42:57 +01:00
eliminate a malloc/free for (almost) every GEP processed. This speeds up
IPSCCP 3.3% on kimwitu. llvm-svn: 33793
This commit is contained in:
parent
449f7d0d63
commit
e9c0bac4c5
@ -968,7 +968,7 @@ void SCCPSolver::visitGetElementPtrInst(GetElementPtrInst &I) {
|
||||
LatticeVal &IV = ValueState[&I];
|
||||
if (IV.isOverdefined()) return;
|
||||
|
||||
std::vector<Constant*> Operands;
|
||||
SmallVector<Constant*, 8> Operands;
|
||||
Operands.reserve(I.getNumOperands());
|
||||
|
||||
for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i) {
|
||||
@ -986,7 +986,8 @@ void SCCPSolver::visitGetElementPtrInst(GetElementPtrInst &I) {
|
||||
Constant *Ptr = Operands[0];
|
||||
Operands.erase(Operands.begin()); // Erase the pointer from idx list...
|
||||
|
||||
markConstant(IV, &I, ConstantExpr::getGetElementPtr(Ptr, Operands));
|
||||
markConstant(IV, &I, ConstantExpr::getGetElementPtr(Ptr, &Operands[0],
|
||||
Operands.size()));
|
||||
}
|
||||
|
||||
void SCCPSolver::visitStoreInst(Instruction &SI) {
|
||||
|
Loading…
Reference in New Issue
Block a user