Fix r114632. Return if the only terminator is an unconditional branch after the redundant ones are deleted.

llvm-svn: 114688
This commit is contained in:
Evan Cheng 2010-09-23 19:42:03 +00:00
parent 836341a17a
commit 1596f7f6f3
1 changed files with 5 additions and 3 deletions

View File

@ -284,9 +284,11 @@ ARMBaseInstrInfo::AnalyzeBranch(MachineBasicBlock &MBB,MachineBasicBlock *&TBB,
LastInst->eraseFromParent();
LastInst = SecondLastInst;
LastOpc = LastInst->getOpcode();
if (I == MBB.begin() || !isUnpredicatedTerminator(--I))
break;
else {
if (I == MBB.begin() || !isUnpredicatedTerminator(--I)) {
// Return now the only terminator is an unconditional branch.
TBB = LastInst->getOperand(0).getMBB();
return false;
} else {
SecondLastInst = I;
SecondLastOpc = SecondLastInst->getOpcode();
}