diff options
author | Chris Lattner <sabre@nondot.org> | 2006-10-28 17:35:02 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-10-28 17:35:02 +0000 |
commit | 113f7470e6671f7fd09cfc3d78511fe545806237 (patch) | |
tree | de5e9b86cec63a2464a4f288170820c412612279 /llvm/lib/Target/PowerPC/PPCInstrInfo.cpp | |
parent | af8383806bdd4fda21567a02f3ecb9ebb9704239 (diff) | |
download | bcm5719-llvm-113f7470e6671f7fd09cfc3d78511fe545806237.tar.gz bcm5719-llvm-113f7470e6671f7fd09cfc3d78511fe545806237.zip |
implement the BlockHasNoFallThrough hook
llvm-svn: 31264
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCInstrInfo.cpp')
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCInstrInfo.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp b/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp index 63188466bed..9876e3cdad8 100644 --- a/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp +++ b/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp @@ -259,6 +259,17 @@ void PPCInstrInfo::InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB, BuildMI(&MBB, PPC::B, 1).addMBB(FBB); } +bool PPCInstrInfo::BlockHasNoFallThrough(MachineBasicBlock &MBB) const { + if (MBB.empty()) return false; + + switch (MBB.back().getOpcode()) { + case PPC::B: // Uncond branch. + case PPC::BCTR: // Indirect branch. + return true; + default: return false; + } +} + bool PPCInstrInfo:: ReverseBranchCondition(std::vector<MachineOperand> &Cond) const { assert(Cond.size() == 2 && "Invalid PPC branch opcode!"); |