1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=aarch64 -mattr=+sve < %s | FileCheck %s
4 declare void @bar(<vscale x 4 x i64>*)
6 define void @foo(<vscale x 4 x i64> %dst, i1 %cond) {
8 ; CHECK: // %bb.0: // %entry
9 ; CHECK-NEXT: tbz w0, #0, .LBB0_2
10 ; CHECK-NEXT: // %bb.1: // %if.then
11 ; CHECK-NEXT: stp x29, x30, [sp, #-32]! // 16-byte Folded Spill
12 ; CHECK-NEXT: stp x28, x19, [sp, #16] // 16-byte Folded Spill
13 ; CHECK-NEXT: mov x29, sp
14 ; CHECK-NEXT: addvl sp, sp, #-18
15 ; CHECK-NEXT: str p15, [sp, #4, mul vl] // 2-byte Folded Spill
16 ; CHECK-NEXT: str p14, [sp, #5, mul vl] // 2-byte Folded Spill
17 ; CHECK-NEXT: str p13, [sp, #6, mul vl] // 2-byte Folded Spill
18 ; CHECK-NEXT: str p12, [sp, #7, mul vl] // 2-byte Folded Spill
19 ; CHECK-NEXT: str p11, [sp, #8, mul vl] // 2-byte Folded Spill
20 ; CHECK-NEXT: str p10, [sp, #9, mul vl] // 2-byte Folded Spill
21 ; CHECK-NEXT: str p9, [sp, #10, mul vl] // 2-byte Folded Spill
22 ; CHECK-NEXT: str p8, [sp, #11, mul vl] // 2-byte Folded Spill
23 ; CHECK-NEXT: str p7, [sp, #12, mul vl] // 2-byte Folded Spill
24 ; CHECK-NEXT: str p6, [sp, #13, mul vl] // 2-byte Folded Spill
25 ; CHECK-NEXT: str p5, [sp, #14, mul vl] // 2-byte Folded Spill
26 ; CHECK-NEXT: str p4, [sp, #15, mul vl] // 2-byte Folded Spill
27 ; CHECK-NEXT: str z23, [sp, #2, mul vl] // 16-byte Folded Spill
28 ; CHECK-NEXT: str z22, [sp, #3, mul vl] // 16-byte Folded Spill
29 ; CHECK-NEXT: str z21, [sp, #4, mul vl] // 16-byte Folded Spill
30 ; CHECK-NEXT: str z20, [sp, #5, mul vl] // 16-byte Folded Spill
31 ; CHECK-NEXT: str z19, [sp, #6, mul vl] // 16-byte Folded Spill
32 ; CHECK-NEXT: str z18, [sp, #7, mul vl] // 16-byte Folded Spill
33 ; CHECK-NEXT: str z17, [sp, #8, mul vl] // 16-byte Folded Spill
34 ; CHECK-NEXT: str z16, [sp, #9, mul vl] // 16-byte Folded Spill
35 ; CHECK-NEXT: str z15, [sp, #10, mul vl] // 16-byte Folded Spill
36 ; CHECK-NEXT: str z14, [sp, #11, mul vl] // 16-byte Folded Spill
37 ; CHECK-NEXT: str z13, [sp, #12, mul vl] // 16-byte Folded Spill
38 ; CHECK-NEXT: str z12, [sp, #13, mul vl] // 16-byte Folded Spill
39 ; CHECK-NEXT: str z11, [sp, #14, mul vl] // 16-byte Folded Spill
40 ; CHECK-NEXT: str z10, [sp, #15, mul vl] // 16-byte Folded Spill
41 ; CHECK-NEXT: str z9, [sp, #16, mul vl] // 16-byte Folded Spill
42 ; CHECK-NEXT: str z8, [sp, #17, mul vl] // 16-byte Folded Spill
43 ; CHECK-NEXT: mov x19, sp
44 ; CHECK-NEXT: .cfi_def_cfa w29, 32
45 ; CHECK-NEXT: .cfi_offset w19, -8
46 ; CHECK-NEXT: .cfi_offset w28, -16
47 ; CHECK-NEXT: .cfi_offset w30, -24
48 ; CHECK-NEXT: .cfi_offset w29, -32
49 ; CHECK-NEXT: .cfi_escape 0x10, 0x48, 0x0a, 0x11, 0x60, 0x22, 0x11, 0x78, 0x92, 0x2e, 0x00, 0x1e, 0x22 // $d8 @ cfa - 32 - 8 * VG
50 ; CHECK-NEXT: .cfi_escape 0x10, 0x49, 0x0a, 0x11, 0x60, 0x22, 0x11, 0x70, 0x92, 0x2e, 0x00, 0x1e, 0x22 // $d9 @ cfa - 32 - 16 * VG
51 ; CHECK-NEXT: .cfi_escape 0x10, 0x4a, 0x0a, 0x11, 0x60, 0x22, 0x11, 0x68, 0x92, 0x2e, 0x00, 0x1e, 0x22 // $d10 @ cfa - 32 - 24 * VG
52 ; CHECK-NEXT: .cfi_escape 0x10, 0x4b, 0x0a, 0x11, 0x60, 0x22, 0x11, 0x60, 0x92, 0x2e, 0x00, 0x1e, 0x22 // $d11 @ cfa - 32 - 32 * VG
53 ; CHECK-NEXT: .cfi_escape 0x10, 0x4c, 0x0a, 0x11, 0x60, 0x22, 0x11, 0x58, 0x92, 0x2e, 0x00, 0x1e, 0x22 // $d12 @ cfa - 32 - 40 * VG
54 ; CHECK-NEXT: .cfi_escape 0x10, 0x4d, 0x0a, 0x11, 0x60, 0x22, 0x11, 0x50, 0x92, 0x2e, 0x00, 0x1e, 0x22 // $d13 @ cfa - 32 - 48 * VG
55 ; CHECK-NEXT: .cfi_escape 0x10, 0x4e, 0x0a, 0x11, 0x60, 0x22, 0x11, 0x48, 0x92, 0x2e, 0x00, 0x1e, 0x22 // $d14 @ cfa - 32 - 56 * VG
56 ; CHECK-NEXT: .cfi_escape 0x10, 0x4f, 0x0a, 0x11, 0x60, 0x22, 0x11, 0x40, 0x92, 0x2e, 0x00, 0x1e, 0x22 // $d15 @ cfa - 32 - 64 * VG
57 ; CHECK-NEXT: rdvl x9, #2
58 ; CHECK-NEXT: mov x8, sp
59 ; CHECK-NEXT: add x9, x9, #15
60 ; CHECK-NEXT: and x9, x9, #0xfffffffffffffff0
61 ; CHECK-NEXT: sub x8, x8, x9
62 ; CHECK-NEXT: and x0, x8, #0xffffffffffffffe0
63 ; CHECK-NEXT: mov sp, x0
64 ; CHECK-NEXT: ptrue p0.d
65 ; CHECK-NEXT: st1d { z1.d }, p0, [x0, #1, mul vl]
66 ; CHECK-NEXT: st1d { z0.d }, p0, [x0]
68 ; CHECK-NEXT: addvl sp, x29, #-18
69 ; CHECK-NEXT: ldr p15, [sp, #4, mul vl] // 2-byte Folded Reload
70 ; CHECK-NEXT: ldr z23, [sp, #2, mul vl] // 16-byte Folded Reload
71 ; CHECK-NEXT: ldr z22, [sp, #3, mul vl] // 16-byte Folded Reload
72 ; CHECK-NEXT: ldr p14, [sp, #5, mul vl] // 2-byte Folded Reload
73 ; CHECK-NEXT: ldr z21, [sp, #4, mul vl] // 16-byte Folded Reload
74 ; CHECK-NEXT: ldr z20, [sp, #5, mul vl] // 16-byte Folded Reload
75 ; CHECK-NEXT: ldr p13, [sp, #6, mul vl] // 2-byte Folded Reload
76 ; CHECK-NEXT: ldr z19, [sp, #6, mul vl] // 16-byte Folded Reload
77 ; CHECK-NEXT: ldr z18, [sp, #7, mul vl] // 16-byte Folded Reload
78 ; CHECK-NEXT: ldr p12, [sp, #7, mul vl] // 2-byte Folded Reload
79 ; CHECK-NEXT: ldr z17, [sp, #8, mul vl] // 16-byte Folded Reload
80 ; CHECK-NEXT: ldr z16, [sp, #9, mul vl] // 16-byte Folded Reload
81 ; CHECK-NEXT: ldr p11, [sp, #8, mul vl] // 2-byte Folded Reload
82 ; CHECK-NEXT: ldr z15, [sp, #10, mul vl] // 16-byte Folded Reload
83 ; CHECK-NEXT: ldr z14, [sp, #11, mul vl] // 16-byte Folded Reload
84 ; CHECK-NEXT: ldr p10, [sp, #9, mul vl] // 2-byte Folded Reload
85 ; CHECK-NEXT: ldr z13, [sp, #12, mul vl] // 16-byte Folded Reload
86 ; CHECK-NEXT: ldr z12, [sp, #13, mul vl] // 16-byte Folded Reload
87 ; CHECK-NEXT: ldr p9, [sp, #10, mul vl] // 2-byte Folded Reload
88 ; CHECK-NEXT: ldr z11, [sp, #14, mul vl] // 16-byte Folded Reload
89 ; CHECK-NEXT: ldr z10, [sp, #15, mul vl] // 16-byte Folded Reload
90 ; CHECK-NEXT: ldr p8, [sp, #11, mul vl] // 2-byte Folded Reload
91 ; CHECK-NEXT: ldr z9, [sp, #16, mul vl] // 16-byte Folded Reload
92 ; CHECK-NEXT: ldr z8, [sp, #17, mul vl] // 16-byte Folded Reload
93 ; CHECK-NEXT: ldr p7, [sp, #12, mul vl] // 2-byte Folded Reload
94 ; CHECK-NEXT: ldr p6, [sp, #13, mul vl] // 2-byte Folded Reload
95 ; CHECK-NEXT: ldr p5, [sp, #14, mul vl] // 2-byte Folded Reload
96 ; CHECK-NEXT: ldr p4, [sp, #15, mul vl] // 2-byte Folded Reload
97 ; CHECK-NEXT: mov sp, x29
98 ; CHECK-NEXT: ldp x28, x19, [sp, #16] // 16-byte Folded Reload
99 ; CHECK-NEXT: ldp x29, x30, [sp], #32 // 16-byte Folded Reload
100 ; CHECK-NEXT: .LBB0_2: // %if.end
103 br i1 %cond, label %if.then, label %if.end
106 %ptr = alloca <vscale x 4 x i64>
107 store <vscale x 4 x i64> %dst, <vscale x 4 x i64>* %ptr
108 call void @bar(<vscale x 4 x i64>* %ptr)