1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00

Fix FastISel to recognize that the last block in the function does

not have a fall-through successor.

llvm-svn: 55033
This commit is contained in:
Dan Gohman 2008-08-20 01:17:01 +00:00
parent 472f4b49b6
commit d0da06c817

View File

@ -104,11 +104,14 @@ FastISel::SelectInstructions(BasicBlock::iterator Begin, BasicBlock::iterator En
// For now, check for and handle just the most trivial case: an
// unconditional fall-through branch.
if (BI->isUnconditional() &&
next(MachineFunction::iterator(MBB))->getBasicBlock() ==
BI->getSuccessor(0)) {
MBB->addSuccessor(next(MachineFunction::iterator(MBB)));
break;
if (BI->isUnconditional()) {
MachineFunction::iterator NextMBB =
next(MachineFunction::iterator(MBB));
if (NextMBB != MF->end() &&
NextMBB->getBasicBlock() == BI->getSuccessor(0)) {
MBB->addSuccessor(NextMBB);
break;
}
}
// Something more complicated. Halt "fast" selection and bail.