summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM/ARMFrameLowering.cpp
diff options
context:
space:
mode:
authorDavid Green <david.green@arm.com>2020-01-06 15:54:36 +0000
committerDavid Green <david.green@arm.com>2020-01-06 16:38:49 +0000
commitf88d52728b9c7f91e4cfec657c0fc60be07d2cb4 (patch)
tree6ab72905c7136db4a995987a5ea34b350bb0beae /llvm/lib/Target/ARM/ARMFrameLowering.cpp
parent0eb981b8ce70d07b1b1fb39b969a6fe9509840c1 (diff)
downloadbcm5719-llvm-f88d52728b9c7f91e4cfec657c0fc60be07d2cb4.tar.gz
bcm5719-llvm-f88d52728b9c7f91e4cfec657c0fc60be07d2cb4.zip
[ARM] Use the correct opcodes for Thumb2 segmented stack frame lowering
The segmented stack lowering code appears to be using ARM opcodes under Thumb2. The MRC opcode will be the same for Thumb and ARM, but t2LDR seems wrong. Either way, using the correct thumb vs arm opcodes is more correct. Differential Revision: https://reviews.llvm.org/D72074
Diffstat (limited to 'llvm/lib/Target/ARM/ARMFrameLowering.cpp')
-rw-r--r--llvm/lib/Target/ARM/ARMFrameLowering.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Target/ARM/ARMFrameLowering.cpp b/llvm/lib/Target/ARM/ARMFrameLowering.cpp
index 5428bd6c94b..cb98b2b34ef 100644
--- a/llvm/lib/Target/ARM/ARMFrameLowering.cpp
+++ b/llvm/lib/Target/ARM/ARMFrameLowering.cpp
@@ -2424,7 +2424,8 @@ void ARMFrameLowering::adjustForSegmentedStacks(
} else {
// Get TLS base address from the coprocessor
// mrc p15, #0, SR0, c13, c0, #3
- BuildMI(McrMBB, DL, TII.get(ARM::MRC), ScratchReg0)
+ BuildMI(McrMBB, DL, TII.get(Thumb ? ARM::t2MRC : ARM::MRC),
+ ScratchReg0)
.addImm(15)
.addImm(0)
.addImm(13)
@@ -2438,7 +2439,8 @@ void ARMFrameLowering::adjustForSegmentedStacks(
// Get the stack limit from the right offset
// ldr SR0, [sr0, #4 * TlsOffset]
- BuildMI(GetMBB, DL, TII.get(ARM::LDRi12), ScratchReg0)
+ BuildMI(GetMBB, DL, TII.get(Thumb ? ARM::t2LDRi12 : ARM::LDRi12),
+ ScratchReg0)
.addReg(ScratchReg0)
.addImm(4 * TlsOffset)
.add(predOps(ARMCC::AL));
OpenPOWER on IntegriCloud