mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
If succ has succ itself as one of the predecessors then do
not merge current bb and succ even if bb's terminator is unconditional branch to succ. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45305 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -110,10 +110,10 @@ static bool CanPropagatePredecessorsForPHIs(BasicBlock *BB, BasicBlock *Succ) {
|
||||
// update the PHI nodes correctly.
|
||||
if (!isa<PHINode>(BB->begin()) || Succ->getSinglePredecessor()) return true;
|
||||
|
||||
// If the predecessors of Succ are only BB and Succ itself, handle it.
|
||||
// If the predecessors of Succ are only BB, handle it.
|
||||
bool IsSafe = true;
|
||||
for (pred_iterator PI = pred_begin(Succ), E = pred_end(Succ); PI != E; ++PI)
|
||||
if (*PI != Succ && *PI != BB) {
|
||||
if (*PI != BB) {
|
||||
IsSafe = false;
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user