forked from OSchip/llvm-project
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:
parent
5dd15a3c45
commit
e8f9a00424
|
@ -104,12 +104,15 @@ 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)));
|
||||
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.
|
||||
return I;
|
||||
|
|
Loading…
Reference in New Issue