mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 20:29:48 +00:00
Fix FastISel to recognize that the last block in the function does
not have a fall-through successor. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55033 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
cc8430f742
commit
e6798b757a
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user