mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-30 16:53:02 +00:00
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. llvm-svn: 5656
This commit is contained in:
parent
e8dda81b22
commit
e1d4fb3c2c
@ -200,6 +200,13 @@ BasicBlock *Loop::getLoopPreheader() const {
|
||||
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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user