summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorFrancis Visoiu Mistrih <francisvm@yahoo.com>2018-04-27 15:30:54 +0000
committerFrancis Visoiu Mistrih <francisvm@yahoo.com>2018-04-27 15:30:54 +0000
commitc855e92ca9cf817d0e816f29ca1bb2edd9380f2e (patch)
tree4383fd5edc4205b85274a011ddcc17807534eddc /llvm/test
parentffb8d8711ce6fda53ae087914f8a96a01e9b37be (diff)
downloadbcm5719-llvm-c855e92ca9cf817d0e816f29ca1bb2edd9380f2e.tar.gz
bcm5719-llvm-c855e92ca9cf817d0e816f29ca1bb2edd9380f2e.zip
[AArch64] Place the first ldp at the end when ReverseCSRRestoreSeq is true
Put the first ldp at the end, so that the load-store optimizer can run and merge the ldp and the add into a post-index ldp. This didn't work in case no frame was needed and resulted in code size regressions. llvm-svn: 331044
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/AArch64/reverse-csr-restore-seq.mir33
1 files changed, 33 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AArch64/reverse-csr-restore-seq.mir b/llvm/test/CodeGen/AArch64/reverse-csr-restore-seq.mir
index 32234fd5db2..2b168b31a51 100644
--- a/llvm/test/CodeGen/AArch64/reverse-csr-restore-seq.mir
+++ b/llvm/test/CodeGen/AArch64/reverse-csr-restore-seq.mir
@@ -7,6 +7,8 @@
define void @bar() nounwind { entry: unreachable }
+ define void @baz() nounwind { entry: unreachable }
+
...
---
name: foo
@@ -71,3 +73,34 @@ body: |
; CHECK-NEXT: $sp = frame-destroy ADDXri $sp, 80, 0
RET_ReallyLR
...
+---
+# Check that the load from the offset 0 is moved at the end even when hasFP is
+# false.
+name: baz
+# CHECK-LABEL: name: baz
+alignment: 2
+tracksRegLiveness: true
+frameInfo:
+ adjustsStack: true
+ hasCalls: true
+body: |
+ bb.0:
+ successors: %bb.1
+
+ $x0 = IMPLICIT_DEF
+ $x20 = IMPLICIT_DEF
+ $x21 = IMPLICIT_DEF
+
+ ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp
+ BL @foo, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit $x0, implicit-def $sp, implicit-def $x0
+ ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp
+ B %bb.1
+
+ bb.1:
+ ; CHECK: $x20, $lr = frame-destroy LDPXi $sp, 2
+ ; BEFORELDSTOPT-NEXT: $x21 = frame-destroy LDRXui $sp, 0
+ ; BEFORELDSTOPT-NEXT: $sp = frame-destroy ADDXri $sp, 32, 0
+
+ ; AFTERLDSTOPT-NEXT: early-clobber $sp, $x21 = frame-destroy LDRXpost $sp, 32
+ RET_ReallyLR
+...
OpenPOWER on IntegriCloud