summaryrefslogtreecommitdiff
path: root/test/CodeGen/ARM/thumb1_return_sequence.ll
diff options
context:
space:
mode:
authorMomchil Velikov <momchil.velikov@arm.com>2017-10-22 11:56:35 +0000
committerMomchil Velikov <momchil.velikov@arm.com>2017-10-22 11:56:35 +0000
commit0be7a36e81d1a49c8640986402b28d842c1f54fa (patch)
tree4d2659e4f162b017d20618bf88e7b14d24ae9d7d /test/CodeGen/ARM/thumb1_return_sequence.ll
parent5631544a096b0a3b48213f757e0cd47d10afa2fd (diff)
[ARM] Dynamic stack alignment for 16-bit Thumb
This patch implements dynamic stack (re-)alignment for 16-bit Thumb. When targeting processors, which support only the 16-bit Thumb instruction set the compiler ignores the alignment attributes of automatic variables and may silently generate incorrect code. Differential revision: https://reviews.llvm.org/D38143 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316289 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/ARM/thumb1_return_sequence.ll')
-rw-r--r--test/CodeGen/ARM/thumb1_return_sequence.ll10
1 files changed, 7 insertions, 3 deletions
diff --git a/test/CodeGen/ARM/thumb1_return_sequence.ll b/test/CodeGen/ARM/thumb1_return_sequence.ll
index 67d1cad2cf6..c54712efb39 100644
--- a/test/CodeGen/ARM/thumb1_return_sequence.ll
+++ b/test/CodeGen/ARM/thumb1_return_sequence.ll
@@ -9,6 +9,8 @@ entry:
; --------
; CHECK-V4T: push {[[SAVED:(r[4567](, )?)+]], lr}
; CHECK-V4T: sub sp,
+; Stack is realigned because of the <6 x i32> type
+; CHECK-V4T: mov sp, r4
; CHECK-V5T: push {[[SAVED:(r[4567](, )?)+]], lr}
%b = alloca <6 x i32>, align 16
@@ -21,7 +23,8 @@ entry:
; Epilogue
; --------
-; CHECK-V4T: add sp,
+; Stack realignment means sp is restored from frame pointer
+; CHECK-V4T: mov sp
; CHECK-V4T-NEXT: pop {[[SAVED]]}
; The ISA for v4 does not support pop pc, so make sure we do not emit
; one even when we do not need to update SP.
@@ -70,8 +73,9 @@ entry:
; CHECK-V4T-NEXT: mov lr, [[POP_REG]]
; CHECK-V4T-NEXT: mov [[POP_REG]], r12
; CHECK-V4T: bx lr
-; CHECK-V5T: add sp,
-; CHECK-V5T-NEXT: pop {[[SAVED]]}
+; CHECK-V5T: lsls r4
+; CHECK-V5T-NEXT: mov sp, r4
+; CHECK-V5T: pop {[[SAVED]]}
; CHECK-V5T-NEXT: mov r12, [[POP_REG:r[0-7]]]
; CHECK-V5T-NEXT: pop {[[POP_REG]]}
; CHECK-V5T-NEXT: add sp,