aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/ARM
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2010-06-18 20:44:28 +0000
committerDale Johannesen <dalej@apple.com>2010-06-18 20:44:28 +0000
commit10416803c1370fe1e52a7f1c431fe506be9c1ef5 (patch)
tree9100c61b597a567577162996698f22bc4991ed9b /lib/Target/ARM
parent3bf63768e574a2065de1aebba12f6c2e80f4fb16 (diff)
downloadexternal_llvm-10416803c1370fe1e52a7f1c431fe506be9c1ef5.zip
external_llvm-10416803c1370fe1e52a7f1c431fe506be9c1ef5.tar.gz
external_llvm-10416803c1370fe1e52a7f1c431fe506be9c1ef5.tar.bz2
An attempt to fix the problem Anton reported with
ARM tail calls. Don't know if it works, but it doesn't break Darwin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106309 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM')
-rw-r--r--lib/Target/ARM/ARMBaseRegisterInfo.cpp3
-rw-r--r--lib/Target/ARM/ARMInstrInfo.td6
2 files changed, 7 insertions, 2 deletions
diff --git a/lib/Target/ARM/ARMBaseRegisterInfo.cpp b/lib/Target/ARM/ARMBaseRegisterInfo.cpp
index 1b3e212..c5848d4 100644
--- a/lib/Target/ARM/ARMBaseRegisterInfo.cpp
+++ b/lib/Target/ARM/ARMBaseRegisterInfo.cpp
@@ -1658,7 +1658,8 @@ emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const {
addGlobalAddress(JumpTarget.getGlobal(), JumpTarget.getOffset(),
JumpTarget.getTargetFlags());
} else if (RetOpcode == ARM::TCRETURNdiND) {
- BuildMI(MBB, MBBI, dl, TII.get(ARM::TAILJMPdND)).
+ BuildMI(MBB, MBBI, dl,
+ TII.get(STI.isThumb() ? ARM::TAILJMPdNDt : ARM::TAILJMPdND)).
addGlobalAddress(JumpTarget.getGlobal(), JumpTarget.getOffset(),
JumpTarget.getTargetFlags());
} else if (RetOpcode == ARM::TCRETURNri) {
diff --git a/lib/Target/ARM/ARMInstrInfo.td b/lib/Target/ARM/ARMInstrInfo.td
index d95137a..1b43304 100644
--- a/lib/Target/ARM/ARMInstrInfo.td
+++ b/lib/Target/ARM/ARMInstrInfo.td
@@ -1085,7 +1085,11 @@ let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1 in {
def TAILJMPdND : ABXI<0b1010, (outs), (ins brtarget:$dst, variable_ops),
IIC_Br, "b.w\t$dst @ TAILCALL",
- []>, Requires<[IsNotDarwin]>;
+ []>, Requires<[IsARM, IsNotDarwin]>;
+
+ def TAILJMPdNDt : ABXI<0b1010, (outs), (ins brtarget:$dst, variable_ops),
+ IIC_Br, "b\t$dst @ TAILCALL",
+ []>, Requires<[IsThumb, IsNotDarwin]>;
def TAILJMPrND : AXI<(outs), (ins tGPR:$dst, variable_ops),
BrMiscFrm, IIC_Br, "bx\t$dst @ TAILCALL",