1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=arm64-eabi | FileCheck %s
4 define void @bzero_4_heap(ptr nocapture %c) {
5 ; CHECK-LABEL: bzero_4_heap:
7 ; CHECK-NEXT: str wzr, [x0]
9 call void @llvm.memset.p0.i64(ptr align 4 %c, i8 0, i64 4, i1 false)
13 define void @bzero_8_heap(ptr nocapture %c) {
14 ; CHECK-LABEL: bzero_8_heap:
16 ; CHECK-NEXT: str xzr, [x0]
18 call void @llvm.memset.p0.i64(ptr align 8 %c, i8 0, i64 8, i1 false)
22 define void @bzero_12_heap(ptr nocapture %c) {
23 ; CHECK-LABEL: bzero_12_heap:
25 ; CHECK-NEXT: str wzr, [x0, #8]
26 ; CHECK-NEXT: str xzr, [x0]
28 call void @llvm.memset.p0.i64(ptr align 8 %c, i8 0, i64 12, i1 false)
32 define void @bzero_16_heap(ptr nocapture %c) {
33 ; CHECK-LABEL: bzero_16_heap:
35 ; CHECK-NEXT: stp xzr, xzr, [x0]
37 call void @llvm.memset.p0.i64(ptr align 8 %c, i8 0, i64 16, i1 false)
41 define void @bzero_32_heap(ptr nocapture %c) {
42 ; CHECK-LABEL: bzero_32_heap:
44 ; CHECK-NEXT: movi v0.2d, #0000000000000000
45 ; CHECK-NEXT: stp q0, q0, [x0]
47 call void @llvm.memset.p0.i64(ptr align 8 %c, i8 0, i64 32, i1 false)
51 define void @bzero_64_heap(ptr nocapture %c) {
52 ; CHECK-LABEL: bzero_64_heap:
54 ; CHECK-NEXT: movi v0.2d, #0000000000000000
55 ; CHECK-NEXT: stp q0, q0, [x0]
56 ; CHECK-NEXT: stp q0, q0, [x0, #32]
58 call void @llvm.memset.p0.i64(ptr align 8 %c, i8 0, i64 64, i1 false)
62 define void @bzero_4_stack() {
63 ; CHECK-LABEL: bzero_4_stack:
65 ; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
66 ; CHECK-NEXT: .cfi_def_cfa_offset 16
67 ; CHECK-NEXT: .cfi_offset w30, -16
68 ; CHECK-NEXT: add x0, sp, #12
69 ; CHECK-NEXT: str wzr, [sp, #12]
70 ; CHECK-NEXT: bl something
71 ; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
73 %buf = alloca [4 x i8], align 1
74 call void @llvm.memset.p0.i32(ptr %buf, i8 0, i32 4, i1 false)
75 call void @something(ptr %buf)
79 define void @bzero_8_stack() {
80 ; CHECK-LABEL: bzero_8_stack:
82 ; CHECK-NEXT: stp x30, xzr, [sp, #-16]! // 8-byte Folded Spill
83 ; CHECK-NEXT: .cfi_def_cfa_offset 16
84 ; CHECK-NEXT: .cfi_offset w30, -16
85 ; CHECK-NEXT: add x0, sp, #8
86 ; CHECK-NEXT: bl something
87 ; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
89 %buf = alloca [8 x i8], align 1
90 call void @llvm.memset.p0.i32(ptr %buf, i8 0, i32 8, i1 false)
91 call void @something(ptr %buf)
95 define void @bzero_12_stack() {
96 ; CHECK-LABEL: bzero_12_stack:
98 ; CHECK-NEXT: sub sp, sp, #32
99 ; CHECK-NEXT: str x30, [sp, #16] // 8-byte Folded Spill
100 ; CHECK-NEXT: .cfi_def_cfa_offset 32
101 ; CHECK-NEXT: .cfi_offset w30, -16
102 ; CHECK-NEXT: mov x0, sp
103 ; CHECK-NEXT: str wzr, [sp, #8]
104 ; CHECK-NEXT: str xzr, [sp]
105 ; CHECK-NEXT: bl something
106 ; CHECK-NEXT: ldr x30, [sp, #16] // 8-byte Folded Reload
107 ; CHECK-NEXT: add sp, sp, #32
109 %buf = alloca [12 x i8], align 1
110 call void @llvm.memset.p0.i32(ptr %buf, i8 0, i32 12, i1 false)
111 call void @something(ptr %buf)
115 define void @bzero_16_stack() {
116 ; CHECK-LABEL: bzero_16_stack:
118 ; CHECK-NEXT: sub sp, sp, #32
119 ; CHECK-NEXT: stp xzr, x30, [sp, #8] // 8-byte Folded Spill
120 ; CHECK-NEXT: .cfi_def_cfa_offset 32
121 ; CHECK-NEXT: .cfi_offset w30, -16
122 ; CHECK-NEXT: mov x0, sp
123 ; CHECK-NEXT: str xzr, [sp]
124 ; CHECK-NEXT: bl something
125 ; CHECK-NEXT: ldr x30, [sp, #16] // 8-byte Folded Reload
126 ; CHECK-NEXT: add sp, sp, #32
128 %buf = alloca [16 x i8], align 1
129 call void @llvm.memset.p0.i32(ptr %buf, i8 0, i32 16, i1 false)
130 call void @something(ptr %buf)
134 define void @bzero_20_stack() {
135 ; CHECK-LABEL: bzero_20_stack:
137 ; CHECK-NEXT: sub sp, sp, #48
138 ; CHECK-NEXT: str x30, [sp, #32] // 8-byte Folded Spill
139 ; CHECK-NEXT: .cfi_def_cfa_offset 48
140 ; CHECK-NEXT: .cfi_offset w30, -16
141 ; CHECK-NEXT: add x0, sp, #8
142 ; CHECK-NEXT: stp xzr, xzr, [sp, #8]
143 ; CHECK-NEXT: str wzr, [sp, #24]
144 ; CHECK-NEXT: bl something
145 ; CHECK-NEXT: ldr x30, [sp, #32] // 8-byte Folded Reload
146 ; CHECK-NEXT: add sp, sp, #48
148 %buf = alloca [20 x i8], align 1
149 call void @llvm.memset.p0.i32(ptr %buf, i8 0, i32 20, i1 false)
150 call void @something(ptr %buf)
154 define void @bzero_26_stack() {
155 ; CHECK-LABEL: bzero_26_stack:
157 ; CHECK-NEXT: sub sp, sp, #48
158 ; CHECK-NEXT: str x30, [sp, #32] // 8-byte Folded Spill
159 ; CHECK-NEXT: .cfi_def_cfa_offset 48
160 ; CHECK-NEXT: .cfi_offset w30, -16
161 ; CHECK-NEXT: mov x0, sp
162 ; CHECK-NEXT: stp xzr, xzr, [sp]
163 ; CHECK-NEXT: strh wzr, [sp, #24]
164 ; CHECK-NEXT: str xzr, [sp, #16]
165 ; CHECK-NEXT: bl something
166 ; CHECK-NEXT: ldr x30, [sp, #32] // 8-byte Folded Reload
167 ; CHECK-NEXT: add sp, sp, #48
169 %buf = alloca [26 x i8], align 1
170 call void @llvm.memset.p0.i32(ptr %buf, i8 0, i32 26, i1 false)
171 call void @something(ptr %buf)
175 define void @bzero_32_stack() {
176 ; CHECK-LABEL: bzero_32_stack:
178 ; CHECK-NEXT: sub sp, sp, #48
179 ; CHECK-NEXT: str x30, [sp, #32] // 8-byte Folded Spill
180 ; CHECK-NEXT: .cfi_def_cfa_offset 48
181 ; CHECK-NEXT: .cfi_offset w30, -16
182 ; CHECK-NEXT: movi v0.2d, #0000000000000000
183 ; CHECK-NEXT: mov x0, sp
184 ; CHECK-NEXT: stp q0, q0, [sp]
185 ; CHECK-NEXT: bl something
186 ; CHECK-NEXT: ldr x30, [sp, #32] // 8-byte Folded Reload
187 ; CHECK-NEXT: add sp, sp, #48
189 %buf = alloca [32 x i8], align 1
190 call void @llvm.memset.p0.i32(ptr %buf, i8 0, i32 32, i1 false)
191 call void @something(ptr %buf)
195 define void @bzero_40_stack() {
196 ; CHECK-LABEL: bzero_40_stack:
198 ; CHECK-NEXT: sub sp, sp, #64
199 ; CHECK-NEXT: str x30, [sp, #48] // 8-byte Folded Spill
200 ; CHECK-NEXT: .cfi_def_cfa_offset 64
201 ; CHECK-NEXT: .cfi_offset w30, -16
202 ; CHECK-NEXT: movi v0.2d, #0000000000000000
203 ; CHECK-NEXT: mov x0, sp
204 ; CHECK-NEXT: str xzr, [sp, #32]
205 ; CHECK-NEXT: stp q0, q0, [sp]
206 ; CHECK-NEXT: bl something
207 ; CHECK-NEXT: ldr x30, [sp, #48] // 8-byte Folded Reload
208 ; CHECK-NEXT: add sp, sp, #64
210 %buf = alloca [40 x i8], align 1
211 call void @llvm.memset.p0.i32(ptr %buf, i8 0, i32 40, i1 false)
212 call void @something(ptr %buf)
216 define void @bzero_64_stack() {
217 ; CHECK-LABEL: bzero_64_stack:
219 ; CHECK-NEXT: sub sp, sp, #80
220 ; CHECK-NEXT: str x30, [sp, #64] // 8-byte Folded Spill
221 ; CHECK-NEXT: .cfi_def_cfa_offset 80
222 ; CHECK-NEXT: .cfi_offset w30, -16
223 ; CHECK-NEXT: movi v0.2d, #0000000000000000
224 ; CHECK-NEXT: mov x0, sp
225 ; CHECK-NEXT: stp q0, q0, [sp]
226 ; CHECK-NEXT: stp q0, q0, [sp, #32]
227 ; CHECK-NEXT: bl something
228 ; CHECK-NEXT: ldr x30, [sp, #64] // 8-byte Folded Reload
229 ; CHECK-NEXT: add sp, sp, #80
231 %buf = alloca [64 x i8], align 1
232 call void @llvm.memset.p0.i32(ptr %buf, i8 0, i32 64, i1 false)
233 call void @something(ptr %buf)
237 define void @bzero_72_stack() {
238 ; CHECK-LABEL: bzero_72_stack:
240 ; CHECK-NEXT: sub sp, sp, #96
241 ; CHECK-NEXT: str x30, [sp, #80] // 8-byte Folded Spill
242 ; CHECK-NEXT: .cfi_def_cfa_offset 96
243 ; CHECK-NEXT: .cfi_offset w30, -16
244 ; CHECK-NEXT: movi v0.2d, #0000000000000000
245 ; CHECK-NEXT: mov x0, sp
246 ; CHECK-NEXT: str xzr, [sp, #64]
247 ; CHECK-NEXT: stp q0, q0, [sp]
248 ; CHECK-NEXT: stp q0, q0, [sp, #32]
249 ; CHECK-NEXT: bl something
250 ; CHECK-NEXT: ldr x30, [sp, #80] // 8-byte Folded Reload
251 ; CHECK-NEXT: add sp, sp, #96
253 %buf = alloca [72 x i8], align 1
254 call void @llvm.memset.p0.i32(ptr %buf, i8 0, i32 72, i1 false)
255 call void @something(ptr %buf)
259 define void @bzero_128_stack() {
260 ; CHECK-LABEL: bzero_128_stack:
262 ; CHECK-NEXT: sub sp, sp, #144
263 ; CHECK-NEXT: str x30, [sp, #128] // 8-byte Folded Spill
264 ; CHECK-NEXT: .cfi_def_cfa_offset 144
265 ; CHECK-NEXT: .cfi_offset w30, -16
266 ; CHECK-NEXT: movi v0.2d, #0000000000000000
267 ; CHECK-NEXT: mov x0, sp
268 ; CHECK-NEXT: stp q0, q0, [sp]
269 ; CHECK-NEXT: stp q0, q0, [sp, #32]
270 ; CHECK-NEXT: stp q0, q0, [sp, #64]
271 ; CHECK-NEXT: stp q0, q0, [sp, #96]
272 ; CHECK-NEXT: bl something
273 ; CHECK-NEXT: ldr x30, [sp, #128] // 8-byte Folded Reload
274 ; CHECK-NEXT: add sp, sp, #144
276 %buf = alloca [128 x i8], align 1
277 call void @llvm.memset.p0.i32(ptr %buf, i8 0, i32 128, i1 false)
278 call void @something(ptr %buf)
282 define void @bzero_256_stack() {
283 ; CHECK-LABEL: bzero_256_stack:
285 ; CHECK-NEXT: sub sp, sp, #272
286 ; CHECK-NEXT: stp x29, x30, [sp, #256] // 16-byte Folded Spill
287 ; CHECK-NEXT: .cfi_def_cfa_offset 272
288 ; CHECK-NEXT: .cfi_offset w30, -8
289 ; CHECK-NEXT: .cfi_offset w29, -16
290 ; CHECK-NEXT: movi v0.2d, #0000000000000000
291 ; CHECK-NEXT: mov x0, sp
292 ; CHECK-NEXT: stp q0, q0, [sp]
293 ; CHECK-NEXT: stp q0, q0, [sp, #32]
294 ; CHECK-NEXT: stp q0, q0, [sp, #64]
295 ; CHECK-NEXT: stp q0, q0, [sp, #96]
296 ; CHECK-NEXT: stp q0, q0, [sp, #128]
297 ; CHECK-NEXT: stp q0, q0, [sp, #160]
298 ; CHECK-NEXT: stp q0, q0, [sp, #192]
299 ; CHECK-NEXT: stp q0, q0, [sp, #224]
300 ; CHECK-NEXT: bl something
301 ; CHECK-NEXT: ldp x29, x30, [sp, #256] // 16-byte Folded Reload
302 ; CHECK-NEXT: add sp, sp, #272
304 %buf = alloca [256 x i8], align 1
305 call void @llvm.memset.p0.i32(ptr %buf, i8 0, i32 256, i1 false)
306 call void @something(ptr %buf)
310 define void @memset_4_stack() {
311 ; CHECK-LABEL: memset_4_stack:
313 ; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
314 ; CHECK-NEXT: .cfi_def_cfa_offset 16
315 ; CHECK-NEXT: .cfi_offset w30, -16
316 ; CHECK-NEXT: mov w8, #-1431655766
317 ; CHECK-NEXT: add x0, sp, #12
318 ; CHECK-NEXT: str w8, [sp, #12]
319 ; CHECK-NEXT: bl something
320 ; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
322 %buf = alloca [4 x i8], align 1
323 call void @llvm.memset.p0.i32(ptr %buf, i8 -86, i32 4, i1 false)
324 call void @something(ptr %buf)
328 define void @memset_8_stack() {
329 ; CHECK-LABEL: memset_8_stack:
331 ; CHECK-NEXT: .cfi_def_cfa_offset 16
332 ; CHECK-NEXT: .cfi_offset w30, -16
333 ; CHECK-NEXT: mov x8, #-6148914691236517206
334 ; CHECK-NEXT: stp x30, x8, [sp, #-16]! // 8-byte Folded Spill
335 ; CHECK-NEXT: add x0, sp, #8
336 ; CHECK-NEXT: bl something
337 ; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
339 %buf = alloca [8 x i8], align 1
340 call void @llvm.memset.p0.i32(ptr %buf, i8 -86, i32 8, i1 false)
341 call void @something(ptr %buf)
345 define void @memset_12_stack() {
346 ; CHECK-LABEL: memset_12_stack:
348 ; CHECK-NEXT: sub sp, sp, #32
349 ; CHECK-NEXT: str x30, [sp, #16] // 8-byte Folded Spill
350 ; CHECK-NEXT: .cfi_def_cfa_offset 32
351 ; CHECK-NEXT: .cfi_offset w30, -16
352 ; CHECK-NEXT: mov x8, #-6148914691236517206
353 ; CHECK-NEXT: mov x0, sp
354 ; CHECK-NEXT: str x8, [sp]
355 ; CHECK-NEXT: str w8, [sp, #8]
356 ; CHECK-NEXT: bl something
357 ; CHECK-NEXT: ldr x30, [sp, #16] // 8-byte Folded Reload
358 ; CHECK-NEXT: add sp, sp, #32
360 %buf = alloca [12 x i8], align 1
361 call void @llvm.memset.p0.i32(ptr %buf, i8 -86, i32 12, i1 false)
362 call void @something(ptr %buf)
366 define void @memset_16_stack() {
367 ; CHECK-LABEL: memset_16_stack:
369 ; CHECK-NEXT: sub sp, sp, #32
370 ; CHECK-NEXT: .cfi_def_cfa_offset 32
371 ; CHECK-NEXT: .cfi_offset w30, -16
372 ; CHECK-NEXT: mov x8, #-6148914691236517206
373 ; CHECK-NEXT: mov x0, sp
374 ; CHECK-NEXT: stp x8, x30, [sp, #8] // 8-byte Folded Spill
375 ; CHECK-NEXT: str x8, [sp]
376 ; CHECK-NEXT: bl something
377 ; CHECK-NEXT: ldr x30, [sp, #16] // 8-byte Folded Reload
378 ; CHECK-NEXT: add sp, sp, #32
380 %buf = alloca [16 x i8], align 1
381 call void @llvm.memset.p0.i32(ptr %buf, i8 -86, i32 16, i1 false)
382 call void @something(ptr %buf)
386 define void @memset_20_stack() {
387 ; CHECK-LABEL: memset_20_stack:
389 ; CHECK-NEXT: sub sp, sp, #48
390 ; CHECK-NEXT: str x30, [sp, #32] // 8-byte Folded Spill
391 ; CHECK-NEXT: .cfi_def_cfa_offset 48
392 ; CHECK-NEXT: .cfi_offset w30, -16
393 ; CHECK-NEXT: mov x8, #-6148914691236517206
394 ; CHECK-NEXT: add x0, sp, #8
395 ; CHECK-NEXT: stp x8, x8, [sp, #8]
396 ; CHECK-NEXT: str w8, [sp, #24]
397 ; CHECK-NEXT: bl something
398 ; CHECK-NEXT: ldr x30, [sp, #32] // 8-byte Folded Reload
399 ; CHECK-NEXT: add sp, sp, #48
401 %buf = alloca [20 x i8], align 1
402 call void @llvm.memset.p0.i32(ptr %buf, i8 -86, i32 20, i1 false)
403 call void @something(ptr %buf)
407 define void @memset_26_stack() {
408 ; CHECK-LABEL: memset_26_stack:
410 ; CHECK-NEXT: sub sp, sp, #48
411 ; CHECK-NEXT: str x30, [sp, #32] // 8-byte Folded Spill
412 ; CHECK-NEXT: .cfi_def_cfa_offset 48
413 ; CHECK-NEXT: .cfi_offset w30, -16
414 ; CHECK-NEXT: mov x8, #-6148914691236517206
415 ; CHECK-NEXT: mov x0, sp
416 ; CHECK-NEXT: stp x8, x8, [sp, #8]
417 ; CHECK-NEXT: str x8, [sp]
418 ; CHECK-NEXT: strh w8, [sp, #24]
419 ; CHECK-NEXT: bl something
420 ; CHECK-NEXT: ldr x30, [sp, #32] // 8-byte Folded Reload
421 ; CHECK-NEXT: add sp, sp, #48
423 %buf = alloca [26 x i8], align 1
424 call void @llvm.memset.p0.i32(ptr %buf, i8 -86, i32 26, i1 false)
425 call void @something(ptr %buf)
429 define void @memset_32_stack() {
430 ; CHECK-LABEL: memset_32_stack:
432 ; CHECK-NEXT: sub sp, sp, #48
433 ; CHECK-NEXT: str x30, [sp, #32] // 8-byte Folded Spill
434 ; CHECK-NEXT: .cfi_def_cfa_offset 48
435 ; CHECK-NEXT: .cfi_offset w30, -16
436 ; CHECK-NEXT: movi v0.16b, #170
437 ; CHECK-NEXT: mov x0, sp
438 ; CHECK-NEXT: stp q0, q0, [sp]
439 ; CHECK-NEXT: bl something
440 ; CHECK-NEXT: ldr x30, [sp, #32] // 8-byte Folded Reload
441 ; CHECK-NEXT: add sp, sp, #48
443 %buf = alloca [32 x i8], align 1
444 call void @llvm.memset.p0.i32(ptr %buf, i8 -86, i32 32, i1 false)
445 call void @something(ptr %buf)
449 define void @memset_40_stack() {
450 ; CHECK-LABEL: memset_40_stack:
452 ; CHECK-NEXT: sub sp, sp, #64
453 ; CHECK-NEXT: str x30, [sp, #48] // 8-byte Folded Spill
454 ; CHECK-NEXT: .cfi_def_cfa_offset 64
455 ; CHECK-NEXT: .cfi_offset w30, -16
456 ; CHECK-NEXT: movi v0.16b, #170
457 ; CHECK-NEXT: mov x8, #-6148914691236517206
458 ; CHECK-NEXT: mov x0, sp
459 ; CHECK-NEXT: str x8, [sp, #32]
460 ; CHECK-NEXT: stp q0, q0, [sp]
461 ; CHECK-NEXT: bl something
462 ; CHECK-NEXT: ldr x30, [sp, #48] // 8-byte Folded Reload
463 ; CHECK-NEXT: add sp, sp, #64
465 %buf = alloca [40 x i8], align 1
466 call void @llvm.memset.p0.i32(ptr %buf, i8 -86, i32 40, i1 false)
467 call void @something(ptr %buf)
471 define void @memset_64_stack() {
472 ; CHECK-LABEL: memset_64_stack:
474 ; CHECK-NEXT: sub sp, sp, #80
475 ; CHECK-NEXT: str x30, [sp, #64] // 8-byte Folded Spill
476 ; CHECK-NEXT: .cfi_def_cfa_offset 80
477 ; CHECK-NEXT: .cfi_offset w30, -16
478 ; CHECK-NEXT: movi v0.16b, #170
479 ; CHECK-NEXT: mov x0, sp
480 ; CHECK-NEXT: stp q0, q0, [sp]
481 ; CHECK-NEXT: stp q0, q0, [sp, #32]
482 ; CHECK-NEXT: bl something
483 ; CHECK-NEXT: ldr x30, [sp, #64] // 8-byte Folded Reload
484 ; CHECK-NEXT: add sp, sp, #80
486 %buf = alloca [64 x i8], align 1
487 call void @llvm.memset.p0.i32(ptr %buf, i8 -86, i32 64, i1 false)
488 call void @something(ptr %buf)
492 define void @memset_72_stack() {
493 ; CHECK-LABEL: memset_72_stack:
495 ; CHECK-NEXT: sub sp, sp, #96
496 ; CHECK-NEXT: str x30, [sp, #80] // 8-byte Folded Spill
497 ; CHECK-NEXT: .cfi_def_cfa_offset 96
498 ; CHECK-NEXT: .cfi_offset w30, -16
499 ; CHECK-NEXT: movi v0.16b, #170
500 ; CHECK-NEXT: mov x8, #-6148914691236517206
501 ; CHECK-NEXT: mov x0, sp
502 ; CHECK-NEXT: str x8, [sp, #64]
503 ; CHECK-NEXT: stp q0, q0, [sp]
504 ; CHECK-NEXT: stp q0, q0, [sp, #32]
505 ; CHECK-NEXT: bl something
506 ; CHECK-NEXT: ldr x30, [sp, #80] // 8-byte Folded Reload
507 ; CHECK-NEXT: add sp, sp, #96
509 %buf = alloca [72 x i8], align 1
510 call void @llvm.memset.p0.i32(ptr %buf, i8 -86, i32 72, i1 false)
511 call void @something(ptr %buf)
515 define void @memset_128_stack() {
516 ; CHECK-LABEL: memset_128_stack:
518 ; CHECK-NEXT: sub sp, sp, #144
519 ; CHECK-NEXT: str x30, [sp, #128] // 8-byte Folded Spill
520 ; CHECK-NEXT: .cfi_def_cfa_offset 144
521 ; CHECK-NEXT: .cfi_offset w30, -16
522 ; CHECK-NEXT: movi v0.16b, #170
523 ; CHECK-NEXT: mov x0, sp
524 ; CHECK-NEXT: stp q0, q0, [sp]
525 ; CHECK-NEXT: stp q0, q0, [sp, #32]
526 ; CHECK-NEXT: stp q0, q0, [sp, #64]
527 ; CHECK-NEXT: stp q0, q0, [sp, #96]
528 ; CHECK-NEXT: bl something
529 ; CHECK-NEXT: ldr x30, [sp, #128] // 8-byte Folded Reload
530 ; CHECK-NEXT: add sp, sp, #144
532 %buf = alloca [128 x i8], align 1
533 call void @llvm.memset.p0.i32(ptr %buf, i8 -86, i32 128, i1 false)
534 call void @something(ptr %buf)
538 define void @memset_256_stack() {
539 ; CHECK-LABEL: memset_256_stack:
541 ; CHECK-NEXT: sub sp, sp, #272
542 ; CHECK-NEXT: stp x29, x30, [sp, #256] // 16-byte Folded Spill
543 ; CHECK-NEXT: .cfi_def_cfa_offset 272
544 ; CHECK-NEXT: .cfi_offset w30, -8
545 ; CHECK-NEXT: .cfi_offset w29, -16
546 ; CHECK-NEXT: movi v0.16b, #170
547 ; CHECK-NEXT: mov x0, sp
548 ; CHECK-NEXT: stp q0, q0, [sp]
549 ; CHECK-NEXT: stp q0, q0, [sp, #32]
550 ; CHECK-NEXT: stp q0, q0, [sp, #64]
551 ; CHECK-NEXT: stp q0, q0, [sp, #96]
552 ; CHECK-NEXT: stp q0, q0, [sp, #128]
553 ; CHECK-NEXT: stp q0, q0, [sp, #160]
554 ; CHECK-NEXT: stp q0, q0, [sp, #192]
555 ; CHECK-NEXT: stp q0, q0, [sp, #224]
556 ; CHECK-NEXT: bl something
557 ; CHECK-NEXT: ldp x29, x30, [sp, #256] // 16-byte Folded Reload
558 ; CHECK-NEXT: add sp, sp, #272
560 %buf = alloca [256 x i8], align 1
561 call void @llvm.memset.p0.i32(ptr %buf, i8 -86, i32 256, i1 false)
562 call void @something(ptr %buf)
566 declare void @something(ptr)
567 declare void @llvm.memset.p0.i32(ptr nocapture, i8, i32, i1) nounwind
568 declare void @llvm.memset.p0.i64(ptr nocapture, i8, i64, i1) nounwind