1 # RUN: llc -mtriple=aarch64--linux-gnu -run-pass=aarch64-ldst-opt %s -verify-machineinstrs -o - 2>&1 | FileCheck %s
3 define void @promote-load-from-store() { ret void }
4 define void @store-pair() { ret void }
5 define void @store-pair-clearkill0() { ret void }
6 define void @store-pair-clearkill1() { ret void }
9 name: promote-load-from-store
10 tracksRegLiveness: true
13 liveins: %w1, %x0, %lr
15 STRWui killed %w1, %x0, 0 :: (store 4)
36 %w0 = LDRHHui killed %x0, 1 :: (load 2)
40 # Don't count transient instructions towards search limits.
41 # CHECK-LABEL: name: promote-load-from-store
46 tracksRegLiveness: true
49 liveins: %w1, %x0, %lr
51 STRWui %w1, %x0, 0 :: (store 4)
72 STRWui killed %w1, killed %x0, 1 :: (store 4)
76 # CHECK-LABEL: name: store-pair
79 name: store-pair-clearkill0
80 tracksRegLiveness: true
83 liveins: %w1, %x0, %lr
85 STRWui %w1, %x0, 0 :: (store 4)
88 STRWui killed %w1, killed %x0, 1 :: (store 4)
91 # When merging a lower store with an upper one, we must clear kill flags on
93 # CHECK-LABEL: store-pair-clearkill0
94 # CHECK-NOT: STPWi %w1, killed %w1, %x0, 0 :: (store 4)
95 # CHECK: STPWi %w1, %w1, %x0, 0 :: (store 4)
96 # CHECK: %w2 = COPY %w1
99 name: store-pair-clearkill1
100 tracksRegLiveness: true
107 STRWui %w1, %x0, 1 :: (store 4)
108 %w2 = COPY killed %w1
109 STRWui killed %w2, %x0, 0 :: (store 4)
113 STRWui %w1, %x0, 0 :: (store 4)
114 %w2 = COPY killed %w1
115 STRWui killed %w2, killed %x0, 1 :: (store 4)
119 # When merging an upper store with a lower one, kill flags along the way need
120 # to be removed; In this case the kill flag on %w1.
121 # CHECK-LABEL: store-pair-clearkill1
122 # CHECK: %w1 = MOVi32imm
123 # CHECK: %w2 = MOVi32imm
124 # CHECK-NOT: %w2 = COPY killed %w1
125 # CHECK: %w2 = COPY %w1
126 # CHECK: STPWi killed %w2, %w1, %x0, 0
128 # CHECK: %w1 = MOVi32imm
129 # CHECK: %w2 = MOVi32imm
130 # CHECK-NOT: %w2 = COPY killed %w1
131 # CHECK: %w2 = COPY %w1
132 # CHECK: STPWi %w1, killed %w2, killed %x0, 0