diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2009-05-03 13:15:22 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2009-05-03 13:15:22 +0000 |
commit | 8644af36903d933b6f9ae80d2d51b9e340c48452 (patch) | |
tree | 32fb9e88f3832b6424fd9f93dd842b222b278846 /lib/Target/MSP430/MSP430InstrInfo.cpp | |
parent | 49ebc2278472656e05541248eaedccb13e1b7d7d (diff) | |
download | llvm-8644af36903d933b6f9ae80d2d51b9e340c48452.tar.gz llvm-8644af36903d933b6f9ae80d2d51b9e340c48452.tar.bz2 llvm-8644af36903d933b6f9ae80d2d51b9e340c48452.tar.xz |
Add InsertBranch() hook for tail mergeing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70754 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/MSP430/MSP430InstrInfo.cpp')
-rw-r--r-- | lib/Target/MSP430/MSP430InstrInfo.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/Target/MSP430/MSP430InstrInfo.cpp b/lib/Target/MSP430/MSP430InstrInfo.cpp index 199a323bf2..39c835d92f 100644 --- a/lib/Target/MSP430/MSP430InstrInfo.cpp +++ b/lib/Target/MSP430/MSP430InstrInfo.cpp @@ -149,3 +149,29 @@ MSP430InstrInfo::restoreCalleeSavedRegisters(MachineBasicBlock &MBB, return true; } + +unsigned +MSP430InstrInfo::InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB, + MachineBasicBlock *FBB, + const SmallVectorImpl<MachineOperand> &Cond) const { + // FIXME this should probably have a DebugLoc operand + DebugLoc dl = DebugLoc::getUnknownLoc(); + + // Shouldn't be a fall through. + assert(TBB && "InsertBranch must not be told to insert a fallthrough"); + assert((Cond.size() == 1 || Cond.size() == 0) && + "MSP430 branch conditions have one component!"); + + if (Cond.empty()) { + // Unconditional branch? + assert(!FBB && "Unconditional branch with multiple successors!"); + BuildMI(&MBB, dl, get(MSP430::JMP)).addMBB(TBB); + return 1; + } + + // Conditional branch. + unsigned Count = 0; + assert(0 && "Implement conditional branches!"); + + return Count; +} |