mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-22 04:22:57 +02:00
Fix an iterator invalidation problem
llvm-svn: 22575
This commit is contained in:
parent
d2455468b5
commit
ec624cdcb5
@ -622,7 +622,9 @@ void LoopStrengthReduce::runOnLoop(Loop *L) {
|
|||||||
|
|
||||||
BasicBlock::iterator I = L->getHeader()->begin();
|
BasicBlock::iterator I = L->getHeader()->begin();
|
||||||
PHINode *PN;
|
PHINode *PN;
|
||||||
for (; (PN = dyn_cast<PHINode>(I)); ++I) {
|
for (; (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.
|
// At this point, we know that we have killed one or more GEP instructions.
|
||||||
// It is worth checking to see if the cann indvar is also dead, so that we
|
// It is worth checking to see if the cann indvar is also dead, so that we
|
||||||
// can remove it as well. The requirements for the cann indvar to be
|
// can remove it as well. The requirements for the cann indvar to be
|
||||||
|
Loading…
Reference in New Issue
Block a user