[llvm-commits] CVS: llvm/lib/Transforms/Scalar/SCCP.cpp
Chris Lattner
sabre at nondot.org
Fri Feb 2 12:52:04 PST 2007
Changes in directory llvm/lib/Transforms/Scalar:
SCCP.cpp updated: 1.157 -> 1.158
---
Log message:
eliminate a malloc/free for (almost) every GEP processed. This speeds up
IPSCCP 3.3% on kimwitu.
---
Diffs of the changes: (+3 -2)
SCCP.cpp | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
Index: llvm/lib/Transforms/Scalar/SCCP.cpp
diff -u llvm/lib/Transforms/Scalar/SCCP.cpp:1.157 llvm/lib/Transforms/Scalar/SCCP.cpp:1.158
--- llvm/lib/Transforms/Scalar/SCCP.cpp:1.157 Fri Feb 2 14:38:30 2007
+++ llvm/lib/Transforms/Scalar/SCCP.cpp Fri Feb 2 14:51:48 2007
@@ -968,7 +968,7 @@
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 @@
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) {
More information about the llvm-commits
mailing list