From 319d71f44f58cebfd1fac8388961d081a44154fc Mon Sep 17 00:00:00 2001 From: Anton Korobeynikov Date: Sat, 1 May 2010 12:28:21 +0000 Subject: Do folding for indirect branches, where possible llvm-svn: 102836 --- llvm/lib/Target/MSP430/MSP430BranchSelector.cpp | 2 +- llvm/lib/Target/MSP430/MSP430InstrInfo.td | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'llvm/lib') diff --git a/llvm/lib/Target/MSP430/MSP430BranchSelector.cpp b/llvm/lib/Target/MSP430/MSP430BranchSelector.cpp index 836e4250aba..68cb342b08f 100644 --- a/llvm/lib/Target/MSP430/MSP430BranchSelector.cpp +++ b/llvm/lib/Target/MSP430/MSP430BranchSelector.cpp @@ -157,7 +157,7 @@ bool MSP430BSel::runOnMachineFunction(MachineFunction &Fn) { NewSize = 6; } // Uncond branch to the real destination. - I = BuildMI(MBB, I, dl, TII->get(MSP430::B)).addMBB(Dest); + I = BuildMI(MBB, I, dl, TII->get(MSP430::Bi)).addMBB(Dest); // Remove the old branch from the function. OldBranch->eraseFromParent(); diff --git a/llvm/lib/Target/MSP430/MSP430InstrInfo.td b/llvm/lib/Target/MSP430/MSP430InstrInfo.td index 999364872b3..6b9a2f2f29f 100644 --- a/llvm/lib/Target/MSP430/MSP430InstrInfo.td +++ b/llvm/lib/Target/MSP430/MSP430InstrInfo.td @@ -76,9 +76,6 @@ def memdst : Operand { let MIOperandInfo = (ops GR16, i16imm); } -// Branch targets have OtherVT type. -def brtarget : Operand; - // Short jump targets have OtherVT type and are printed as pcrel imm values. def jmptarget : Operand { let PrintMethod = "printPCRelImmOperand"; @@ -177,9 +174,9 @@ let isBarrier = 1 in { [(br bb:$dst)]>; let isIndirectBranch = 1 in { // Long branches - def B : I16ri<0, (outs), (ins brtarget:$dst), - "br\t$dst", - []>; + def Bi : I16ri<0, (outs), (ins i16imm:$brdst), + "br\t$brdst", + [(brind tblockaddress:$brdst)]>; def Br : I16rr<0, (outs), (ins GR16:$brdst), "mov.w\t{$brdst, pc}", [(brind GR16:$brdst)]>; -- cgit v1.2.3