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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22580 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2005-08-02 02:44:31 +00:00
parent f9aaae06cd
commit e9100c69cb

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;
}