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 | ef13982aa7f3e57e82cd48370e79033dff0da295 (patch) | |
tree | 6f47341879cd183ce30b0f505fbcbe431d6b4c94 /lib/Target/PowerPC/PPCInstrInfo.cpp | |
parent | cf420cca572b061fdd63587cb90904c641b6e216 (diff) | |
download | external_llvm-ef13982aa7f3e57e82cd48370e79033dff0da295.tar.gz external_llvm-ef13982aa7f3e57e82cd48370e79033dff0da295.tar.bz2 external_llvm-ef13982aa7f3e57e82cd48370e79033dff0da295.zip |
implement the BlockHasNoFallThrough hook
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31264 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/PPCInstrInfo.cpp')
-rw-r--r-- | lib/Target/PowerPC/PPCInstrInfo.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Target/PowerPC/PPCInstrInfo.cpp b/lib/Target/PowerPC/PPCInstrInfo.cpp index 63188466be..9876e3cdad 100644 --- a/lib/Target/PowerPC/PPCInstrInfo.cpp +++ b/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!"); |