1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --extra_scrub
2 ; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve -O0 -global-isel=0 -global-isel-abort=0 < %s | FileCheck %s
3 ; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve -O0 -global-isel=1 -global-isel-abort=0 < %s | FileCheck %s --check-prefix=GISEL
5 ; Test that z0 is saved/restored, as the unwinder may only retain the low 64bits (d0).
6 define <vscale x 4 x i32> @invoke_callee_may_throw_sve(<vscale x 4 x i32> %v) uwtable personality i8 0 {
7 ; CHECK-LABEL: invoke_callee_may_throw_sve:
8 ; CHECK: .Lfunc_begin0:
9 ; CHECK-NEXT: .cfi_startproc
10 ; CHECK-NEXT: // %bb.0:
11 ; CHECK-NEXT: stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
12 ; CHECK-NEXT: .cfi_def_cfa_offset 16
13 ; CHECK-NEXT: .cfi_offset w30, -8
14 ; CHECK-NEXT: .cfi_offset w29, -16
15 ; CHECK-NEXT: addvl sp, sp, #-18
16 ; CHECK-NEXT: .cfi_escape 0x0f, 0x0d, 0x8f, 0x00, 0x11, 0x10, 0x22, 0x11, 0x90, 0x01, 0x92, 0x2e, 0x00, 0x1e, 0x22 // sp + 16 + 144 * VG
17 ; CHECK-NEXT: str p15, [sp, #4, mul vl] // 2-byte Folded Spill
18 ; CHECK-NEXT: str p14, [sp, #5, mul vl] // 2-byte Folded Spill
19 ; CHECK-NEXT: str p13, [sp, #6, mul vl] // 2-byte Folded Spill
20 ; CHECK-NEXT: str p12, [sp, #7, mul vl] // 2-byte Folded Spill
21 ; CHECK-NEXT: str p11, [sp, #8, mul vl] // 2-byte Folded Spill
22 ; CHECK-NEXT: str p10, [sp, #9, mul vl] // 2-byte Folded Spill
23 ; CHECK-NEXT: str p9, [sp, #10, mul vl] // 2-byte Folded Spill
24 ; CHECK-NEXT: str p8, [sp, #11, mul vl] // 2-byte Folded Spill
25 ; CHECK-NEXT: str p7, [sp, #12, mul vl] // 2-byte Folded Spill
26 ; CHECK-NEXT: str p6, [sp, #13, mul vl] // 2-byte Folded Spill
27 ; CHECK-NEXT: str p5, [sp, #14, mul vl] // 2-byte Folded Spill
28 ; CHECK-NEXT: str p4, [sp, #15, mul vl] // 2-byte Folded Spill
29 ; CHECK-NEXT: str z23, [sp, #2, mul vl] // 16-byte Folded Spill
30 ; CHECK-NEXT: str z22, [sp, #3, mul vl] // 16-byte Folded Spill
31 ; CHECK-NEXT: str z21, [sp, #4, mul vl] // 16-byte Folded Spill
32 ; CHECK-NEXT: str z20, [sp, #5, mul vl] // 16-byte Folded Spill
33 ; CHECK-NEXT: str z19, [sp, #6, mul vl] // 16-byte Folded Spill
34 ; CHECK-NEXT: str z18, [sp, #7, mul vl] // 16-byte Folded Spill
35 ; CHECK-NEXT: str z17, [sp, #8, mul vl] // 16-byte Folded Spill
36 ; CHECK-NEXT: str z16, [sp, #9, mul vl] // 16-byte Folded Spill
37 ; CHECK-NEXT: str z15, [sp, #10, mul vl] // 16-byte Folded Spill
38 ; CHECK-NEXT: str z14, [sp, #11, mul vl] // 16-byte Folded Spill
39 ; CHECK-NEXT: str z13, [sp, #12, mul vl] // 16-byte Folded Spill
40 ; CHECK-NEXT: str z12, [sp, #13, mul vl] // 16-byte Folded Spill
41 ; CHECK-NEXT: str z11, [sp, #14, mul vl] // 16-byte Folded Spill
42 ; CHECK-NEXT: str z10, [sp, #15, mul vl] // 16-byte Folded Spill
43 ; CHECK-NEXT: str z9, [sp, #16, mul vl] // 16-byte Folded Spill
44 ; CHECK-NEXT: str z8, [sp, #17, mul vl] // 16-byte Folded Spill
45 ; CHECK-NEXT: .cfi_escape 0x10, 0x48, 0x0a, 0x11, 0x70, 0x22, 0x11, 0x78, 0x92, 0x2e, 0x00, 0x1e, 0x22 // $d8 @ cfa - 16 - 8 * VG
46 ; CHECK-NEXT: .cfi_escape 0x10, 0x49, 0x0a, 0x11, 0x70, 0x22, 0x11, 0x70, 0x92, 0x2e, 0x00, 0x1e, 0x22 // $d9 @ cfa - 16 - 16 * VG
47 ; CHECK-NEXT: .cfi_escape 0x10, 0x4a, 0x0a, 0x11, 0x70, 0x22, 0x11, 0x68, 0x92, 0x2e, 0x00, 0x1e, 0x22 // $d10 @ cfa - 16 - 24 * VG
48 ; CHECK-NEXT: .cfi_escape 0x10, 0x4b, 0x0a, 0x11, 0x70, 0x22, 0x11, 0x60, 0x92, 0x2e, 0x00, 0x1e, 0x22 // $d11 @ cfa - 16 - 32 * VG
49 ; CHECK-NEXT: .cfi_escape 0x10, 0x4c, 0x0a, 0x11, 0x70, 0x22, 0x11, 0x58, 0x92, 0x2e, 0x00, 0x1e, 0x22 // $d12 @ cfa - 16 - 40 * VG
50 ; CHECK-NEXT: .cfi_escape 0x10, 0x4d, 0x0a, 0x11, 0x70, 0x22, 0x11, 0x50, 0x92, 0x2e, 0x00, 0x1e, 0x22 // $d13 @ cfa - 16 - 48 * VG
51 ; CHECK-NEXT: .cfi_escape 0x10, 0x4e, 0x0a, 0x11, 0x70, 0x22, 0x11, 0x48, 0x92, 0x2e, 0x00, 0x1e, 0x22 // $d14 @ cfa - 16 - 56 * VG
52 ; CHECK-NEXT: .cfi_escape 0x10, 0x4f, 0x0a, 0x11, 0x70, 0x22, 0x11, 0x40, 0x92, 0x2e, 0x00, 0x1e, 0x22 // $d15 @ cfa - 16 - 64 * VG
53 ; CHECK-NEXT: addvl sp, sp, #-2
54 ; CHECK-NEXT: .cfi_escape 0x0f, 0x0d, 0x8f, 0x00, 0x11, 0x10, 0x22, 0x11, 0xa0, 0x01, 0x92, 0x2e, 0x00, 0x1e, 0x22 // sp + 16 + 160 * VG
55 ; CHECK-NEXT: .cfi_remember_state
56 ; CHECK-NEXT: str z0, [sp] // 16-byte Folded Spill
58 ; CHECK-NEXT: bl may_throw_sve
60 ; CHECK-NEXT: str z0, [sp, #1, mul vl] // 16-byte Folded Spill
61 ; CHECK-NEXT: b .LBB0_1
62 ; CHECK-NEXT: .LBB0_1: // %.Lcontinue
63 ; CHECK-NEXT: ldr z0, [sp, #1, mul vl] // 16-byte Folded Reload
64 ; CHECK-NEXT: addvl sp, sp, #2
65 ; CHECK-NEXT: .cfi_escape 0x0f, 0x0d, 0x8f, 0x00, 0x11, 0x10, 0x22, 0x11, 0x90, 0x01, 0x92, 0x2e, 0x00, 0x1e, 0x22 // sp + 16 + 144 * VG
66 ; CHECK-NEXT: ldr p15, [sp, #4, mul vl] // 2-byte Folded Reload
67 ; CHECK-NEXT: ldr p14, [sp, #5, mul vl] // 2-byte Folded Reload
68 ; CHECK-NEXT: ldr p13, [sp, #6, mul vl] // 2-byte Folded Reload
69 ; CHECK-NEXT: ldr p12, [sp, #7, mul vl] // 2-byte Folded Reload
70 ; CHECK-NEXT: ldr p11, [sp, #8, mul vl] // 2-byte Folded Reload
71 ; CHECK-NEXT: ldr p10, [sp, #9, mul vl] // 2-byte Folded Reload
72 ; CHECK-NEXT: ldr p9, [sp, #10, mul vl] // 2-byte Folded Reload
73 ; CHECK-NEXT: ldr p8, [sp, #11, mul vl] // 2-byte Folded Reload
74 ; CHECK-NEXT: ldr p7, [sp, #12, mul vl] // 2-byte Folded Reload
75 ; CHECK-NEXT: ldr p6, [sp, #13, mul vl] // 2-byte Folded Reload
76 ; CHECK-NEXT: ldr p5, [sp, #14, mul vl] // 2-byte Folded Reload
77 ; CHECK-NEXT: ldr p4, [sp, #15, mul vl] // 2-byte Folded Reload
78 ; CHECK-NEXT: ldr z23, [sp, #2, mul vl] // 16-byte Folded Reload
79 ; CHECK-NEXT: ldr z22, [sp, #3, mul vl] // 16-byte Folded Reload
80 ; CHECK-NEXT: ldr z21, [sp, #4, mul vl] // 16-byte Folded Reload
81 ; CHECK-NEXT: ldr z20, [sp, #5, mul vl] // 16-byte Folded Reload
82 ; CHECK-NEXT: ldr z19, [sp, #6, mul vl] // 16-byte Folded Reload
83 ; CHECK-NEXT: ldr z18, [sp, #7, mul vl] // 16-byte Folded Reload
84 ; CHECK-NEXT: ldr z17, [sp, #8, mul vl] // 16-byte Folded Reload
85 ; CHECK-NEXT: ldr z16, [sp, #9, mul vl] // 16-byte Folded Reload
86 ; CHECK-NEXT: ldr z15, [sp, #10, mul vl] // 16-byte Folded Reload
87 ; CHECK-NEXT: ldr z14, [sp, #11, mul vl] // 16-byte Folded Reload
88 ; CHECK-NEXT: ldr z13, [sp, #12, mul vl] // 16-byte Folded Reload
89 ; CHECK-NEXT: ldr z12, [sp, #13, mul vl] // 16-byte Folded Reload
90 ; CHECK-NEXT: ldr z11, [sp, #14, mul vl] // 16-byte Folded Reload
91 ; CHECK-NEXT: ldr z10, [sp, #15, mul vl] // 16-byte Folded Reload
92 ; CHECK-NEXT: ldr z9, [sp, #16, mul vl] // 16-byte Folded Reload
93 ; CHECK-NEXT: ldr z8, [sp, #17, mul vl] // 16-byte Folded Reload
94 ; CHECK-NEXT: addvl sp, sp, #18
95 ; CHECK-NEXT: .cfi_def_cfa wsp, 16
96 ; CHECK-NEXT: .cfi_restore z8
97 ; CHECK-NEXT: .cfi_restore z9
98 ; CHECK-NEXT: .cfi_restore z10
99 ; CHECK-NEXT: .cfi_restore z11
100 ; CHECK-NEXT: .cfi_restore z12
101 ; CHECK-NEXT: .cfi_restore z13
102 ; CHECK-NEXT: .cfi_restore z14
103 ; CHECK-NEXT: .cfi_restore z15
104 ; CHECK-NEXT: ldp x29, x30, [sp], #16 // 16-byte Folded Reload
105 ; CHECK-NEXT: .cfi_def_cfa_offset 0
106 ; CHECK-NEXT: .cfi_restore w30
107 ; CHECK-NEXT: .cfi_restore w29
109 ; CHECK-NEXT: .LBB0_2: // %.Lunwind
110 ; CHECK-NEXT: .cfi_restore_state
111 ; CHECK-NEXT: .Ltmp2:
112 ; CHECK-NEXT: ldr z0, [sp] // 16-byte Folded Reload
113 ; CHECK-NEXT: addvl sp, sp, #2
114 ; CHECK-NEXT: .cfi_escape 0x0f, 0x0d, 0x8f, 0x00, 0x11, 0x10, 0x22, 0x11, 0x90, 0x01, 0x92, 0x2e, 0x00, 0x1e, 0x22 // sp + 16 + 144 * VG
115 ; CHECK-NEXT: ldr p15, [sp, #4, mul vl] // 2-byte Folded Reload
116 ; CHECK-NEXT: ldr p14, [sp, #5, mul vl] // 2-byte Folded Reload
117 ; CHECK-NEXT: ldr p13, [sp, #6, mul vl] // 2-byte Folded Reload
118 ; CHECK-NEXT: ldr p12, [sp, #7, mul vl] // 2-byte Folded Reload
119 ; CHECK-NEXT: ldr p11, [sp, #8, mul vl] // 2-byte Folded Reload
120 ; CHECK-NEXT: ldr p10, [sp, #9, mul vl] // 2-byte Folded Reload
121 ; CHECK-NEXT: ldr p9, [sp, #10, mul vl] // 2-byte Folded Reload
122 ; CHECK-NEXT: ldr p8, [sp, #11, mul vl] // 2-byte Folded Reload
123 ; CHECK-NEXT: ldr p7, [sp, #12, mul vl] // 2-byte Folded Reload
124 ; CHECK-NEXT: ldr p6, [sp, #13, mul vl] // 2-byte Folded Reload
125 ; CHECK-NEXT: ldr p5, [sp, #14, mul vl] // 2-byte Folded Reload
126 ; CHECK-NEXT: ldr p4, [sp, #15, mul vl] // 2-byte Folded Reload
127 ; CHECK-NEXT: ldr z23, [sp, #2, mul vl] // 16-byte Folded Reload
128 ; CHECK-NEXT: ldr z22, [sp, #3, mul vl] // 16-byte Folded Reload
129 ; CHECK-NEXT: ldr z21, [sp, #4, mul vl] // 16-byte Folded Reload
130 ; CHECK-NEXT: ldr z20, [sp, #5, mul vl] // 16-byte Folded Reload
131 ; CHECK-NEXT: ldr z19, [sp, #6, mul vl] // 16-byte Folded Reload
132 ; CHECK-NEXT: ldr z18, [sp, #7, mul vl] // 16-byte Folded Reload
133 ; CHECK-NEXT: ldr z17, [sp, #8, mul vl] // 16-byte Folded Reload
134 ; CHECK-NEXT: ldr z16, [sp, #9, mul vl] // 16-byte Folded Reload
135 ; CHECK-NEXT: ldr z15, [sp, #10, mul vl] // 16-byte Folded Reload
136 ; CHECK-NEXT: ldr z14, [sp, #11, mul vl] // 16-byte Folded Reload
137 ; CHECK-NEXT: ldr z13, [sp, #12, mul vl] // 16-byte Folded Reload
138 ; CHECK-NEXT: ldr z12, [sp, #13, mul vl] // 16-byte Folded Reload
139 ; CHECK-NEXT: ldr z11, [sp, #14, mul vl] // 16-byte Folded Reload
140 ; CHECK-NEXT: ldr z10, [sp, #15, mul vl] // 16-byte Folded Reload
141 ; CHECK-NEXT: ldr z9, [sp, #16, mul vl] // 16-byte Folded Reload
142 ; CHECK-NEXT: ldr z8, [sp, #17, mul vl] // 16-byte Folded Reload
143 ; CHECK-NEXT: addvl sp, sp, #18
144 ; CHECK-NEXT: .cfi_def_cfa wsp, 16
145 ; CHECK-NEXT: .cfi_restore z8
146 ; CHECK-NEXT: .cfi_restore z9
147 ; CHECK-NEXT: .cfi_restore z10
148 ; CHECK-NEXT: .cfi_restore z11
149 ; CHECK-NEXT: .cfi_restore z12
150 ; CHECK-NEXT: .cfi_restore z13
151 ; CHECK-NEXT: .cfi_restore z14
152 ; CHECK-NEXT: .cfi_restore z15
153 ; CHECK-NEXT: ldp x29, x30, [sp], #16 // 16-byte Folded Reload
154 ; CHECK-NEXT: .cfi_def_cfa_offset 0
155 ; CHECK-NEXT: .cfi_restore w30
156 ; CHECK-NEXT: .cfi_restore w29
159 ; GISEL-LABEL: invoke_callee_may_throw_sve:
160 ; GISEL: .Lfunc_begin0:
161 ; GISEL-NEXT: .cfi_startproc
162 ; GISEL-NEXT: // %bb.0:
163 ; GISEL-NEXT: stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
164 ; GISEL-NEXT: .cfi_def_cfa_offset 16
165 ; GISEL-NEXT: .cfi_offset w30, -8
166 ; GISEL-NEXT: .cfi_offset w29, -16
167 ; GISEL-NEXT: addvl sp, sp, #-18
168 ; GISEL-NEXT: .cfi_escape 0x0f, 0x0d, 0x8f, 0x00, 0x11, 0x10, 0x22, 0x11, 0x90, 0x01, 0x92, 0x2e, 0x00, 0x1e, 0x22 // sp + 16 + 144 * VG
169 ; GISEL-NEXT: str p15, [sp, #4, mul vl] // 2-byte Folded Spill
170 ; GISEL-NEXT: str p14, [sp, #5, mul vl] // 2-byte Folded Spill
171 ; GISEL-NEXT: str p13, [sp, #6, mul vl] // 2-byte Folded Spill
172 ; GISEL-NEXT: str p12, [sp, #7, mul vl] // 2-byte Folded Spill
173 ; GISEL-NEXT: str p11, [sp, #8, mul vl] // 2-byte Folded Spill
174 ; GISEL-NEXT: str p10, [sp, #9, mul vl] // 2-byte Folded Spill
175 ; GISEL-NEXT: str p9, [sp, #10, mul vl] // 2-byte Folded Spill
176 ; GISEL-NEXT: str p8, [sp, #11, mul vl] // 2-byte Folded Spill
177 ; GISEL-NEXT: str p7, [sp, #12, mul vl] // 2-byte Folded Spill
178 ; GISEL-NEXT: str p6, [sp, #13, mul vl] // 2-byte Folded Spill
179 ; GISEL-NEXT: str p5, [sp, #14, mul vl] // 2-byte Folded Spill
180 ; GISEL-NEXT: str p4, [sp, #15, mul vl] // 2-byte Folded Spill
181 ; GISEL-NEXT: str z23, [sp, #2, mul vl] // 16-byte Folded Spill
182 ; GISEL-NEXT: str z22, [sp, #3, mul vl] // 16-byte Folded Spill
183 ; GISEL-NEXT: str z21, [sp, #4, mul vl] // 16-byte Folded Spill
184 ; GISEL-NEXT: str z20, [sp, #5, mul vl] // 16-byte Folded Spill
185 ; GISEL-NEXT: str z19, [sp, #6, mul vl] // 16-byte Folded Spill
186 ; GISEL-NEXT: str z18, [sp, #7, mul vl] // 16-byte Folded Spill
187 ; GISEL-NEXT: str z17, [sp, #8, mul vl] // 16-byte Folded Spill
188 ; GISEL-NEXT: str z16, [sp, #9, mul vl] // 16-byte Folded Spill
189 ; GISEL-NEXT: str z15, [sp, #10, mul vl] // 16-byte Folded Spill
190 ; GISEL-NEXT: str z14, [sp, #11, mul vl] // 16-byte Folded Spill
191 ; GISEL-NEXT: str z13, [sp, #12, mul vl] // 16-byte Folded Spill
192 ; GISEL-NEXT: str z12, [sp, #13, mul vl] // 16-byte Folded Spill
193 ; GISEL-NEXT: str z11, [sp, #14, mul vl] // 16-byte Folded Spill
194 ; GISEL-NEXT: str z10, [sp, #15, mul vl] // 16-byte Folded Spill
195 ; GISEL-NEXT: str z9, [sp, #16, mul vl] // 16-byte Folded Spill
196 ; GISEL-NEXT: str z8, [sp, #17, mul vl] // 16-byte Folded Spill
197 ; GISEL-NEXT: .cfi_escape 0x10, 0x48, 0x0a, 0x11, 0x70, 0x22, 0x11, 0x78, 0x92, 0x2e, 0x00, 0x1e, 0x22 // $d8 @ cfa - 16 - 8 * VG
198 ; GISEL-NEXT: .cfi_escape 0x10, 0x49, 0x0a, 0x11, 0x70, 0x22, 0x11, 0x70, 0x92, 0x2e, 0x00, 0x1e, 0x22 // $d9 @ cfa - 16 - 16 * VG
199 ; GISEL-NEXT: .cfi_escape 0x10, 0x4a, 0x0a, 0x11, 0x70, 0x22, 0x11, 0x68, 0x92, 0x2e, 0x00, 0x1e, 0x22 // $d10 @ cfa - 16 - 24 * VG
200 ; GISEL-NEXT: .cfi_escape 0x10, 0x4b, 0x0a, 0x11, 0x70, 0x22, 0x11, 0x60, 0x92, 0x2e, 0x00, 0x1e, 0x22 // $d11 @ cfa - 16 - 32 * VG
201 ; GISEL-NEXT: .cfi_escape 0x10, 0x4c, 0x0a, 0x11, 0x70, 0x22, 0x11, 0x58, 0x92, 0x2e, 0x00, 0x1e, 0x22 // $d12 @ cfa - 16 - 40 * VG
202 ; GISEL-NEXT: .cfi_escape 0x10, 0x4d, 0x0a, 0x11, 0x70, 0x22, 0x11, 0x50, 0x92, 0x2e, 0x00, 0x1e, 0x22 // $d13 @ cfa - 16 - 48 * VG
203 ; GISEL-NEXT: .cfi_escape 0x10, 0x4e, 0x0a, 0x11, 0x70, 0x22, 0x11, 0x48, 0x92, 0x2e, 0x00, 0x1e, 0x22 // $d14 @ cfa - 16 - 56 * VG
204 ; GISEL-NEXT: .cfi_escape 0x10, 0x4f, 0x0a, 0x11, 0x70, 0x22, 0x11, 0x40, 0x92, 0x2e, 0x00, 0x1e, 0x22 // $d15 @ cfa - 16 - 64 * VG
205 ; GISEL-NEXT: addvl sp, sp, #-2
206 ; GISEL-NEXT: .cfi_escape 0x0f, 0x0d, 0x8f, 0x00, 0x11, 0x10, 0x22, 0x11, 0xa0, 0x01, 0x92, 0x2e, 0x00, 0x1e, 0x22 // sp + 16 + 160 * VG
207 ; GISEL-NEXT: .cfi_remember_state
208 ; GISEL-NEXT: str z0, [sp] // 16-byte Folded Spill
209 ; GISEL-NEXT: .Ltmp0:
210 ; GISEL-NEXT: bl may_throw_sve
211 ; GISEL-NEXT: .Ltmp1:
212 ; GISEL-NEXT: str z0, [sp, #1, mul vl] // 16-byte Folded Spill
213 ; GISEL-NEXT: b .LBB0_1
214 ; GISEL-NEXT: .LBB0_1: // %.Lcontinue
215 ; GISEL-NEXT: ldr z0, [sp, #1, mul vl] // 16-byte Folded Reload
216 ; GISEL-NEXT: addvl sp, sp, #2
217 ; GISEL-NEXT: .cfi_escape 0x0f, 0x0d, 0x8f, 0x00, 0x11, 0x10, 0x22, 0x11, 0x90, 0x01, 0x92, 0x2e, 0x00, 0x1e, 0x22 // sp + 16 + 144 * VG
218 ; GISEL-NEXT: ldr p15, [sp, #4, mul vl] // 2-byte Folded Reload
219 ; GISEL-NEXT: ldr p14, [sp, #5, mul vl] // 2-byte Folded Reload
220 ; GISEL-NEXT: ldr p13, [sp, #6, mul vl] // 2-byte Folded Reload
221 ; GISEL-NEXT: ldr p12, [sp, #7, mul vl] // 2-byte Folded Reload
222 ; GISEL-NEXT: ldr p11, [sp, #8, mul vl] // 2-byte Folded Reload
223 ; GISEL-NEXT: ldr p10, [sp, #9, mul vl] // 2-byte Folded Reload
224 ; GISEL-NEXT: ldr p9, [sp, #10, mul vl] // 2-byte Folded Reload
225 ; GISEL-NEXT: ldr p8, [sp, #11, mul vl] // 2-byte Folded Reload
226 ; GISEL-NEXT: ldr p7, [sp, #12, mul vl] // 2-byte Folded Reload
227 ; GISEL-NEXT: ldr p6, [sp, #13, mul vl] // 2-byte Folded Reload
228 ; GISEL-NEXT: ldr p5, [sp, #14, mul vl] // 2-byte Folded Reload
229 ; GISEL-NEXT: ldr p4, [sp, #15, mul vl] // 2-byte Folded Reload
230 ; GISEL-NEXT: ldr z23, [sp, #2, mul vl] // 16-byte Folded Reload
231 ; GISEL-NEXT: ldr z22, [sp, #3, mul vl] // 16-byte Folded Reload
232 ; GISEL-NEXT: ldr z21, [sp, #4, mul vl] // 16-byte Folded Reload
233 ; GISEL-NEXT: ldr z20, [sp, #5, mul vl] // 16-byte Folded Reload
234 ; GISEL-NEXT: ldr z19, [sp, #6, mul vl] // 16-byte Folded Reload
235 ; GISEL-NEXT: ldr z18, [sp, #7, mul vl] // 16-byte Folded Reload
236 ; GISEL-NEXT: ldr z17, [sp, #8, mul vl] // 16-byte Folded Reload
237 ; GISEL-NEXT: ldr z16, [sp, #9, mul vl] // 16-byte Folded Reload
238 ; GISEL-NEXT: ldr z15, [sp, #10, mul vl] // 16-byte Folded Reload
239 ; GISEL-NEXT: ldr z14, [sp, #11, mul vl] // 16-byte Folded Reload
240 ; GISEL-NEXT: ldr z13, [sp, #12, mul vl] // 16-byte Folded Reload
241 ; GISEL-NEXT: ldr z12, [sp, #13, mul vl] // 16-byte Folded Reload
242 ; GISEL-NEXT: ldr z11, [sp, #14, mul vl] // 16-byte Folded Reload
243 ; GISEL-NEXT: ldr z10, [sp, #15, mul vl] // 16-byte Folded Reload
244 ; GISEL-NEXT: ldr z9, [sp, #16, mul vl] // 16-byte Folded Reload
245 ; GISEL-NEXT: ldr z8, [sp, #17, mul vl] // 16-byte Folded Reload
246 ; GISEL-NEXT: addvl sp, sp, #18
247 ; GISEL-NEXT: .cfi_def_cfa wsp, 16
248 ; GISEL-NEXT: .cfi_restore z8
249 ; GISEL-NEXT: .cfi_restore z9
250 ; GISEL-NEXT: .cfi_restore z10
251 ; GISEL-NEXT: .cfi_restore z11
252 ; GISEL-NEXT: .cfi_restore z12
253 ; GISEL-NEXT: .cfi_restore z13
254 ; GISEL-NEXT: .cfi_restore z14
255 ; GISEL-NEXT: .cfi_restore z15
256 ; GISEL-NEXT: ldp x29, x30, [sp], #16 // 16-byte Folded Reload
257 ; GISEL-NEXT: .cfi_def_cfa_offset 0
258 ; GISEL-NEXT: .cfi_restore w30
259 ; GISEL-NEXT: .cfi_restore w29
261 ; GISEL-NEXT: .LBB0_2: // %.Lunwind
262 ; GISEL-NEXT: .cfi_restore_state
263 ; GISEL-NEXT: .Ltmp2:
264 ; GISEL-NEXT: ldr z0, [sp] // 16-byte Folded Reload
265 ; GISEL-NEXT: addvl sp, sp, #2
266 ; GISEL-NEXT: .cfi_escape 0x0f, 0x0d, 0x8f, 0x00, 0x11, 0x10, 0x22, 0x11, 0x90, 0x01, 0x92, 0x2e, 0x00, 0x1e, 0x22 // sp + 16 + 144 * VG
267 ; GISEL-NEXT: ldr p15, [sp, #4, mul vl] // 2-byte Folded Reload
268 ; GISEL-NEXT: ldr p14, [sp, #5, mul vl] // 2-byte Folded Reload
269 ; GISEL-NEXT: ldr p13, [sp, #6, mul vl] // 2-byte Folded Reload
270 ; GISEL-NEXT: ldr p12, [sp, #7, mul vl] // 2-byte Folded Reload
271 ; GISEL-NEXT: ldr p11, [sp, #8, mul vl] // 2-byte Folded Reload
272 ; GISEL-NEXT: ldr p10, [sp, #9, mul vl] // 2-byte Folded Reload
273 ; GISEL-NEXT: ldr p9, [sp, #10, mul vl] // 2-byte Folded Reload
274 ; GISEL-NEXT: ldr p8, [sp, #11, mul vl] // 2-byte Folded Reload
275 ; GISEL-NEXT: ldr p7, [sp, #12, mul vl] // 2-byte Folded Reload
276 ; GISEL-NEXT: ldr p6, [sp, #13, mul vl] // 2-byte Folded Reload
277 ; GISEL-NEXT: ldr p5, [sp, #14, mul vl] // 2-byte Folded Reload
278 ; GISEL-NEXT: ldr p4, [sp, #15, mul vl] // 2-byte Folded Reload
279 ; GISEL-NEXT: ldr z23, [sp, #2, mul vl] // 16-byte Folded Reload
280 ; GISEL-NEXT: ldr z22, [sp, #3, mul vl] // 16-byte Folded Reload
281 ; GISEL-NEXT: ldr z21, [sp, #4, mul vl] // 16-byte Folded Reload
282 ; GISEL-NEXT: ldr z20, [sp, #5, mul vl] // 16-byte Folded Reload
283 ; GISEL-NEXT: ldr z19, [sp, #6, mul vl] // 16-byte Folded Reload
284 ; GISEL-NEXT: ldr z18, [sp, #7, mul vl] // 16-byte Folded Reload
285 ; GISEL-NEXT: ldr z17, [sp, #8, mul vl] // 16-byte Folded Reload
286 ; GISEL-NEXT: ldr z16, [sp, #9, mul vl] // 16-byte Folded Reload
287 ; GISEL-NEXT: ldr z15, [sp, #10, mul vl] // 16-byte Folded Reload
288 ; GISEL-NEXT: ldr z14, [sp, #11, mul vl] // 16-byte Folded Reload
289 ; GISEL-NEXT: ldr z13, [sp, #12, mul vl] // 16-byte Folded Reload
290 ; GISEL-NEXT: ldr z12, [sp, #13, mul vl] // 16-byte Folded Reload
291 ; GISEL-NEXT: ldr z11, [sp, #14, mul vl] // 16-byte Folded Reload
292 ; GISEL-NEXT: ldr z10, [sp, #15, mul vl] // 16-byte Folded Reload
293 ; GISEL-NEXT: ldr z9, [sp, #16, mul vl] // 16-byte Folded Reload
294 ; GISEL-NEXT: ldr z8, [sp, #17, mul vl] // 16-byte Folded Reload
295 ; GISEL-NEXT: addvl sp, sp, #18
296 ; GISEL-NEXT: .cfi_def_cfa wsp, 16
297 ; GISEL-NEXT: .cfi_restore z8
298 ; GISEL-NEXT: .cfi_restore z9
299 ; GISEL-NEXT: .cfi_restore z10
300 ; GISEL-NEXT: .cfi_restore z11
301 ; GISEL-NEXT: .cfi_restore z12
302 ; GISEL-NEXT: .cfi_restore z13
303 ; GISEL-NEXT: .cfi_restore z14
304 ; GISEL-NEXT: .cfi_restore z15
305 ; GISEL-NEXT: ldp x29, x30, [sp], #16 // 16-byte Folded Reload
306 ; GISEL-NEXT: .cfi_def_cfa_offset 0
307 ; GISEL-NEXT: .cfi_restore w30
308 ; GISEL-NEXT: .cfi_restore w29
310 %result = invoke <vscale x 4 x i32> @may_throw_sve(<vscale x 4 x i32> %v) to label %.Lcontinue unwind label %.Lunwind
312 ret <vscale x 4 x i32> %result
314 %lp = landingpad { ptr, i32 } cleanup
315 ret <vscale x 4 x i32> %v;
318 declare <vscale x 4 x i32> @may_throw_sve(<vscale x 4 x i32> %v);
321 ; Test that q0 is saved/restored, as the unwinder may only retain the low 64bits (d0).
322 define aarch64_vector_pcs <4 x i32> @invoke_callee_may_throw_neon(<4 x i32> %v) uwtable personality i8 0 {
323 ; CHECK-LABEL: invoke_callee_may_throw_neon:
324 ; CHECK: .Lfunc_begin1:
325 ; CHECK-NEXT: .cfi_startproc
326 ; CHECK-NEXT: // %bb.0:
327 ; CHECK-NEXT: sub sp, sp, #304
328 ; CHECK-NEXT: .cfi_def_cfa_offset 304
329 ; CHECK-NEXT: stp q23, q22, [sp, #32] // 32-byte Folded Spill
330 ; CHECK-NEXT: stp q21, q20, [sp, #64] // 32-byte Folded Spill
331 ; CHECK-NEXT: stp q19, q18, [sp, #96] // 32-byte Folded Spill
332 ; CHECK-NEXT: stp q17, q16, [sp, #128] // 32-byte Folded Spill
333 ; CHECK-NEXT: stp q15, q14, [sp, #160] // 32-byte Folded Spill
334 ; CHECK-NEXT: stp q13, q12, [sp, #192] // 32-byte Folded Spill
335 ; CHECK-NEXT: stp q11, q10, [sp, #224] // 32-byte Folded Spill
336 ; CHECK-NEXT: stp q9, q8, [sp, #256] // 32-byte Folded Spill
337 ; CHECK-NEXT: stp x29, x30, [sp, #288] // 16-byte Folded Spill
338 ; CHECK-NEXT: .cfi_offset w30, -8
339 ; CHECK-NEXT: .cfi_offset w29, -16
340 ; CHECK-NEXT: .cfi_offset b8, -32
341 ; CHECK-NEXT: .cfi_offset b9, -48
342 ; CHECK-NEXT: .cfi_offset b10, -64
343 ; CHECK-NEXT: .cfi_offset b11, -80
344 ; CHECK-NEXT: .cfi_offset b12, -96
345 ; CHECK-NEXT: .cfi_offset b13, -112
346 ; CHECK-NEXT: .cfi_offset b14, -128
347 ; CHECK-NEXT: .cfi_offset b15, -144
348 ; CHECK-NEXT: .cfi_offset b16, -160
349 ; CHECK-NEXT: .cfi_offset b17, -176
350 ; CHECK-NEXT: .cfi_offset b18, -192
351 ; CHECK-NEXT: .cfi_offset b19, -208
352 ; CHECK-NEXT: .cfi_offset b20, -224
353 ; CHECK-NEXT: .cfi_offset b21, -240
354 ; CHECK-NEXT: .cfi_offset b22, -256
355 ; CHECK-NEXT: .cfi_offset b23, -272
356 ; CHECK-NEXT: .cfi_remember_state
357 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
358 ; CHECK-NEXT: .Ltmp3:
359 ; CHECK-NEXT: bl may_throw_neon
360 ; CHECK-NEXT: .Ltmp4:
361 ; CHECK-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
362 ; CHECK-NEXT: b .LBB1_1
363 ; CHECK-NEXT: .LBB1_1: // %.Lcontinue
364 ; CHECK-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
365 ; CHECK-NEXT: ldp x29, x30, [sp, #288] // 16-byte Folded Reload
366 ; CHECK-NEXT: ldp q9, q8, [sp, #256] // 32-byte Folded Reload
367 ; CHECK-NEXT: ldp q11, q10, [sp, #224] // 32-byte Folded Reload
368 ; CHECK-NEXT: ldp q13, q12, [sp, #192] // 32-byte Folded Reload
369 ; CHECK-NEXT: ldp q15, q14, [sp, #160] // 32-byte Folded Reload
370 ; CHECK-NEXT: ldp q17, q16, [sp, #128] // 32-byte Folded Reload
371 ; CHECK-NEXT: ldp q19, q18, [sp, #96] // 32-byte Folded Reload
372 ; CHECK-NEXT: ldp q21, q20, [sp, #64] // 32-byte Folded Reload
373 ; CHECK-NEXT: ldp q23, q22, [sp, #32] // 32-byte Folded Reload
374 ; CHECK-NEXT: add sp, sp, #304
375 ; CHECK-NEXT: .cfi_def_cfa_offset 0
376 ; CHECK-NEXT: .cfi_restore w30
377 ; CHECK-NEXT: .cfi_restore w29
378 ; CHECK-NEXT: .cfi_restore b8
379 ; CHECK-NEXT: .cfi_restore b9
380 ; CHECK-NEXT: .cfi_restore b10
381 ; CHECK-NEXT: .cfi_restore b11
382 ; CHECK-NEXT: .cfi_restore b12
383 ; CHECK-NEXT: .cfi_restore b13
384 ; CHECK-NEXT: .cfi_restore b14
385 ; CHECK-NEXT: .cfi_restore b15
386 ; CHECK-NEXT: .cfi_restore b16
387 ; CHECK-NEXT: .cfi_restore b17
388 ; CHECK-NEXT: .cfi_restore b18
389 ; CHECK-NEXT: .cfi_restore b19
390 ; CHECK-NEXT: .cfi_restore b20
391 ; CHECK-NEXT: .cfi_restore b21
392 ; CHECK-NEXT: .cfi_restore b22
393 ; CHECK-NEXT: .cfi_restore b23
395 ; CHECK-NEXT: .LBB1_2: // %.Lunwind
396 ; CHECK-NEXT: .cfi_restore_state
397 ; CHECK-NEXT: .Ltmp5:
398 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
399 ; CHECK-NEXT: ldp x29, x30, [sp, #288] // 16-byte Folded Reload
400 ; CHECK-NEXT: ldp q9, q8, [sp, #256] // 32-byte Folded Reload
401 ; CHECK-NEXT: ldp q11, q10, [sp, #224] // 32-byte Folded Reload
402 ; CHECK-NEXT: ldp q13, q12, [sp, #192] // 32-byte Folded Reload
403 ; CHECK-NEXT: ldp q15, q14, [sp, #160] // 32-byte Folded Reload
404 ; CHECK-NEXT: ldp q17, q16, [sp, #128] // 32-byte Folded Reload
405 ; CHECK-NEXT: ldp q19, q18, [sp, #96] // 32-byte Folded Reload
406 ; CHECK-NEXT: ldp q21, q20, [sp, #64] // 32-byte Folded Reload
407 ; CHECK-NEXT: ldp q23, q22, [sp, #32] // 32-byte Folded Reload
408 ; CHECK-NEXT: add sp, sp, #304
409 ; CHECK-NEXT: .cfi_def_cfa_offset 0
410 ; CHECK-NEXT: .cfi_restore w30
411 ; CHECK-NEXT: .cfi_restore w29
412 ; CHECK-NEXT: .cfi_restore b8
413 ; CHECK-NEXT: .cfi_restore b9
414 ; CHECK-NEXT: .cfi_restore b10
415 ; CHECK-NEXT: .cfi_restore b11
416 ; CHECK-NEXT: .cfi_restore b12
417 ; CHECK-NEXT: .cfi_restore b13
418 ; CHECK-NEXT: .cfi_restore b14
419 ; CHECK-NEXT: .cfi_restore b15
420 ; CHECK-NEXT: .cfi_restore b16
421 ; CHECK-NEXT: .cfi_restore b17
422 ; CHECK-NEXT: .cfi_restore b18
423 ; CHECK-NEXT: .cfi_restore b19
424 ; CHECK-NEXT: .cfi_restore b20
425 ; CHECK-NEXT: .cfi_restore b21
426 ; CHECK-NEXT: .cfi_restore b22
427 ; CHECK-NEXT: .cfi_restore b23
430 ; GISEL-LABEL: invoke_callee_may_throw_neon:
431 ; GISEL: .Lfunc_begin1:
432 ; GISEL-NEXT: .cfi_startproc
433 ; GISEL-NEXT: // %bb.0:
434 ; GISEL-NEXT: sub sp, sp, #304
435 ; GISEL-NEXT: .cfi_def_cfa_offset 304
436 ; GISEL-NEXT: stp q23, q22, [sp, #32] // 32-byte Folded Spill
437 ; GISEL-NEXT: stp q21, q20, [sp, #64] // 32-byte Folded Spill
438 ; GISEL-NEXT: stp q19, q18, [sp, #96] // 32-byte Folded Spill
439 ; GISEL-NEXT: stp q17, q16, [sp, #128] // 32-byte Folded Spill
440 ; GISEL-NEXT: stp q15, q14, [sp, #160] // 32-byte Folded Spill
441 ; GISEL-NEXT: stp q13, q12, [sp, #192] // 32-byte Folded Spill
442 ; GISEL-NEXT: stp q11, q10, [sp, #224] // 32-byte Folded Spill
443 ; GISEL-NEXT: stp q9, q8, [sp, #256] // 32-byte Folded Spill
444 ; GISEL-NEXT: stp x29, x30, [sp, #288] // 16-byte Folded Spill
445 ; GISEL-NEXT: .cfi_offset w30, -8
446 ; GISEL-NEXT: .cfi_offset w29, -16
447 ; GISEL-NEXT: .cfi_offset b8, -32
448 ; GISEL-NEXT: .cfi_offset b9, -48
449 ; GISEL-NEXT: .cfi_offset b10, -64
450 ; GISEL-NEXT: .cfi_offset b11, -80
451 ; GISEL-NEXT: .cfi_offset b12, -96
452 ; GISEL-NEXT: .cfi_offset b13, -112
453 ; GISEL-NEXT: .cfi_offset b14, -128
454 ; GISEL-NEXT: .cfi_offset b15, -144
455 ; GISEL-NEXT: .cfi_offset b16, -160
456 ; GISEL-NEXT: .cfi_offset b17, -176
457 ; GISEL-NEXT: .cfi_offset b18, -192
458 ; GISEL-NEXT: .cfi_offset b19, -208
459 ; GISEL-NEXT: .cfi_offset b20, -224
460 ; GISEL-NEXT: .cfi_offset b21, -240
461 ; GISEL-NEXT: .cfi_offset b22, -256
462 ; GISEL-NEXT: .cfi_offset b23, -272
463 ; GISEL-NEXT: .cfi_remember_state
464 ; GISEL-NEXT: str q0, [sp] // 16-byte Folded Spill
465 ; GISEL-NEXT: .Ltmp3:
466 ; GISEL-NEXT: bl may_throw_neon
467 ; GISEL-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
468 ; GISEL-NEXT: .Ltmp4:
469 ; GISEL-NEXT: b .LBB1_1
470 ; GISEL-NEXT: .LBB1_1: // %.Lcontinue
471 ; GISEL-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
472 ; GISEL-NEXT: ldp x29, x30, [sp, #288] // 16-byte Folded Reload
473 ; GISEL-NEXT: ldp q9, q8, [sp, #256] // 32-byte Folded Reload
474 ; GISEL-NEXT: ldp q11, q10, [sp, #224] // 32-byte Folded Reload
475 ; GISEL-NEXT: ldp q13, q12, [sp, #192] // 32-byte Folded Reload
476 ; GISEL-NEXT: ldp q15, q14, [sp, #160] // 32-byte Folded Reload
477 ; GISEL-NEXT: ldp q17, q16, [sp, #128] // 32-byte Folded Reload
478 ; GISEL-NEXT: ldp q19, q18, [sp, #96] // 32-byte Folded Reload
479 ; GISEL-NEXT: ldp q21, q20, [sp, #64] // 32-byte Folded Reload
480 ; GISEL-NEXT: ldp q23, q22, [sp, #32] // 32-byte Folded Reload
481 ; GISEL-NEXT: add sp, sp, #304
482 ; GISEL-NEXT: .cfi_def_cfa_offset 0
483 ; GISEL-NEXT: .cfi_restore w30
484 ; GISEL-NEXT: .cfi_restore w29
485 ; GISEL-NEXT: .cfi_restore b8
486 ; GISEL-NEXT: .cfi_restore b9
487 ; GISEL-NEXT: .cfi_restore b10
488 ; GISEL-NEXT: .cfi_restore b11
489 ; GISEL-NEXT: .cfi_restore b12
490 ; GISEL-NEXT: .cfi_restore b13
491 ; GISEL-NEXT: .cfi_restore b14
492 ; GISEL-NEXT: .cfi_restore b15
493 ; GISEL-NEXT: .cfi_restore b16
494 ; GISEL-NEXT: .cfi_restore b17
495 ; GISEL-NEXT: .cfi_restore b18
496 ; GISEL-NEXT: .cfi_restore b19
497 ; GISEL-NEXT: .cfi_restore b20
498 ; GISEL-NEXT: .cfi_restore b21
499 ; GISEL-NEXT: .cfi_restore b22
500 ; GISEL-NEXT: .cfi_restore b23
502 ; GISEL-NEXT: .LBB1_2: // %.Lunwind
503 ; GISEL-NEXT: .cfi_restore_state
504 ; GISEL-NEXT: .Ltmp5:
505 ; GISEL-NEXT: ldr q0, [sp] // 16-byte Folded Reload
506 ; GISEL-NEXT: ldp x29, x30, [sp, #288] // 16-byte Folded Reload
507 ; GISEL-NEXT: ldp q9, q8, [sp, #256] // 32-byte Folded Reload
508 ; GISEL-NEXT: ldp q11, q10, [sp, #224] // 32-byte Folded Reload
509 ; GISEL-NEXT: ldp q13, q12, [sp, #192] // 32-byte Folded Reload
510 ; GISEL-NEXT: ldp q15, q14, [sp, #160] // 32-byte Folded Reload
511 ; GISEL-NEXT: ldp q17, q16, [sp, #128] // 32-byte Folded Reload
512 ; GISEL-NEXT: ldp q19, q18, [sp, #96] // 32-byte Folded Reload
513 ; GISEL-NEXT: ldp q21, q20, [sp, #64] // 32-byte Folded Reload
514 ; GISEL-NEXT: ldp q23, q22, [sp, #32] // 32-byte Folded Reload
515 ; GISEL-NEXT: add sp, sp, #304
516 ; GISEL-NEXT: .cfi_def_cfa_offset 0
517 ; GISEL-NEXT: .cfi_restore w30
518 ; GISEL-NEXT: .cfi_restore w29
519 ; GISEL-NEXT: .cfi_restore b8
520 ; GISEL-NEXT: .cfi_restore b9
521 ; GISEL-NEXT: .cfi_restore b10
522 ; GISEL-NEXT: .cfi_restore b11
523 ; GISEL-NEXT: .cfi_restore b12
524 ; GISEL-NEXT: .cfi_restore b13
525 ; GISEL-NEXT: .cfi_restore b14
526 ; GISEL-NEXT: .cfi_restore b15
527 ; GISEL-NEXT: .cfi_restore b16
528 ; GISEL-NEXT: .cfi_restore b17
529 ; GISEL-NEXT: .cfi_restore b18
530 ; GISEL-NEXT: .cfi_restore b19
531 ; GISEL-NEXT: .cfi_restore b20
532 ; GISEL-NEXT: .cfi_restore b21
533 ; GISEL-NEXT: .cfi_restore b22
534 ; GISEL-NEXT: .cfi_restore b23
536 %result = invoke aarch64_vector_pcs <4 x i32> @may_throw_neon(<4 x i32> %v) to label %.Lcontinue unwind label %.Lunwind
538 ret <4 x i32> %result
540 %lp = landingpad { ptr, i32 } cleanup
544 declare aarch64_vector_pcs <4 x i32> @may_throw_neon(<4 x i32> %v);