[llvm-commits] CVS: llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp GCSE.cpp Reassociate.cpp SCCP.cpp TailRecursionElimination.cpp
Chris Lattner
lattner at cs.uiuc.edu
Mon Mar 14 20:55:03 PST 2005
Changes in directory llvm/lib/Transforms/Scalar:
CorrelatedExprs.cpp updated: 1.27 -> 1.28
GCSE.cpp updated: 1.44 -> 1.45
Reassociate.cpp updated: 1.34 -> 1.35
SCCP.cpp updated: 1.120 -> 1.121
TailRecursionElimination.cpp updated: 1.14 -> 1.15
---
Log message:
This mega patch converts us from using Function::a{iterator|begin|end} to
using Function::arg_{iterator|begin|end}. Likewise Module::g* -> Module::global_*.
This patch is contributed by Gabor Greif, thanks!
---
Diffs of the changes: (+10 -10)
CorrelatedExprs.cpp | 2 +-
GCSE.cpp | 2 +-
Reassociate.cpp | 2 +-
SCCP.cpp | 10 +++++-----
TailRecursionElimination.cpp | 4 ++--
5 files changed, 10 insertions(+), 10 deletions(-)
Index: llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp
diff -u llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp:1.27 llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp:1.28
--- llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp:1.27 Mon Jan 31 19:23:49 2005
+++ llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp Mon Mar 14 22:54:21 2005
@@ -757,7 +757,7 @@
unsigned Rank = 1; // Skip rank zero.
// Number the arguments...
- for (Function::aiterator I = F.abegin(), E = F.aend(); I != E; ++I)
+ for (Function::arg_iterator I = F.arg_begin(), E = F.arg_end(); I != E; ++I)
RankMap[I] = Rank++;
// Number the instructions in reverse post order...
Index: llvm/lib/Transforms/Scalar/GCSE.cpp
diff -u llvm/lib/Transforms/Scalar/GCSE.cpp:1.44 llvm/lib/Transforms/Scalar/GCSE.cpp:1.45
--- llvm/lib/Transforms/Scalar/GCSE.cpp:1.44 Sun Dec 12 12:23:20 2004
+++ llvm/lib/Transforms/Scalar/GCSE.cpp Mon Mar 14 22:54:21 2005
@@ -73,7 +73,7 @@
// Check for value numbers of arguments. If the value numbering
// implementation can prove that an incoming argument is a constant or global
// value address, substitute it, making the argument dead.
- for (Function::aiterator AI = F.abegin(), E = F.aend(); AI != E; ++AI)
+ for (Function::arg_iterator AI = F.arg_begin(), E = F.arg_end(); AI != E; ++AI)
if (!AI->use_empty()) {
VN.getEqualNumberNodes(AI, EqualValues);
if (!EqualValues.empty()) {
Index: llvm/lib/Transforms/Scalar/Reassociate.cpp
diff -u llvm/lib/Transforms/Scalar/Reassociate.cpp:1.34 llvm/lib/Transforms/Scalar/Reassociate.cpp:1.35
--- llvm/lib/Transforms/Scalar/Reassociate.cpp:1.34 Wed Sep 1 17:55:36 2004
+++ llvm/lib/Transforms/Scalar/Reassociate.cpp Mon Mar 14 22:54:21 2005
@@ -66,7 +66,7 @@
unsigned i = 2;
// Assign distinct ranks to function arguments
- for (Function::aiterator I = F.abegin(), E = F.aend(); I != E; ++I)
+ for (Function::arg_iterator I = F.arg_begin(), E = F.arg_end(); I != E; ++I)
ValueRankMap[I] = ++i;
ReversePostOrderTraversal<Function*> RPOT(&F);
Index: llvm/lib/Transforms/Scalar/SCCP.cpp
diff -u llvm/lib/Transforms/Scalar/SCCP.cpp:1.120 llvm/lib/Transforms/Scalar/SCCP.cpp:1.121
--- llvm/lib/Transforms/Scalar/SCCP.cpp:1.120 Sat Jan 8 13:34:41 2005
+++ llvm/lib/Transforms/Scalar/SCCP.cpp Mon Mar 14 22:54:21 2005
@@ -865,7 +865,7 @@
MarkBlockExecutable(F->begin());
CallSite::arg_iterator CAI = CS.arg_begin();
- for (Function::aiterator AI = F->abegin(), E = F->aend();
+ for (Function::arg_iterator AI = F->arg_begin(), E = F->arg_end();
AI != E; ++AI, ++CAI) {
LatticeVal &IV = ValueState[AI];
if (!IV.isOverdefined())
@@ -1044,7 +1044,7 @@
// Mark all arguments to the function as being overdefined.
hash_map<Value*, LatticeVal> &Values = Solver.getValueMapping();
- for (Function::aiterator AI = F.abegin(), E = F.aend(); AI != E; ++AI)
+ for (Function::arg_iterator AI = F.arg_begin(), E = F.arg_end(); AI != E; ++AI)
Values[AI].markOverdefined();
// Solve for constants.
@@ -1173,7 +1173,7 @@
if (!F->hasInternalLinkage() || AddressIsTaken(F)) {
if (!F->isExternal())
Solver.MarkBlockExecutable(F->begin());
- for (Function::aiterator AI = F->abegin(), E = F->aend(); AI != E; ++AI)
+ for (Function::arg_iterator AI = F->arg_begin(), E = F->arg_end(); AI != E; ++AI)
Values[AI].markOverdefined();
} else {
Solver.AddTrackedFunction(F);
@@ -1182,7 +1182,7 @@
// Loop over global variables. We inform the solver about any internal global
// variables that do not have their 'addresses taken'. If they don't have
// their addresses taken, we can propagate constants through them.
- for (Module::giterator G = M.gbegin(), E = M.gend(); G != E; ++G)
+ for (Module::global_iterator G = M.global_begin(), E = M.global_end(); G != E; ++G)
if (!G->isConstant() && G->hasInternalLinkage() && !AddressIsTaken(G))
Solver.TrackValueOfGlobalVariable(G);
@@ -1204,7 +1204,7 @@
//
std::set<BasicBlock*> &ExecutableBBs = Solver.getExecutableBlocks();
for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F) {
- for (Function::aiterator AI = F->abegin(), E = F->aend(); AI != E; ++AI)
+ for (Function::arg_iterator AI = F->arg_begin(), E = F->arg_end(); AI != E; ++AI)
if (!AI->use_empty()) {
LatticeVal &IV = Values[AI];
if (IV.isConstant() || IV.isUndefined()) {
Index: llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
diff -u llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp:1.14 llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp:1.15
--- llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp:1.14 Wed Sep 1 17:55:36 2004
+++ llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp Mon Mar 14 22:54:21 2005
@@ -161,7 +161,7 @@
// Figure out which argument number this is...
unsigned ArgNo = 0;
Function *F = CI->getParent()->getParent();
- for (Function::aiterator AI = F->abegin(); &*AI != Arg; ++AI)
+ for (Function::arg_iterator AI = F->arg_begin(); &*AI != Arg; ++AI)
++ArgNo;
// If we are passing this argument into call as the corresponding
@@ -298,7 +298,7 @@
// For now, we initialize each PHI to only have the real arguments
// which are passed in.
Instruction *InsertPos = OldEntry->begin();
- for (Function::aiterator I = F->abegin(), E = F->aend(); I != E; ++I) {
+ for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E; ++I) {
PHINode *PN = new PHINode(I->getType(), I->getName()+".tr", InsertPos);
I->replaceAllUsesWith(PN); // Everyone use the PHI node now!
PN->addIncoming(I, NewEntry);
More information about the llvm-commits
mailing list