summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/MSP430/MSP430InstrInfo.cpp
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2009-05-03 13:15:22 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2009-05-03 13:15:22 +0000
commit41917df6432fec89e977475bfde0bb965252ed0a (patch)
treecad13d93fe2fe623b5c3c353b3fb6967ff0c411d /llvm/lib/Target/MSP430/MSP430InstrInfo.cpp
parent4b0a0f18fbd220fda5171cda7e149de014204613 (diff)
downloadbcm5719-llvm-41917df6432fec89e977475bfde0bb965252ed0a.tar.gz
bcm5719-llvm-41917df6432fec89e977475bfde0bb965252ed0a.zip
Add InsertBranch() hook for tail mergeing
llvm-svn: 70754
Diffstat (limited to 'llvm/lib/Target/MSP430/MSP430InstrInfo.cpp')
-rw-r--r--llvm/lib/Target/MSP430/MSP430InstrInfo.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/llvm/lib/Target/MSP430/MSP430InstrInfo.cpp b/llvm/lib/Target/MSP430/MSP430InstrInfo.cpp
index 199a323bf2b..39c835d92f6 100644
--- a/llvm/lib/Target/MSP430/MSP430InstrInfo.cpp
+++ b/llvm/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;
+}
OpenPOWER on IntegriCloud