diff options
author | Dan Gohman <gohman@apple.com> | 2008-08-19 22:31:46 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-08-19 22:31:46 +0000 |
commit | 214343fbbed7e37f9b68f1d1bf2fc141244df13d (patch) | |
tree | 2a17bcddf9a9806526e49df996111444d908d575 /llvm/lib | |
parent | 19edd216f2470e78c5a9c6d9e539e4c3a1d7695c (diff) | |
download | bcm5719-llvm-214343fbbed7e37f9b68f1d1bf2fc141244df13d.tar.gz bcm5719-llvm-214343fbbed7e37f9b68f1d1bf2fc141244df13d.zip |
Support unconditional fall-through branches in FastISel.
llvm-svn: 55014
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp index 5a7c8964750..ab6c80e1827 100644 --- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -11,6 +11,7 @@ // //===----------------------------------------------------------------------===// +#include "llvm/Instructions.h" #include "llvm/CodeGen/FastISel.h" #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineRegisterInfo.h" @@ -41,6 +42,21 @@ FastISel::SelectInstructions(BasicBlock::iterator Begin, BasicBlock::iterator En ValueMap[I] = ResultReg; break; } + case Instruction::Br: { + BranchInst *BI = cast<BranchInst>(I); + + // 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; + } + + // Something more complicated. Halt "fast" selection and bail. + return I; + } default: // Unhandled instruction. Halt "fast" selection and bail. return I; |