summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/Thumb
diff options
context:
space:
mode:
authorMomchil Velikov <momchil.velikov@arm.com>2017-11-27 10:13:14 +0000
committerMomchil Velikov <momchil.velikov@arm.com>2017-11-27 10:13:14 +0000
commitbd2c7eb923116a15f571bd39daf38da98d259db2 (patch)
tree11cc9baf4cc178a93f9b98485df5566879811444 /llvm/test/CodeGen/Thumb
parent26dde7719bef7d52fd872a1a78a6a62cae69e029 (diff)
downloadbcm5719-llvm-bd2c7eb923116a15f571bd39daf38da98d259db2.tar.gz
bcm5719-llvm-bd2c7eb923116a15f571bd39daf38da98d259db2.zip
[ARM] Fix an off-by-one error when restoring LR for 16-bit Thumb
The commit https://reviews.llvm.org/rL318143 computes incorrectly to offset to restore LR from. The number of tPOP operands is 2 (condition) + 2 (implicit def and use of SP) + count of the popped registers. We need to load LR from just past the last register, hence the correct offset should be either getNumOperands() - 4 and getNumExplicitOperands() - 2 (multiplied by 4). Differential revision: https://reviews.llvm.org/D40305 llvm-svn: 319014
Diffstat (limited to 'llvm/test/CodeGen/Thumb')
-rw-r--r--llvm/test/CodeGen/Thumb/thumb-shrink-wrapping.ll2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/test/CodeGen/Thumb/thumb-shrink-wrapping.ll b/llvm/test/CodeGen/Thumb/thumb-shrink-wrapping.ll
index 6bb5c81485b..07d724546e9 100644
--- a/llvm/test/CodeGen/Thumb/thumb-shrink-wrapping.ll
+++ b/llvm/test/CodeGen/Thumb/thumb-shrink-wrapping.ll
@@ -647,7 +647,7 @@ define i1 @beq_to_bx(i32* %y, i32 %head) {
; ENABLE: push {r4, lr}
; CHECK: tst r3, r4
-; ENABLE-NEXT: ldr [[POP:r[4567]]], [sp, #8]
+; ENABLE-NEXT: ldr [[POP:r[4567]]], [sp, #4]
; ENABLE-NEXT: mov lr, [[POP]]
; ENABLE-NEXT: pop {[[POP]]}
; ENABLE-NEXT: add sp, #4
OpenPOWER on IntegriCloud