diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-03-05 21:49:10 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-03-05 21:49:10 +0000 |
commit | b0503beff1e74ff19fec9a99585ba18a333ba9c4 (patch) | |
tree | 17511eb6caf473713362b7e7312e49039a1125f6 /llvm/lib/CodeGen | |
parent | 1e1973c0ebc5d2e17065c54f45ace43f7fa00d1a (diff) | |
download | bcm5719-llvm-b0503beff1e74ff19fec9a99585ba18a333ba9c4.tar.gz bcm5719-llvm-b0503beff1e74ff19fec9a99585ba18a333ba9c4.zip |
Avoid creating bad PHI instructions when BR is being const-folded.
llvm-svn: 97836
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index f426fb1f3fa..05f9f1ff186 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -1038,6 +1038,8 @@ SelectionDAGISel::FinishBasicBlock() { MachineInstr *PHI = SDB->PHINodesToUpdate[i].first; assert(PHI->isPHI() && "This is not a machine PHI node that we are updating!"); + if (!BB->isSuccessor(PHI->getParent())) + continue; PHI->addOperand(MachineOperand::CreateReg(SDB->PHINodesToUpdate[i].second, false)); PHI->addOperand(MachineOperand::CreateMBB(BB)); |