mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-26 05:56:51 +00:00
eliminate a malloc/free for (almost) every GEP processed. This speeds up
IPSCCP 3.3% on kimwitu. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33793 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b59673e650
commit
e777ff21b0
@ -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