From 53c67c0218d8420234dd71bf2d9df3388909af77 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Fri, 7 Aug 2009 05:45:07 +0000 Subject: [PATCH] tBfar is bl, which clobbers LR. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78370 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/ARM/ARMConstantIslandPass.cpp | 3 ++- lib/Target/ARM/ARMInstrThumb.td | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Target/ARM/ARMConstantIslandPass.cpp b/lib/Target/ARM/ARMConstantIslandPass.cpp index 782765a4335..2f74133a66b 100644 --- a/lib/Target/ARM/ARMConstantIslandPass.cpp +++ b/lib/Target/ARM/ARMConstantIslandPass.cpp @@ -1221,7 +1221,8 @@ bool ARMConstantIslands::FixUpUnconditionalBr(MachineFunction &MF, ImmBranch &Br) { MachineInstr *MI = Br.MI; MachineBasicBlock *MBB = MI->getParent(); - assert(isThumb && !isThumb2 && "Expected a Thumb1 function!"); + if (!isThumb1) + llvm_unreachable("FixUpUnconditionalBr is Thumb1 only!"); // Use BL to implement far jump. Br.MaxDisp = (1 << 21) * 2; diff --git a/lib/Target/ARM/ARMInstrThumb.td b/lib/Target/ARM/ARMInstrThumb.td index 9b54e67bedf..c95b1d60fc5 100644 --- a/lib/Target/ARM/ARMInstrThumb.td +++ b/lib/Target/ARM/ARMInstrThumb.td @@ -253,6 +253,7 @@ let isBranch = 1, isTerminator = 1 in { "b $target", [(br bb:$target)]>; // Far jump + let Defs = [LR] in def tBfar : TIx2<(outs), (ins brtarget:$target), IIC_Br, "bl $target\t@ far jump",[]>; -- 2.34.1