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 %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_pnr() #1 { entry: unreachable }
11 define aarch64_sve_vector_pcs void @spills_fills_stack_id_virtreg_pnr() #1 { entry: unreachable }
12 define aarch64_sve_vector_pcs void @spills_fills_stack_id_zpr() #0 { entry: unreachable }
13 define aarch64_sve_vector_pcs void @spills_fills_stack_id_zpr2() #0 { entry: unreachable }
14 define aarch64_sve_vector_pcs void @spills_fills_stack_id_zpr2strided() #0 { entry: unreachable }
15 define aarch64_sve_vector_pcs void @spills_fills_stack_id_zpr3() #0 { entry: unreachable }
16 define aarch64_sve_vector_pcs void @spills_fills_stack_id_zpr4() #0 { entry: unreachable }
17 define aarch64_sve_vector_pcs void @spills_fills_stack_id_zpr4strided() #0 { entry: unreachable }
19 attributes #0 = { nounwind "target-features"="+sve" }
20 attributes #1 = { nounwind "target-features"="+sve2p1" }
24 name: spills_fills_stack_id_ppr
25 tracksRegLiveness: true
27 - { id: 0, class: ppr }
30 - { reg: '$p0', virtual-reg: '%0' }
35 ; CHECK-LABEL: name: spills_fills_stack_id_ppr
37 ; CHECK: - { id: 0, name: '', type: spill-slot, offset: 0, size: 2, alignment: 2
38 ; CHECK-NEXT: stack-id: scalable-vector, callee-saved-register: ''
40 ; EXPAND-LABEL: name: spills_fills_stack_id_ppr
41 ; EXPAND: STR_PXI $p0, $sp, 7
42 ; EXPAND: $p0 = LDR_PXI $sp, 7
67 name: spills_fills_stack_id_pnr
68 tracksRegLiveness: true
70 - { id: 0, class: pnr }
73 - { reg: '$pn0', virtual-reg: '%0' }
78 ; CHECK-LABEL: name: spills_fills_stack_id_pnr
80 ; CHECK: - { id: 0, name: '', type: spill-slot, offset: 0, size: 2, alignment: 2
81 ; CHECK-NEXT: stack-id: scalable-vector, callee-saved-register: ''
83 ; EXPAND-LABEL: name: spills_fills_stack_id_pnr
84 ; EXPAND: STR_PXI $p0, $sp, 7
85 ; EXPAND: $p0 = LDR_PXI $sp, 7, implicit-def $pn0
110 name: spills_fills_stack_id_virtreg_pnr
111 tracksRegLiveness: true
113 - { id: 0, class: pnr_p8to15 }
117 ; CHECK-LABEL: name: spills_fills_stack_id_virtreg_pnr
119 ; CHECK: - { id: 0, name: '', type: spill-slot, offset: 0, size: 2, alignment: 2
120 ; CHECK-NEXT: stack-id: scalable-vector, callee-saved-register: ''
122 ; EXPAND-LABEL: name: spills_fills_stack_id_virtreg_pnr
123 ; EXPAND: renamable $pn8 = WHILEGE_CXX_B
124 ; EXPAND: $p0 = ORR_PPzPP $p8, $p8, killed $p8
125 ; EXPAND: STR_PXI killed renamable $p0, $sp, 7
127 ; EXPAND: renamable $p0 = LDR_PXI $sp, 7
128 ; EXPAND: $p8 = ORR_PPzPP $p0, $p0, killed $p0, implicit-def $pn8
129 ; EXPAND: $p0 = PEXT_PCI_B killed renamable $pn8, 0
132 %0:pnr_p8to15 = WHILEGE_CXX_B undef $x0, undef $x0, 0, implicit-def dead $nzcv
151 $p0 = PEXT_PCI_B %0, 0
155 name: spills_fills_stack_id_zpr
156 tracksRegLiveness: true
158 - { id: 0, class: zpr }
161 - { reg: '$z0', virtual-reg: '%0' }
166 ; CHECK-LABEL: name: spills_fills_stack_id_zpr
168 ; CHECK: - { id: 0, name: '', type: spill-slot, offset: 0, size: 16, alignment: 16
169 ; CHECK-NEXT: stack-id: scalable-vector, callee-saved-register: ''
171 ; EXPAND-LABEL: name: spills_fills_stack_id_zpr
172 ; EXPAND: STR_ZXI $z0, $sp, 0
173 ; EXPAND: $z0 = LDR_ZXI $sp, 0
177 $z0_z1_z2_z3 = IMPLICIT_DEF
178 $z4_z5_z6_z7 = IMPLICIT_DEF
179 $z8_z9_z10_z11 = IMPLICIT_DEF
180 $z12_z13_z14_z15 = IMPLICIT_DEF
181 $z16_z17_z18_z19 = IMPLICIT_DEF
182 $z20_z21_z22_z23 = IMPLICIT_DEF
183 $z24_z25_z26_z27 = IMPLICIT_DEF
184 $z28_z29_z30_z31 = IMPLICIT_DEF
190 name: spills_fills_stack_id_zpr2
191 tracksRegLiveness: true
193 - { id: 0, class: zpr2 }
196 - { reg: '$z0_z1', virtual-reg: '%0' }
201 ; CHECK-LABEL: name: spills_fills_stack_id_zpr2
203 ; CHECK: - { id: 0, name: '', type: spill-slot, offset: 0, size: 32, alignment: 16
204 ; CHECK-NEXT: stack-id: scalable-vector
206 ; EXPAND-LABEL: name: spills_fills_stack_id_zpr2
207 ; EXPAND: STR_ZXI $z0, $sp, 0
208 ; EXPAND: STR_ZXI $z1, $sp, 1
209 ; EXPAND: $z0 = LDR_ZXI $sp, 0
210 ; EXPAND: $z1 = LDR_ZXI $sp, 1
212 %0:zpr2 = COPY $z0_z1
214 $z0_z1_z2_z3 = IMPLICIT_DEF
215 $z4_z5_z6_z7 = IMPLICIT_DEF
216 $z8_z9_z10_z11 = IMPLICIT_DEF
217 $z12_z13_z14_z15 = IMPLICIT_DEF
218 $z16_z17_z18_z19 = IMPLICIT_DEF
219 $z20_z21_z22_z23 = IMPLICIT_DEF
220 $z24_z25_z26_z27 = IMPLICIT_DEF
221 $z28_z29_z30_z31 = IMPLICIT_DEF
227 name: spills_fills_stack_id_zpr2strided
228 tracksRegLiveness: true
230 - { id: 0, class: zpr2strided }
233 - { reg: '$z0_z8', virtual-reg: '%0' }
246 ; CHECK-LABEL: name: spills_fills_stack_id_zpr2strided
248 ; CHECK: - { id: 0, name: '', type: spill-slot, offset: 0, size: 32, alignment: 16
249 ; CHECK-NEXT: stack-id: scalable-vector
251 ; EXPAND-LABEL: name: spills_fills_stack_id_zpr2strided
252 ; EXPAND: STR_ZXI $z0, $sp, 0
253 ; EXPAND: STR_ZXI $z8, $sp, 1
254 ; EXPAND: $z0 = LDR_ZXI $sp, 0
255 ; EXPAND: $z8 = LDR_ZXI $sp, 1
257 %0:zpr2strided = COPY $z0_z8
259 $z0_z1_z2_z3 = IMPLICIT_DEF
260 $z4_z5_z6_z7 = IMPLICIT_DEF
261 $z8_z9_z10_z11 = IMPLICIT_DEF
262 $z12_z13_z14_z15 = IMPLICIT_DEF
263 $z16_z17_z18_z19 = IMPLICIT_DEF
264 $z20_z21_z22_z23 = IMPLICIT_DEF
265 $z24_z25_z26_z27 = IMPLICIT_DEF
266 $z28_z29_z30_z31 = IMPLICIT_DEF
272 name: spills_fills_stack_id_zpr3
273 tracksRegLiveness: true
275 - { id: 0, class: zpr3 }
278 - { reg: '$z0_z1_z2', virtual-reg: '%0' }
283 ; CHECK-LABEL: name: spills_fills_stack_id_zpr3
285 ; CHECK: - { id: 0, name: '', type: spill-slot, offset: 0, size: 48, alignment: 16
286 ; CHECK-NEXT: stack-id: scalable-vector
288 ; EXPAND-LABEL: name: spills_fills_stack_id_zpr3
289 ; EXPAND: STR_ZXI $z0, $sp, 0
290 ; EXPAND: STR_ZXI $z1, $sp, 1
291 ; EXPAND: STR_ZXI $z2, $sp, 2
292 ; EXPAND: $z0 = LDR_ZXI $sp, 0
293 ; EXPAND: $z1 = LDR_ZXI $sp, 1
294 ; EXPAND: $z2 = LDR_ZXI $sp, 2
296 %0:zpr3 = COPY $z0_z1_z2
298 $z0_z1_z2_z3 = IMPLICIT_DEF
299 $z4_z5_z6_z7 = IMPLICIT_DEF
300 $z8_z9_z10_z11 = IMPLICIT_DEF
301 $z12_z13_z14_z15 = IMPLICIT_DEF
302 $z16_z17_z18_z19 = IMPLICIT_DEF
303 $z20_z21_z22_z23 = IMPLICIT_DEF
304 $z24_z25_z26_z27 = IMPLICIT_DEF
305 $z28_z29_z30_z31 = IMPLICIT_DEF
311 name: spills_fills_stack_id_zpr4
312 tracksRegLiveness: true
314 - { id: 0, class: zpr4 }
317 - { reg: '$z0_z1_z2_z3', virtual-reg: '%0' }
320 liveins: $z0_z1_z2_z3
322 ; CHECK-LABEL: name: spills_fills_stack_id_zpr4
324 ; CHECK: - { id: 0, name: '', type: spill-slot, offset: 0, size: 64, alignment: 16
325 ; CHECK-NEXT: stack-id: scalable-vector
327 ; EXPAND-LABEL: name: spills_fills_stack_id_zpr4
328 ; EXPAND: STR_ZXI $z0, $sp, 0
329 ; EXPAND: STR_ZXI $z1, $sp, 1
330 ; EXPAND: STR_ZXI $z2, $sp, 2
331 ; EXPAND: STR_ZXI $z3, $sp, 3
332 ; EXPAND: $z0 = LDR_ZXI $sp, 0
333 ; EXPAND: $z1 = LDR_ZXI $sp, 1
334 ; EXPAND: $z2 = LDR_ZXI $sp, 2
335 ; EXPAND: $z3 = LDR_ZXI $sp, 3
337 %0:zpr4 = COPY $z0_z1_z2_z3
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
348 $z0_z1_z2_z3 = COPY %0
352 name: spills_fills_stack_id_zpr4strided
353 tracksRegLiveness: true
355 - { id: 0, class: zpr4strided }
358 - { reg: '$z0_z4_z8_z12', virtual-reg: '%0' }
361 liveins: $z0_z1_z2_z3
363 $z0_z4_z8_z12 = COPY $z0_z1_z2_z3
368 liveins: $z0_z4_z8_z12
370 ; CHECK-LABEL: name: spills_fills_stack_id_zpr4strided
372 ; CHECK: - { id: 0, name: '', type: spill-slot, offset: 0, size: 64, alignment: 16
373 ; CHECK-NEXT: stack-id: scalable-vector
375 ; EXPAND-LABEL: name: spills_fills_stack_id_zpr4strided
376 ; EXPAND: STR_ZXI $z0, $sp, 0
377 ; EXPAND: STR_ZXI $z4, $sp, 1
378 ; EXPAND: STR_ZXI $z8, $sp, 2
379 ; EXPAND: STR_ZXI $z12, $sp, 3
380 ; EXPAND: $z0 = LDR_ZXI $sp, 0
381 ; EXPAND: $z4 = LDR_ZXI $sp, 1
382 ; EXPAND: $z8 = LDR_ZXI $sp, 2
383 ; EXPAND: $z12 = LDR_ZXI $sp, 3
385 %0:zpr4strided = COPY $z0_z4_z8_z12
387 $z0_z1_z2_z3 = IMPLICIT_DEF
388 $z4_z5_z6_z7 = IMPLICIT_DEF
389 $z8_z9_z10_z11 = IMPLICIT_DEF
390 $z12_z13_z14_z15 = IMPLICIT_DEF
391 $z16_z17_z18_z19 = IMPLICIT_DEF
392 $z20_z21_z22_z23 = IMPLICIT_DEF
393 $z24_z25_z26_z27 = IMPLICIT_DEF
394 $z28_z29_z30_z31 = IMPLICIT_DEF
396 $z0_z4_z8_z12 = COPY %0