[llvm-commits] CVS: llvm/lib/Transforms/IPO/ArgumentPromotion.cpp GlobalOpt.cpp
Chris Lattner
sabre at nondot.org
Mon Feb 12 14:57:01 PST 2007
Changes in directory llvm/lib/Transforms/IPO:
ArgumentPromotion.cpp updated: 1.36 -> 1.37
GlobalOpt.cpp updated: 1.96 -> 1.97
---
Log message:
stop using methods that take vectors.
---
Diffs of the changes: (+9 -5)
ArgumentPromotion.cpp | 7 +++++--
GlobalOpt.cpp | 7 ++++---
2 files changed, 9 insertions(+), 5 deletions(-)
Index: llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
diff -u llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.36 llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.37
--- llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.36 Sat Feb 10 19:08:35 2007
+++ llvm/lib/Transforms/IPO/ArgumentPromotion.cpp Mon Feb 12 16:56:41 2007
@@ -370,7 +370,9 @@
// Add a parameter to the function for each element passed in.
for (ScalarizeTable::iterator SI = ArgIndices.begin(),
E = ArgIndices.end(); SI != E; ++SI)
- Params.push_back(GetElementPtrInst::getIndexedType(I->getType(), *SI));
+ Params.push_back(GetElementPtrInst::getIndexedType(I->getType(),
+ &(*SI)[0],
+ SI->size()));
if (ArgIndices.size() == 1 && ArgIndices.begin()->empty())
++NumArgumentsPromoted;
@@ -421,7 +423,8 @@
Value *V = *AI;
LoadInst *OrigLoad = OriginalLoads[*SI];
if (!SI->empty()) {
- V = new GetElementPtrInst(V, *SI, V->getName()+".idx", Call);
+ V = new GetElementPtrInst(V, &(*SI)[0], SI->size(),
+ V->getName()+".idx", Call);
AA.copyValue(OrigLoad->getOperand(0), V);
}
Args.push_back(new LoadInst(V, V->getName()+".val", Call));
Index: llvm/lib/Transforms/IPO/GlobalOpt.cpp
diff -u llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.96 llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.97
--- llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.96 Sat Feb 10 19:08:35 2007
+++ llvm/lib/Transforms/IPO/GlobalOpt.cpp Mon Feb 12 16:56:41 2007
@@ -908,11 +908,12 @@
Value *NewPtr = InsertedLoadsForPtr[FieldNo];
// Create the new GEP idx vector.
- std::vector<Value*> GEPIdx;
+ SmallVector<Value*, 8> GEPIdx;
GEPIdx.push_back(GEPI->getOperand(1));
- GEPIdx.insert(GEPIdx.end(), GEPI->op_begin()+3, GEPI->op_end());
+ GEPIdx.append(GEPI->op_begin()+3, GEPI->op_end());
- Value *NGEPI = new GetElementPtrInst(NewPtr, GEPIdx, GEPI->getName(), GEPI);
+ Value *NGEPI = new GetElementPtrInst(NewPtr, &GEPIdx[0], GEPIdx.size(),
+ GEPI->getName(), GEPI);
GEPI->replaceAllUsesWith(NGEPI);
GEPI->eraseFromParent();
}
More information about the llvm-commits
mailing list