[llvm-commits] [llvm] r100164 - /llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp
Bob Wilson
bob.wilson at apple.com
Thu Apr 1 18:22:49 PDT 2010
Author: bwilson
Date: Thu Apr 1 20:22:49 2010
New Revision: 100164
URL: http://llvm.org/viewvc/llvm-project?rev=100164&view=rev
Log:
Revert 100158 in case it is causing some of the buildbot problems.
Modified:
llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp
Modified: llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp?rev=100164&r1=100163&r2=100164&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp Thu Apr 1 20:22:49 2010
@@ -471,27 +471,22 @@
SmallVector<PHINode*, 20> WorkList;
WorkList.push_back(PHI);
- // Record this PHI.
- BasicBlock *BB = PHI->getParent();
- AvailableVals[BB] = PHI;
- (*BBMap)[BB]->AvailableVal = PHI;
-
while (!WorkList.empty()) {
PHI = WorkList.pop_back_val();
+ BasicBlock *BB = PHI->getParent();
+ BBInfo *Info = (*BBMap)[BB];
+ if (!Info || Info->AvailableVal)
+ return;
+
+ // Record the PHI.
+ AvailableVals[BB] = PHI;
+ Info->AvailableVal = PHI;
// Iterate through the PHI's incoming values.
for (unsigned i = 0, e = PHI->getNumIncomingValues(); i != e; ++i) {
- PHINode *IncomingPHIVal = dyn_cast<PHINode>(PHI->getIncomingValue(i));
- if (!IncomingPHIVal) continue;
- BB = IncomingPHIVal->getParent();
- BBInfo *Info = (*BBMap)[BB];
- if (!Info || Info->AvailableVal)
- continue;
-
- // Record the PHI and add it to the worklist.
- AvailableVals[BB] = IncomingPHIVal;
- Info->AvailableVal = IncomingPHIVal;
- WorkList.push_back(IncomingPHIVal);
+ PHINode *IncomingVal = dyn_cast<PHINode>(PHI->getIncomingValue(i));
+ if (!IncomingVal) continue;
+ WorkList.push_back(IncomingVal);
}
}
}
@@ -504,24 +499,21 @@
SmallVector<PHINode*, 20> WorkList;
WorkList.push_back(PHI);
- // Clear the tag for this PHI.
- (*BBMap)[PHI->getParent()]->PHITag = 0;
-
while (!WorkList.empty()) {
PHI = WorkList.pop_back_val();
+ BasicBlock *BB = PHI->getParent();
+ BBInfo *Info = (*BBMap)[BB];
+ if (!Info || Info->AvailableVal || !Info->PHITag)
+ continue;
+
+ // Clear the tag.
+ Info->PHITag = 0;
// Iterate through the PHI's incoming values.
for (unsigned i = 0, e = PHI->getNumIncomingValues(); i != e; ++i) {
- PHINode *IncomingPHIVal = dyn_cast<PHINode>(PHI->getIncomingValue(i));
- if (!IncomingPHIVal) continue;
- BasicBlock *BB = IncomingPHIVal->getParent();
- BBInfo *Info = (*BBMap)[BB];
- if (!Info || Info->AvailableVal || !Info->PHITag)
- continue;
-
- // Clear the tag and add the PHI to the worklist.
- Info->PHITag = 0;
- WorkList.push_back(IncomingPHIVal);
+ PHINode *IncomingVal = dyn_cast<PHINode>(PHI->getIncomingValue(i));
+ if (!IncomingVal) continue;
+ WorkList.push_back(IncomingVal);
}
}
}
More information about the llvm-commits
mailing list