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 | 580bba2b0dd2173c899699a87e109bfd1482c001 (patch) | |
| tree | d3c34ca97f7926daff5bb2626cfd94b94f3876f0 /lib/CodeGen | |
| parent | 8d50ea760322630dbb9ab6436ca356b279adee10 (diff) | |
Avoid creating bad PHI instructions when BR is being const-folded.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97836 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
| -rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index f426fb1f3f..05f9f1ff18 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/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)); |
