summaryrefslogtreecommitdiff
path: root/test/CodeGen/AArch64/ldst-opt.mir
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/AArch64/ldst-opt.mir')
-rw-r--r--test/CodeGen/AArch64/ldst-opt.mir39
1 files changed, 38 insertions, 1 deletions
diff --git a/test/CodeGen/AArch64/ldst-opt.mir b/test/CodeGen/AArch64/ldst-opt.mir
index f7641d3ffd04..9cb9528cc62e 100644
--- a/test/CodeGen/AArch64/ldst-opt.mir
+++ b/test/CodeGen/AArch64/ldst-opt.mir
@@ -34,7 +34,7 @@ body: |
# Don't count transient instructions towards search limits.
# CHECK-LABEL: name: promote-load-from-store
# CHECK: STRWui %w1
-# CHECK: UBFMWri %w1
+# CHECK: UBFMWri killed %w1
---
name: store-pair
tracksRegLiveness: true
@@ -144,3 +144,40 @@ body: |
# CHECK: %wzr = COPY %w1
# CHECK: %w11 = ORRWrs %wzr, %w1, 0
# CHECK: HINT 0, implicit %w11
+---
+name: promote-load-from-store-undef
+tracksRegLiveness: true
+body: |
+ bb.0:
+ liveins: %x0, %x2, %lr
+
+ STRWui undef %w1, %x0, 0 :: (store 4)
+ %w0 = LDRBBui %x0, 1 :: (load 2)
+ STRHHui undef %w3, %x2, 0 :: (store 4)
+ %w1 = LDRBBui %x2, 0 :: (load 4)
+ RET %lr, implicit %w0
+...
+# CHECK-LABEL: name: promote-load-from-store-undef
+# CHECK: STRWui undef %w1
+# CHECK: UBFMWri undef %w1
+# CHECK: STRHHui undef %w3
+# CHECK: ANDWri undef %w3
+---
+name: promote-load-from-store-trivial-kills
+tracksRegLiveness: true
+body: |
+ bb.0:
+ liveins: %x0, %lr
+
+ STRXui %x0, %sp, 0 :: (store 8)
+ STRXui killed %x0, %sp, 2 :: (store 8)
+ %x0 = LDRXui %sp, 0 :: (load 8)
+ BL $bar, csr_aarch64_aapcs, implicit-def %lr, implicit %sp, implicit %x0, implicit-def %sp
+ RET %lr
+...
+# CHECK-LABEL: name: promote-load-from-store-trivial-kills
+# CHECK: STRXui %x0, %sp, 0
+# CHECK: STRXui %x0, %sp, 2
+# CHECK-NOT: LDRXui
+# CHECK-NOT: ORR
+# CHECK: BL $bar, csr_aarch64_aapcs, implicit-def %lr, implicit %sp, implicit %x0, implicit-def %sp