1 # RUN: llc -o - %s -mtriple=aarch64 -mcpu=cortex-a55 -lsr-preferred-addressing-mode=preindexed -stop-after=aarch64-ldst-opt | FileCheck %s
4 name: 1-strwpre-strwui-merge
6 tracksRegLiveness: true
18 liveins: $w1, $w2, $x0
19 ; CHECK-LABEL: name: 1-strwpre-strwui-merge
20 ; CHECK: liveins: $w1, $w2, $x0
21 ; CHECK: early-clobber $x0 = STPWpre renamable $w1, renamable $w2, renamable $x0, 5 :: (store (s32))
22 ; CHECK: RET undef $lr, implicit $x0
23 early-clobber renamable $x0 = STRWpre killed renamable $w1, killed renamable $x0, 20 :: (store (s32))
24 STRWui killed renamable $w2, renamable $x0, 1 :: (store (s32))
25 RET undef $lr, implicit $x0
31 name: 2-strxpre-strxui-merge
33 tracksRegLiveness: true
45 liveins: $x0, $x1, $x2
47 ; CHECK-LABEL: name: 2-strxpre-strxui-merge
48 ; CHECK: liveins: $x0, $x1, $x2
49 ; CHECK: early-clobber $x0 = STPXpre renamable $x1, renamable $x2, renamable $x0, 3 :: (store (s64))
50 ; CHECK: RET undef $lr, implicit $x0
51 early-clobber renamable $x0 = STRXpre killed renamable $x1, killed renamable $x0, 24 :: (store (s64))
52 STRXui killed renamable $x2, renamable $x0, 1 :: (store (s64))
53 RET undef $lr, implicit $x0
59 name: 3-strspre-strsui-merge
61 tracksRegLiveness: true
73 liveins: $s0, $s1, $x0
74 ; CHECK-LABEL: name: 3-strspre-strsui-merge
75 ; CHECK: liveins: $s0, $s1, $x0
76 ; CHECK: early-clobber $x0 = STPSpre renamable $s0, renamable $s1, renamable $x0, 3 :: (store (s32))
77 ; CHECK: RET undef $lr, implicit $x0
78 early-clobber renamable $x0 = STRSpre killed renamable $s0, killed renamable $x0, 12 :: (store (s32))
79 STRSui killed renamable $s1, renamable $x0, 1 :: (store (s32))
80 RET undef $lr, implicit $x0
85 name: 4-strdpre-strdui-merge
87 tracksRegLiveness: true
99 liveins: $d0, $d1, $x0
101 ; CHECK-LABEL: name: 4-strdpre-strdui-merge
102 ; CHECK: liveins: $d0, $d1, $x0
103 ; CHECK: early-clobber $x0 = STPDpre renamable $d0, renamable $d1, renamable $x0, 16 :: (store (s64))
104 ; CHECK: RET undef $lr, implicit $x0
105 early-clobber renamable $x0 = STRDpre killed renamable $d0, killed renamable $x0, 128 :: (store (s64))
106 STRDui killed renamable $d1, renamable $x0, 1 :: (store (s64))
107 RET undef $lr, implicit $x0
113 name: 5-strqpre-strqui-merge
115 tracksRegLiveness: true
127 liveins: $q0, $q1, $x0
129 ; CHECK-LABEL: name: 5-strqpre-strqui-merge
130 ; CHECK: liveins: $q0, $q1, $x0
131 ; CHECK: early-clobber $x0 = STPQpre renamable $q0, renamable $q1, renamable $x0, 3 :: (store (s128))
132 ; CHECK: RET undef $lr, implicit $x0
133 early-clobber renamable $x0 = STRQpre killed renamable $q0, killed renamable $x0, 48 :: (store (s128))
134 STRQui killed renamable $q1, renamable $x0, 1 :: (store (s128))
135 RET undef $lr, implicit $x0
141 name: 6-strqui-strqpre-no-merge
143 tracksRegLiveness: true
155 liveins: $q0, $q1, $x0
156 ; CHECK-LABEL: name: 6-strqui-strqpre-no-merge
157 ; CHECK: liveins: $q0, $q1, $x0
158 ; CHECK: STRQui renamable $q1, renamable $x0, 1 :: (store (s128))
159 ; CHECK: early-clobber renamable $x0 = STRQpre renamable $q0, renamable $x0, 48, implicit $w0, implicit $w0_hi :: (store (s128))
160 ; CHECK: RET undef $lr, implicit $x0
161 STRQui killed renamable $q1, renamable $x0, 1 :: (store (s128))
162 early-clobber renamable $x0 = STRQpre killed renamable $q0, killed renamable $x0, 48 :: (store (s128))
163 RET undef $lr, implicit $x0
168 name: 7-strspre-strsui-max-offset-merge
170 tracksRegLiveness: true
182 liveins: $s0, $s1, $x0
183 ; CHECK-LABEL: name: 7-strspre-strsui-max-offset-merge
184 ; CHECK: liveins: $s0, $s1, $x0
185 ; CHECK: early-clobber $x0 = STPSpre renamable $s0, renamable $s1, renamable $x0, 63 :: (store (s32))
186 ; CHECK: RET undef $lr, implicit $x0
187 early-clobber renamable $x0 = STRSpre killed renamable $s0, killed renamable $x0, 252 :: (store (s32))
188 STRSui killed renamable $s1, renamable $x0, 1 :: (store (s32))
189 RET undef $lr, implicit $x0
194 name: 8-strspre-strsui-min-offset-merge
196 tracksRegLiveness: true
208 liveins: $s0, $s1, $x0
209 ; CHECK-LABEL: name: 8-strspre-strsui-min-offset-merge
210 ; CHECK: liveins: $s0, $s1, $x0
211 ; CHECK: early-clobber $x0 = STPSpre renamable $s0, renamable $s1, renamable $x0, -64 :: (store (s32))
212 ; CHECK: RET undef $lr, implicit $x0
213 early-clobber renamable $x0 = STRSpre killed renamable $s0, killed renamable $x0, -256 :: (store (s32))
214 STRSui killed renamable $s1, renamable $x0, 1 :: (store (s32))
215 RET undef $lr, implicit $x0
220 name: 9-strspre-strsui-mod-base-reg-no-merge
222 tracksRegLiveness: true
235 liveins: $s0, $s1, $x0, $x1
236 ; CHECK-LABEL: name: 9-strspre-strsui-mod-base-reg-no-merge
237 ; CHECK: liveins: $s0, $s1, $x0, $x1
238 ; CHECK: dead early-clobber renamable $x0 = STRSpre renamable $s0, renamable $x0, 12, implicit $w0, implicit $w0_hi :: (store (s32))
239 ; CHECK: renamable $x0 = LDRXui renamable $x1, 1 :: (load (s64))
240 ; CHECK: STRSui renamable $s1, renamable $x0, 1 :: (store (s32))
241 ; CHECK: RET undef $lr, implicit $x0
242 early-clobber renamable $x0 = STRSpre killed renamable $s0, killed renamable $x0, 12 :: (store (s32))
243 renamable $x0 = LDRXui renamable $x1, 1 :: (load (s64))
244 STRSui killed renamable $s1, renamable $x0, 1 :: (store (s32))
245 RET undef $lr, implicit $x0
250 name: 10-strspre-strsui-used-base-reg-no-merge
252 tracksRegLiveness: true
265 liveins: $s0, $s1, $x0, $x1
266 ; CHECK-LABEL: name: 10-strspre-strsui-used-base-reg-no-merge
267 ; CHECK: liveins: $s0, $s1, $x0, $x1
268 ; CHECK: early-clobber renamable $x0 = STRSpre renamable $s0, renamable $x0, 12, implicit $w0, implicit $w0_hi :: (store (s32))
269 ; CHECK: STRXui renamable $x1, renamable $x1, 1 :: (store (s32))
270 ; CHECK: STRSui renamable $s1, renamable $x0, 1 :: (store (s32))
271 ; CHECK: RET undef $lr, implicit $x0
272 early-clobber renamable $x0 = STRSpre killed renamable $s0, killed renamable $x0, 12 :: (store (s32))
274 STRXui killed renamable $x1, renamable $x1, 1 :: (store (s32))
276 STRSui killed renamable $s1, renamable $x0, 1 :: (store (s32))
277 RET undef $lr, implicit $x0
282 name: 11-strspre-strspre-no-merge
284 tracksRegLiveness: true
296 liveins: $s0, $s1, $x0
297 ; CHECK-LABEL: name: 11-strspre-strspre-no-merge
298 ; CHECK: liveins: $s0, $s1, $x0
299 ; CHECK: early-clobber renamable $x0 = STRSpre renamable $s0, renamable $x0, 12, implicit $w0, implicit $w0_hi :: (store (s32))
300 ; CHECK: early-clobber renamable $x0 = STRSpre renamable $s1, renamable $x0, 16, implicit $w0, implicit $w0_hi :: (store (s32))
301 ; CHECK: early-clobber renamable $x0 = STRSpre renamable $s0, renamable $x0, 4, implicit $w0, implicit $w0_hi :: (store (s32))
302 ; CHECK: early-clobber renamable $x0 = STRSpre renamable $s1, renamable $x0, 12, implicit $w0, implicit $w0_hi :: (store (s32))
303 ; CHECK: early-clobber renamable $x0 = STRSpre renamable $s0, renamable $x0, 4, implicit $w0, implicit $w0_hi :: (store (s32))
304 ; CHECK: early-clobber renamable $x0 = STRSpre renamable $s1, renamable $x0, 4, implicit $w0, implicit $w0_hi :: (store (s32))
305 ; CHECK: RET undef $lr, implicit $x0
306 early-clobber renamable $x0 = STRSpre renamable $s0, killed renamable $x0, 12 :: (store (s32))
307 early-clobber renamable $x0 = STRSpre renamable $s1, killed renamable $x0, 16 :: (store (s32))
308 early-clobber renamable $x0 = STRSpre renamable $s0, killed renamable $x0, 4 :: (store (s32))
309 early-clobber renamable $x0 = STRSpre renamable $s1, killed renamable $x0, 12 :: (store (s32))
310 early-clobber renamable $x0 = STRSpre renamable $s0, killed renamable $x0, 4 :: (store (s32))
311 early-clobber renamable $x0 = STRSpre renamable $s1, killed renamable $x0, 4 :: (store (s32))
312 RET undef $lr, implicit $x0
317 name: 12-strspre-strsui-no-merge
319 tracksRegLiveness: true
332 ; The offset of the second st is not equal to the
333 ; size of the destination register, and hence can’t be merged.
335 liveins: $s0, $s1, $x0
336 ; CHECK-LABEL: name: 12-strspre-strsui-no-merge
337 ; CHECK: liveins: $s0, $s1, $x0
338 ; CHECK: early-clobber renamable $x0 = STRSpre renamable $s0, renamable $x0, 12, implicit $w0, implicit $w0_hi :: (store (s32))
339 ; CHECK: STRSui renamable $s1, renamable $x0, 2 :: (store (s32))
340 ; CHECK: RET undef $lr, implicit $x0
341 early-clobber renamable $x0 = STRSpre killed renamable $s0, killed renamable $x0, 12 :: (store (s32))
342 STRSui killed renamable $s1, renamable $x0, 2 :: (store (s32))
343 RET undef $lr, implicit $x0
348 name: 13-strqpre-sturqi-merge
350 tracksRegLiveness: true
362 liveins: $q0, $q1, $x0
364 ; CHECK-LABEL: name: 13-strqpre-sturqi-merge
365 ; CHECK: liveins: $q0, $q1, $x0
366 ; CHECK: early-clobber $x0 = STPQpre renamable $q0, renamable $q1, renamable $x0, 3 :: (store (s128))
367 ; CHECK: RET undef $lr, implicit $x0
368 early-clobber renamable $x0 = STRQpre killed renamable $q0, killed renamable $x0, 48 :: (store (s128))
369 STURQi killed renamable $q1, renamable $x0, 16 :: (store (s128))
370 RET undef $lr, implicit $x0
376 name: 14-strqpre-sturqi-no-merge
378 tracksRegLiveness: true
390 liveins: $q0, $q1, $x0
391 ; CHECK-LABEL: name: 14-strqpre-sturqi-no-merge
392 ; CHECK: liveins: $q0, $q1, $x0
393 ; CHECK: early-clobber renamable $x0 = STRQpre renamable $q0, renamable $x0, 48, implicit $w0, implicit $w0_hi :: (store (s128))
394 ; CHECK: STURQi renamable $q1, renamable $x0, 1 :: (store (s128))
395 ; CHECK: RET undef $lr, implicit $x0
396 early-clobber renamable $x0 = STRQpre killed renamable $q0, killed renamable $x0, 48 :: (store (s128))
397 STURQi killed renamable $q1, renamable $x0, 1 :: (store (s128))
398 RET undef $lr, implicit $x0
403 name: 15-strspre-strsui-unaligned-no-merge
405 tracksRegLiveness: true
417 liveins: $s0, $s1, $x0
418 ; CHECK-LABEL: name: 15-strspre-strsui-unaligned-no-merge
419 ; CHECK: liveins: $s0, $s1, $x0
420 ; CHECK: early-clobber renamable $x0 = STRSpre renamable $s0, renamable $x0, 251, implicit $w0, implicit $w0_hi :: (store (s32))
421 ; CHECK: STRSui renamable $s1, renamable $x0, 1 :: (store (s32))
422 ; CHECK: RET undef $lr, implicit $x0
423 early-clobber renamable $x0 = STRSpre killed renamable $s0, killed renamable $x0, 251 :: (store (s32))
424 STRSui killed renamable $s1, renamable $x0, 1 :: (store (s32))
425 RET undef $lr, implicit $x0
429 name: 16-strxpre-strxui-same-reg-no-merge
431 tracksRegLiveness: true
443 liveins: $x0, $x1, $x2
444 ; CHECK-LABEL: name: 16-strxpre-strxui-same-reg-no-merge
445 ; CHECK: liveins: $x0, $x1, $x2
446 ; CHECK: early-clobber renamable $x0 = STRXpre renamable $x1, renamable $x0, 24, implicit $w0, implicit $w0_hi :: (store (s64))
447 ; CHECK: STRXui renamable $x0, renamable $x0, 1 :: (store (s64))
448 ; CHECK: RET undef $lr, implicit $x0
449 early-clobber renamable $x0 = STRXpre killed renamable $x1, killed renamable $x0, 24 :: (store (s64))
450 STRXui renamable $x0, renamable $x0, 1 :: (store (s64))
451 RET undef $lr, implicit $x0
456 name: 17-strwpre-strwui-same-reg-no-merge
458 tracksRegLiveness: true
470 liveins: $x0, $x1, $x2
471 ; CHECK-LABEL: name: 17-strwpre-strwui-same-reg-no-merge
472 ; CHECK: liveins: $x0, $x1, $x2
473 ; CHECK: early-clobber renamable $x0 = STRWpre renamable $w1, renamable $x0, 24, implicit $w0, implicit $w0_hi, implicit-def $w0 :: (store (s32))
474 ; CHECK: STRWui renamable $w0, renamable $x0, 1 :: (store (s32))
475 ; CHECK: RET undef $lr, implicit $x0
476 early-clobber renamable $x0 = STRWpre killed renamable $w1, killed renamable $x0, 24 :: (store (s32))
477 STRWui renamable $w0, renamable $x0, 1 :: (store (s32))
478 RET undef $lr, implicit $x0