projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8dcd548
)
Fix an iterator invalidation problem
author
Chris Lattner
<sabre@nondot.org>
Tue, 2 Aug 2005 00:41:11 +0000
(
00:41
+0000)
committer
Chris Lattner
<sabre@nondot.org>
Tue, 2 Aug 2005 00:41:11 +0000
(
00:41
+0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22575
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Transforms/Scalar/LoopStrengthReduce.cpp
patch
|
blob
|
history
diff --git
a/lib/Transforms/Scalar/LoopStrengthReduce.cpp
b/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index f06cf33c138ee7b9100077a7a7834683a8c028ee..0967fb7200b88135bfe9546bfc0ab8e51047fdff 100644
(file)
--- a/
lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/
lib/Transforms/Scalar/LoopStrengthReduce.cpp
@@
-622,7
+622,9
@@
void LoopStrengthReduce::runOnLoop(Loop *L) {
BasicBlock::iterator I = L->getHeader()->begin();
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.
// 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