1 # RUN: llc -mtriple=aarch64-linux-gnu -run-pass=greedy %s -o - | FileCheck %s
2 # RUN: llc -mtriple=aarch64-linux-gnu -start-before=greedy -stop-after=aarch64-expand-pseudo -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=EXPAND
5 source_filename = "<stdin>"
6 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
7 target triple = "aarch64--linux-gnu"
9 define aarch64_sve_vector_pcs void @spills_fills_stack_id_ppr() #0 { entry: unreachable }
10 define aarch64_sve_vector_pcs void @spills_fills_stack_id_ppr2() #0 { entry: unreachable }
11 define aarch64_sve_vector_pcs void @spills_fills_stack_id_ppr2mul2() #0 { entry: unreachable }
12 define aarch64_sve_vector_pcs void @spills_fills_stack_id_pnr() #1 { entry: unreachable }
13 define aarch64_sve_vector_pcs void @spills_fills_stack_id_virtreg_pnr() #1 { entry: unreachable }
14 define aarch64_sve_vector_pcs void @spills_fills_stack_id_virtreg_ppr_to_pnr() #1 { entry: unreachable }
15 define aarch64_sve_vector_pcs void @spills_fills_stack_id_zpr() #0 { entry: unreachable }
16 define aarch64_sve_vector_pcs void @spills_fills_stack_id_zpr2() #0 { entry: unreachable }
17 define aarch64_sve_vector_pcs void @spills_fills_stack_id_zpr2strided() #0 { entry: unreachable }
18 define aarch64_sve_vector_pcs void @spills_fills_stack_id_zpr3() #0 { entry: unreachable }
19 define aarch64_sve_vector_pcs void @spills_fills_stack_id_zpr4() #0 { entry: unreachable }
20 define aarch64_sve_vector_pcs void @spills_fills_stack_id_zpr4strided() #0 { entry: unreachable }
22 attributes #0 = { nounwind "target-features"="+sve" }
23 attributes #1 = { nounwind "target-features"="+sve2p1" }
27 name: spills_fills_stack_id_ppr
28 tracksRegLiveness: true
30 - { id: 0, class: ppr }
33 - { reg: '$p0', virtual-reg: '%0' }
38 ; CHECK-LABEL: name: spills_fills_stack_id_ppr
40 ; CHECK: - { id: 0, name: '', type: spill-slot, offset: 0, size: 2, alignment: 2
41 ; CHECK-NEXT: stack-id: scalable-vector, callee-saved-register: ''
43 ; EXPAND-LABEL: name: spills_fills_stack_id_ppr
44 ; EXPAND: STR_PXI $p0, $sp, 7
45 ; EXPAND: $p0 = LDR_PXI $sp, 7
70 name: spills_fills_stack_id_ppr2
71 tracksRegLiveness: true
73 - { id: 0, class: ppr2 }
76 - { reg: '$p0_p1', virtual-reg: '%0' }
81 ; CHECK-LABEL: name: spills_fills_stack_id_ppr2
83 ; CHECK: - { id: 0, name: '', type: spill-slot, offset: 0, size: 4, alignment: 2
84 ; CHECK-NEXT: stack-id: scalable-vector, callee-saved-register: ''
86 ; EXPAND-LABEL: name: spills_fills_stack_id_ppr2
87 ; EXPAND: STR_PXI $p0, $sp, 6
88 ; EXPAND: STR_PXI $p1, $sp, 7
89 ; EXPAND: $p0 = LDR_PXI $sp, 6
90 ; EXPAND: $p1 = LDR_PXI $sp, 7
115 name: spills_fills_stack_id_ppr2mul2
116 tracksRegLiveness: true
118 - { id: 0, class: ppr2mul2 }
121 - { reg: '$p0_p1', virtual-reg: '%0' }
126 ; CHECK-LABEL: name: spills_fills_stack_id_ppr2
128 ; CHECK: - { id: 0, name: '', type: spill-slot, offset: 0, size: 4, alignment: 2
129 ; CHECK-NEXT: stack-id: scalable-vector, callee-saved-register: ''
131 ; EXPAND-LABEL: name: spills_fills_stack_id_ppr2mul2
132 ; EXPAND: STR_PXI $p0, $sp, 6
133 ; EXPAND: STR_PXI $p1, $sp, 7
134 ; EXPAND: $p0 = LDR_PXI $sp, 6
135 ; EXPAND: $p1 = LDR_PXI $sp, 7
137 %0:ppr2mul2 = COPY $p0_p1
160 name: spills_fills_stack_id_pnr
161 tracksRegLiveness: true
163 - { id: 0, class: pnr }
166 - { reg: '$pn0', virtual-reg: '%0' }
171 ; CHECK-LABEL: name: spills_fills_stack_id_pnr
173 ; CHECK: - { id: 0, name: '', type: spill-slot, offset: 0, size: 2, alignment: 2
174 ; CHECK-NEXT: stack-id: scalable-vector, callee-saved-register: ''
176 ; EXPAND-LABEL: name: spills_fills_stack_id_pnr
177 ; EXPAND: STR_PXI $pn0, $sp, 7
178 ; EXPAND: $pn0 = LDR_PXI $sp, 7, implicit-def $pn0
203 name: spills_fills_stack_id_virtreg_pnr
204 tracksRegLiveness: true
206 - { id: 0, class: pnr_p8to15 }
210 ; CHECK-LABEL: name: spills_fills_stack_id_virtreg_pnr
212 ; CHECK: - { id: 0, name: '', type: spill-slot, offset: 0, size: 2, alignment: 2
213 ; CHECK-NEXT: stack-id: scalable-vector, callee-saved-register: ''
215 ; EXPAND-LABEL: name: spills_fills_stack_id_virtreg_pnr
216 ; EXPAND: renamable $pn8 = WHILEGE_CXX_B
217 ; EXPAND: STR_PXI killed renamable $pn8, $sp, 7
219 ; EXPAND: renamable $pn8 = LDR_PXI $sp, 7
220 ; EXPAND-NEXT: $p0 = PEXT_PCI_B killed renamable $pn8, 0
223 %0:pnr_p8to15 = WHILEGE_CXX_B undef $x0, undef $x0, 0, implicit-def dead $nzcv
242 $p0 = PEXT_PCI_B %0, 0
246 name: spills_fills_stack_id_virtreg_ppr_to_pnr
247 tracksRegLiveness: true
249 - { id: 0, class: ppr }
250 - { id: 1, class: pnr_p8to15 }
275 %1:pnr_p8to15 = COPY %0
276 $p0 = PEXT_PCI_B %1, 0
280 name: spills_fills_stack_id_zpr
281 tracksRegLiveness: true
283 - { id: 0, class: zpr }
286 - { reg: '$z0', virtual-reg: '%0' }
291 ; CHECK-LABEL: name: spills_fills_stack_id_zpr
293 ; CHECK: - { id: 0, name: '', type: spill-slot, offset: 0, size: 16, alignment: 16
294 ; CHECK-NEXT: stack-id: scalable-vector, callee-saved-register: ''
296 ; EXPAND-LABEL: name: spills_fills_stack_id_zpr
297 ; EXPAND: STR_ZXI $z0, $sp, 0
298 ; EXPAND: $z0 = LDR_ZXI $sp, 0
302 $z0_z1_z2_z3 = IMPLICIT_DEF
303 $z4_z5_z6_z7 = IMPLICIT_DEF
304 $z8_z9_z10_z11 = IMPLICIT_DEF
305 $z12_z13_z14_z15 = IMPLICIT_DEF
306 $z16_z17_z18_z19 = IMPLICIT_DEF
307 $z20_z21_z22_z23 = IMPLICIT_DEF
308 $z24_z25_z26_z27 = IMPLICIT_DEF
309 $z28_z29_z30_z31 = IMPLICIT_DEF
315 name: spills_fills_stack_id_zpr2
316 tracksRegLiveness: true
318 - { id: 0, class: zpr2 }
321 - { reg: '$z0_z1', virtual-reg: '%0' }
326 ; CHECK-LABEL: name: spills_fills_stack_id_zpr2
328 ; CHECK: - { id: 0, name: '', type: spill-slot, offset: 0, size: 32, alignment: 16
329 ; CHECK-NEXT: stack-id: scalable-vector
331 ; EXPAND-LABEL: name: spills_fills_stack_id_zpr2
332 ; EXPAND: STR_ZXI $z0, $sp, 0
333 ; EXPAND: STR_ZXI $z1, $sp, 1
334 ; EXPAND: $z0 = LDR_ZXI $sp, 0
335 ; EXPAND: $z1 = LDR_ZXI $sp, 1
337 %0:zpr2 = COPY $z0_z1
339 $z0_z1_z2_z3 = IMPLICIT_DEF
340 $z4_z5_z6_z7 = IMPLICIT_DEF
341 $z8_z9_z10_z11 = IMPLICIT_DEF
342 $z12_z13_z14_z15 = IMPLICIT_DEF
343 $z16_z17_z18_z19 = IMPLICIT_DEF
344 $z20_z21_z22_z23 = IMPLICIT_DEF
345 $z24_z25_z26_z27 = IMPLICIT_DEF
346 $z28_z29_z30_z31 = IMPLICIT_DEF
352 name: spills_fills_stack_id_zpr2strided
353 tracksRegLiveness: true
355 - { id: 0, class: zpr2strided }
358 - { reg: '$z0_z8', virtual-reg: '%0' }
371 ; CHECK-LABEL: name: spills_fills_stack_id_zpr2strided
373 ; CHECK: - { id: 0, name: '', type: spill-slot, offset: 0, size: 32, alignment: 16
374 ; CHECK-NEXT: stack-id: scalable-vector
376 ; EXPAND-LABEL: name: spills_fills_stack_id_zpr2strided
377 ; EXPAND: STR_ZXI $z0, $sp, 0
378 ; EXPAND: STR_ZXI $z8, $sp, 1
379 ; EXPAND: $z0 = LDR_ZXI $sp, 0
380 ; EXPAND: $z8 = LDR_ZXI $sp, 1
382 %0:zpr2strided = COPY $z0_z8
384 $z0_z1_z2_z3 = IMPLICIT_DEF
385 $z4_z5_z6_z7 = IMPLICIT_DEF
386 $z8_z9_z10_z11 = IMPLICIT_DEF
387 $z12_z13_z14_z15 = IMPLICIT_DEF
388 $z16_z17_z18_z19 = IMPLICIT_DEF
389 $z20_z21_z22_z23 = IMPLICIT_DEF
390 $z24_z25_z26_z27 = IMPLICIT_DEF
391 $z28_z29_z30_z31 = IMPLICIT_DEF
397 name: spills_fills_stack_id_zpr3
398 tracksRegLiveness: true
400 - { id: 0, class: zpr3 }
403 - { reg: '$z0_z1_z2', virtual-reg: '%0' }
408 ; CHECK-LABEL: name: spills_fills_stack_id_zpr3
410 ; CHECK: - { id: 0, name: '', type: spill-slot, offset: 0, size: 48, alignment: 16
411 ; CHECK-NEXT: stack-id: scalable-vector
413 ; EXPAND-LABEL: name: spills_fills_stack_id_zpr3
414 ; EXPAND: STR_ZXI $z0, $sp, 0
415 ; EXPAND: STR_ZXI $z1, $sp, 1
416 ; EXPAND: STR_ZXI $z2, $sp, 2
417 ; EXPAND: $z0 = LDR_ZXI $sp, 0
418 ; EXPAND: $z1 = LDR_ZXI $sp, 1
419 ; EXPAND: $z2 = LDR_ZXI $sp, 2
421 %0:zpr3 = COPY $z0_z1_z2
423 $z0_z1_z2_z3 = IMPLICIT_DEF
424 $z4_z5_z6_z7 = IMPLICIT_DEF
425 $z8_z9_z10_z11 = IMPLICIT_DEF
426 $z12_z13_z14_z15 = IMPLICIT_DEF
427 $z16_z17_z18_z19 = IMPLICIT_DEF
428 $z20_z21_z22_z23 = IMPLICIT_DEF
429 $z24_z25_z26_z27 = IMPLICIT_DEF
430 $z28_z29_z30_z31 = IMPLICIT_DEF
436 name: spills_fills_stack_id_zpr4
437 tracksRegLiveness: true
439 - { id: 0, class: zpr4 }
442 - { reg: '$z0_z1_z2_z3', virtual-reg: '%0' }
445 liveins: $z0_z1_z2_z3
447 ; CHECK-LABEL: name: spills_fills_stack_id_zpr4
449 ; CHECK: - { id: 0, name: '', type: spill-slot, offset: 0, size: 64, alignment: 16
450 ; CHECK-NEXT: stack-id: scalable-vector
452 ; EXPAND-LABEL: name: spills_fills_stack_id_zpr4
453 ; EXPAND: STR_ZXI $z0, $sp, 0
454 ; EXPAND: STR_ZXI $z1, $sp, 1
455 ; EXPAND: STR_ZXI $z2, $sp, 2
456 ; EXPAND: STR_ZXI $z3, $sp, 3
457 ; EXPAND: $z0 = LDR_ZXI $sp, 0
458 ; EXPAND: $z1 = LDR_ZXI $sp, 1
459 ; EXPAND: $z2 = LDR_ZXI $sp, 2
460 ; EXPAND: $z3 = LDR_ZXI $sp, 3
462 %0:zpr4 = COPY $z0_z1_z2_z3
464 $z0_z1_z2_z3 = IMPLICIT_DEF
465 $z4_z5_z6_z7 = IMPLICIT_DEF
466 $z8_z9_z10_z11 = IMPLICIT_DEF
467 $z12_z13_z14_z15 = IMPLICIT_DEF
468 $z16_z17_z18_z19 = IMPLICIT_DEF
469 $z20_z21_z22_z23 = IMPLICIT_DEF
470 $z24_z25_z26_z27 = IMPLICIT_DEF
471 $z28_z29_z30_z31 = IMPLICIT_DEF
473 $z0_z1_z2_z3 = COPY %0
477 name: spills_fills_stack_id_zpr4strided
478 tracksRegLiveness: true
480 - { id: 0, class: zpr4strided }
483 - { reg: '$z0_z4_z8_z12', virtual-reg: '%0' }
486 liveins: $z0_z1_z2_z3
488 $z0_z4_z8_z12 = COPY $z0_z1_z2_z3
493 liveins: $z0_z4_z8_z12
495 ; CHECK-LABEL: name: spills_fills_stack_id_zpr4strided
497 ; CHECK: - { id: 0, name: '', type: spill-slot, offset: 0, size: 64, alignment: 16
498 ; CHECK-NEXT: stack-id: scalable-vector
500 ; EXPAND-LABEL: name: spills_fills_stack_id_zpr4strided
501 ; EXPAND: STR_ZXI $z0, $sp, 0
502 ; EXPAND: STR_ZXI $z4, $sp, 1
503 ; EXPAND: STR_ZXI $z8, $sp, 2
504 ; EXPAND: STR_ZXI $z12, $sp, 3
505 ; EXPAND: $z0 = LDR_ZXI $sp, 0
506 ; EXPAND: $z4 = LDR_ZXI $sp, 1
507 ; EXPAND: $z8 = LDR_ZXI $sp, 2
508 ; EXPAND: $z12 = LDR_ZXI $sp, 3
510 %0:zpr4strided = COPY $z0_z4_z8_z12
512 $z0_z1_z2_z3 = IMPLICIT_DEF
513 $z4_z5_z6_z7 = IMPLICIT_DEF
514 $z8_z9_z10_z11 = IMPLICIT_DEF
515 $z12_z13_z14_z15 = IMPLICIT_DEF
516 $z16_z17_z18_z19 = IMPLICIT_DEF
517 $z20_z21_z22_z23 = IMPLICIT_DEF
518 $z24_z25_z26_z27 = IMPLICIT_DEF
519 $z28_z29_z30_z31 = IMPLICIT_DEF
521 $z0_z4_z8_z12 = COPY %0