summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/PowerPC/stack-realign.ll
diff options
context:
space:
mode:
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>2016-09-22 17:22:43 +0000
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>2016-09-22 17:22:43 +0000
commitb66efb855c14a50047bea913f2beed3bd46930c7 (patch)
treeea293a3985b263be484048b7c4e18ef26256ca05 /llvm/test/CodeGen/PowerPC/stack-realign.ll
parent0d4b6d5c9833f6c577865817649f5fa644ad5e73 (diff)
downloadbcm5719-llvm-b66efb855c14a50047bea913f2beed3bd46930c7.tar.gz
bcm5719-llvm-b66efb855c14a50047bea913f2beed3bd46930c7.zip
[PPC] Set SP after loading data from stack frame, if no red zone is present
Follow-up to r280705: Make sure that the SP is only restored after all data is loaded from the stack frame, if there is no red zone. This completes the fix for https://llvm.org/bugs/show_bug.cgi?id=26519. Differential Revision: https://reviews.llvm.org/D24466 llvm-svn: 282174
Diffstat (limited to 'llvm/test/CodeGen/PowerPC/stack-realign.ll')
-rw-r--r--llvm/test/CodeGen/PowerPC/stack-realign.ll39
1 files changed, 26 insertions, 13 deletions
diff --git a/llvm/test/CodeGen/PowerPC/stack-realign.ll b/llvm/test/CodeGen/PowerPC/stack-realign.ll
index 00cd61df7ed..d92f93b517f 100644
--- a/llvm/test/CodeGen/PowerPC/stack-realign.ll
+++ b/llvm/test/CodeGen/PowerPC/stack-realign.ll
@@ -83,18 +83,26 @@ entry:
; CHECK-32-DAG: subfic 0, [[REG]], -64
; CHECK-32: stwux 1, 1, 0
; CHECK-32: subf 0, 0, 1
-; CHECK-32: stw 30, -8(0)
-; CHECK-32: mr 30, 0
+; CHECK-32: addic 0, 0, -4
+; CHECK-32: stwx 31, 0, 0
+; CHECK-32: addic 0, 0, -4
+; CHECK-32: stwx 30, 0, 0
+; CHECK-32: addic 30, 0, 8
; CHECK-32-PIC-LABEL: @goo
; CHECK-32-PIC-DAG: mflr [[LR:[0-9]+]]
; CHECK-32-PIC-DAG: clrlwi [[REG:[0-9]+]], 1, 27
; CHECK-32-PIC-DAG: stw [[LR]], 4(1)
; CHECK-32-PIC-DAG: subfic 0, [[REG]], -64
-; CHECK-32-PIC: stwux 1, 1, 0
-; CHECK-32-PIC: subf 0, 0, 1
-; CHECK-32-PIC: stw 29, -12(0)
-; CHECK-32-PIC-DAG: mr 29, 0
+; CHECK-32-PIC: stwux 1, 1, 0
+; CHECK-32-PIC: subf 0, 0, 1
+; CHECK-32-PIC: addic 0, 0, -4
+; CHECK-32-PIC: stwx 31, 0, 0
+; CHECK-32-PIC: addic 0, 0, -4
+; CHECK-32-PIC: stwx 30, 0, 0
+; CHECK-32-PIC: addic 0, 0, -4
+; CHECK-32-PIC: stwx 29, 0, 0
+; CHECK-32-PIC: addic 29, 0, 12
; The large-frame-size case.
define void @hoo(%struct.s* byval nocapture readonly %a) {
@@ -138,9 +146,11 @@ entry:
; CHECK-32-DAG: subfc 0, [[REG3]], [[REG2]]
; CHECK-32: stwux 1, 1, 0
; CHECK-32: subf 0, 0, 1
-; CHECK-32-DAG: stw 31, -4(0)
-; CHECK-32-DAG: stw 30, -8(0)
-; CHECK-32: mr 30, 0
+; CHECK-32: addic 0, 0, -4
+; CHECK-32: stwx 31, 0, 0
+; CHECK-32: addic 0, 0, -4
+; CHECK-32: stwx 30, 0, 0
+; CHECK-32: addic 30, 0, 8
; CHECK-32: blr
@@ -152,10 +162,13 @@ entry:
; CHECK-32-PIC-DAG: ori [[REG2:[0-9]+]], [[REG1]], 51904
; CHECK-32-PIC-DAG: stw 0, 4(1)
; CHECK-32-PIC-DAG: subfc 0, [[REG3]], [[REG2]]
-; CHECK-32-PIC: stwux 1, 1, 0
-; CHECK-32-PIC: stw 29, -12(0)
-; CHECK-32-PIC: subf 0, 0, 1
-; CHECK-32-PIC: mr 29, 0
+; CHECK-32-PIC: stwux 1, 1, 0
+; CHECK-32-PIC: subf 0, 0, 1
+; CHECK-32-PIC: addic 0, 0, -4
+; CHECK-32-PIC: stwx 31, 0, 0
+; CHECK-32-PIC: addic 0, 0, -8
+; CHECK-32-PIC: stwx 29, 0, 0
+; CHECK-32-PIC: addic 29, 0, 12
; CHECK-32: blr
OpenPOWER on IntegriCloud