[llvm-commits] CVS: llvm/lib/Analysis/LoopInfo.cpp
Chris Lattner
lattner at cs.uiuc.edu
Thu Feb 27 15:52:00 PST 2003
Changes in directory llvm/lib/Analysis:
LoopInfo.cpp updated: 1.31 -> 1.32
---
Log message:
Fix bug: LICM/2003-02-27-PreheaderProblem.ll
There may be a single outside predecessor and
still need a new loop-preheader if the predecessor has multiple
successors.
---
Diffs of the changes:
Index: llvm/lib/Analysis/LoopInfo.cpp
diff -u llvm/lib/Analysis/LoopInfo.cpp:1.31 llvm/lib/Analysis/LoopInfo.cpp:1.32
--- llvm/lib/Analysis/LoopInfo.cpp:1.31 Wed Feb 26 18:38:34 2003
+++ llvm/lib/Analysis/LoopInfo.cpp Thu Feb 27 15:51:38 2003
@@ -200,6 +200,13 @@
return 0; // Multiple predecessors outside the loop
Out = *PI;
}
+
+ // Make sure there is only one exit out of the preheader...
+ succ_iterator SI = succ_begin(Out);
+ ++SI;
+ if (SI != succ_end(Out))
+ return 0; // Multiple exits from the block, must not be a preheader.
+
// If there is exactly one preheader, return it. If there was zero, then Out
// is still null.
More information about the llvm-commits
mailing list