Simplify for loop, clear a per-loop map after processing each loop

llvm-svn: 22580
This commit is contained in:
Chris Lattner 2005-08-02 02:44:31 +00:00
parent c7ffb0c713
commit 38b0e93bd4

View File

@ -632,7 +632,7 @@ void LoopStrengthReduce::runOnLoop(Loop *L) {
BasicBlock::iterator I = L->getHeader()->begin();
PHINode *PN;
for (; (PN = dyn_cast<PHINode>(I)); ) {
while ((PN = dyn_cast<PHINode>(I))) {
++I; // Preincrement iterator to avoid invalidating it when deleting PN.
// At this point, we know that we have killed one or more GEP instructions.
@ -664,5 +664,6 @@ void LoopStrengthReduce::runOnLoop(Loop *L) {
}
IVUsesByStride.clear();
CastedBasePointers.clear();
return;
}