File: preserve_nonecc_call.ll

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,998,520 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (523 lines) | stat: -rw-r--r-- 22,517 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
; RUN: llc -mtriple=aarch64-unknown-unknown < %s | FileCheck --check-prefixes=CHECK %s
; RUN: llc -mtriple=aarch64-apple-darwin < %s | FileCheck --check-prefixes=DARWIN %s
; RUN: llc -mtriple=aarch64-pc-windows < %s | FileCheck --check-prefixes=WIN %s

; This test checks various function call behaviors between preserve_none and
; normal calling conventions.

declare preserve_nonecc void @callee(ptr)

; Normal caller calls preserve_none callee. Will not generated tail call because
; of incompatible calling convention. Callee saved registers are saved/restored
; around the call.
define void @caller1(ptr %a) {
; CHECK-LABEL: caller1:
; CHECK:       // %bb.0:
; CHECK-NEXT:    stp d15, d14, [sp, #-160]! // 16-byte Folded Spill
; CHECK-NEXT:    stp d13, d12, [sp, #16] // 16-byte Folded Spill
; CHECK-NEXT:    stp d11, d10, [sp, #32] // 16-byte Folded Spill
; CHECK-NEXT:    stp d9, d8, [sp, #48] // 16-byte Folded Spill
; CHECK-NEXT:    str x30, [sp, #64] // 8-byte Folded Spill
; CHECK-NEXT:    stp x28, x27, [sp, #80] // 16-byte Folded Spill
; CHECK-NEXT:    stp x26, x25, [sp, #96] // 16-byte Folded Spill
; CHECK-NEXT:    stp x24, x23, [sp, #112] // 16-byte Folded Spill
; CHECK-NEXT:    stp x22, x21, [sp, #128] // 16-byte Folded Spill
; CHECK-NEXT:    stp x20, x19, [sp, #144] // 16-byte Folded Spill
; CHECK-NEXT:    .cfi_def_cfa_offset 160
; CHECK-NEXT:    .cfi_offset w19, -8
; CHECK-NEXT:    .cfi_offset w20, -16
; CHECK-NEXT:    .cfi_offset w21, -24
; CHECK-NEXT:    .cfi_offset w22, -32
; CHECK-NEXT:    .cfi_offset w23, -40
; CHECK-NEXT:    .cfi_offset w24, -48
; CHECK-NEXT:    .cfi_offset w25, -56
; CHECK-NEXT:    .cfi_offset w26, -64
; CHECK-NEXT:    .cfi_offset w27, -72
; CHECK-NEXT:    .cfi_offset w28, -80
; CHECK-NEXT:    .cfi_offset w30, -96
; CHECK-NEXT:    .cfi_offset b8, -104
; CHECK-NEXT:    .cfi_offset b9, -112
; CHECK-NEXT:    .cfi_offset b10, -120
; CHECK-NEXT:    .cfi_offset b11, -128
; CHECK-NEXT:    .cfi_offset b12, -136
; CHECK-NEXT:    .cfi_offset b13, -144
; CHECK-NEXT:    .cfi_offset b14, -152
; CHECK-NEXT:    .cfi_offset b15, -160
; CHECK-NEXT:    mov x20, x0
; CHECK-NEXT:    bl callee
; CHECK-NEXT:    ldp x20, x19, [sp, #144] // 16-byte Folded Reload
; CHECK-NEXT:    ldr x30, [sp, #64] // 8-byte Folded Reload
; CHECK-NEXT:    ldp x22, x21, [sp, #128] // 16-byte Folded Reload
; CHECK-NEXT:    ldp x24, x23, [sp, #112] // 16-byte Folded Reload
; CHECK-NEXT:    ldp x26, x25, [sp, #96] // 16-byte Folded Reload
; CHECK-NEXT:    ldp x28, x27, [sp, #80] // 16-byte Folded Reload
; CHECK-NEXT:    ldp d9, d8, [sp, #48] // 16-byte Folded Reload
; CHECK-NEXT:    ldp d11, d10, [sp, #32] // 16-byte Folded Reload
; CHECK-NEXT:    ldp d13, d12, [sp, #16] // 16-byte Folded Reload
; CHECK-NEXT:    ldp d15, d14, [sp], #160 // 16-byte Folded Reload
; CHECK-NEXT:    ret
;
; DARWIN-LABEL: caller1:
; DARWIN:       ; %bb.0:
; DARWIN-NEXT:    stp d15, d14, [sp, #-160]! ; 16-byte Folded Spill
; DARWIN-NEXT:    stp d13, d12, [sp, #16] ; 16-byte Folded Spill
; DARWIN-NEXT:    stp d11, d10, [sp, #32] ; 16-byte Folded Spill
; DARWIN-NEXT:    stp d9, d8, [sp, #48] ; 16-byte Folded Spill
; DARWIN-NEXT:    stp x28, x27, [sp, #64] ; 16-byte Folded Spill
; DARWIN-NEXT:    stp x26, x25, [sp, #80] ; 16-byte Folded Spill
; DARWIN-NEXT:    stp x24, x23, [sp, #96] ; 16-byte Folded Spill
; DARWIN-NEXT:    stp x22, x21, [sp, #112] ; 16-byte Folded Spill
; DARWIN-NEXT:    stp x20, x19, [sp, #128] ; 16-byte Folded Spill
; DARWIN-NEXT:    stp x29, x30, [sp, #144] ; 16-byte Folded Spill
; DARWIN-NEXT:    .cfi_def_cfa_offset 160
; DARWIN-NEXT:    .cfi_offset w30, -8
; DARWIN-NEXT:    .cfi_offset w29, -16
; DARWIN-NEXT:    .cfi_offset w19, -24
; DARWIN-NEXT:    .cfi_offset w20, -32
; DARWIN-NEXT:    .cfi_offset w21, -40
; DARWIN-NEXT:    .cfi_offset w22, -48
; DARWIN-NEXT:    .cfi_offset w23, -56
; DARWIN-NEXT:    .cfi_offset w24, -64
; DARWIN-NEXT:    .cfi_offset w25, -72
; DARWIN-NEXT:    .cfi_offset w26, -80
; DARWIN-NEXT:    .cfi_offset w27, -88
; DARWIN-NEXT:    .cfi_offset w28, -96
; DARWIN-NEXT:    .cfi_offset b8, -104
; DARWIN-NEXT:    .cfi_offset b9, -112
; DARWIN-NEXT:    .cfi_offset b10, -120
; DARWIN-NEXT:    .cfi_offset b11, -128
; DARWIN-NEXT:    .cfi_offset b12, -136
; DARWIN-NEXT:    .cfi_offset b13, -144
; DARWIN-NEXT:    .cfi_offset b14, -152
; DARWIN-NEXT:    .cfi_offset b15, -160
; DARWIN-NEXT:    mov x20, x0
; DARWIN-NEXT:    bl _callee
; DARWIN-NEXT:    ldp x29, x30, [sp, #144] ; 16-byte Folded Reload
; DARWIN-NEXT:    ldp x20, x19, [sp, #128] ; 16-byte Folded Reload
; DARWIN-NEXT:    ldp x22, x21, [sp, #112] ; 16-byte Folded Reload
; DARWIN-NEXT:    ldp x24, x23, [sp, #96] ; 16-byte Folded Reload
; DARWIN-NEXT:    ldp x26, x25, [sp, #80] ; 16-byte Folded Reload
; DARWIN-NEXT:    ldp x28, x27, [sp, #64] ; 16-byte Folded Reload
; DARWIN-NEXT:    ldp d9, d8, [sp, #48] ; 16-byte Folded Reload
; DARWIN-NEXT:    ldp d11, d10, [sp, #32] ; 16-byte Folded Reload
; DARWIN-NEXT:    ldp d13, d12, [sp, #16] ; 16-byte Folded Reload
; DARWIN-NEXT:    ldp d15, d14, [sp], #160 ; 16-byte Folded Reload
; DARWIN-NEXT:    ret
;
; WIN-LABEL: caller1:
; WIN:       .seh_proc caller1
; WIN-NEXT:  // %bb.0:
; WIN-NEXT:    stp x19, x20, [sp, #-160]! // 16-byte Folded Spill
; WIN-NEXT:    .seh_save_regp_x x19, 160
; WIN-NEXT:    stp x21, x22, [sp, #16] // 16-byte Folded Spill
; WIN-NEXT:    .seh_save_regp x21, 16
; WIN-NEXT:    stp x23, x24, [sp, #32] // 16-byte Folded Spill
; WIN-NEXT:    .seh_save_regp x23, 32
; WIN-NEXT:    stp x25, x26, [sp, #48] // 16-byte Folded Spill
; WIN-NEXT:    .seh_save_regp x25, 48
; WIN-NEXT:    stp x27, x28, [sp, #64] // 16-byte Folded Spill
; WIN-NEXT:    .seh_save_regp x27, 64
; WIN-NEXT:    str x30, [sp, #80] // 8-byte Folded Spill
; WIN-NEXT:    .seh_save_reg x30, 80
; WIN-NEXT:    stp d8, d9, [sp, #88] // 16-byte Folded Spill
; WIN-NEXT:    .seh_save_fregp d8, 88
; WIN-NEXT:    stp d10, d11, [sp, #104] // 16-byte Folded Spill
; WIN-NEXT:    .seh_save_fregp d10, 104
; WIN-NEXT:    stp d12, d13, [sp, #120] // 16-byte Folded Spill
; WIN-NEXT:    .seh_save_fregp d12, 120
; WIN-NEXT:    stp d14, d15, [sp, #136] // 16-byte Folded Spill
; WIN-NEXT:    .seh_save_fregp d14, 136
; WIN-NEXT:    .seh_endprologue
; WIN-NEXT:    mov x20, x0
; WIN-NEXT:    bl callee
; WIN-NEXT:    .seh_startepilogue
; WIN-NEXT:    ldp d14, d15, [sp, #136] // 16-byte Folded Reload
; WIN-NEXT:    .seh_save_fregp d14, 136
; WIN-NEXT:    ldp d12, d13, [sp, #120] // 16-byte Folded Reload
; WIN-NEXT:    .seh_save_fregp d12, 120
; WIN-NEXT:    ldp d10, d11, [sp, #104] // 16-byte Folded Reload
; WIN-NEXT:    .seh_save_fregp d10, 104
; WIN-NEXT:    ldp d8, d9, [sp, #88] // 16-byte Folded Reload
; WIN-NEXT:    .seh_save_fregp d8, 88
; WIN-NEXT:    ldr x30, [sp, #80] // 8-byte Folded Reload
; WIN-NEXT:    .seh_save_reg x30, 80
; WIN-NEXT:    ldp x27, x28, [sp, #64] // 16-byte Folded Reload
; WIN-NEXT:    .seh_save_regp x27, 64
; WIN-NEXT:    ldp x25, x26, [sp, #48] // 16-byte Folded Reload
; WIN-NEXT:    .seh_save_regp x25, 48
; WIN-NEXT:    ldp x23, x24, [sp, #32] // 16-byte Folded Reload
; WIN-NEXT:    .seh_save_regp x23, 32
; WIN-NEXT:    ldp x21, x22, [sp, #16] // 16-byte Folded Reload
; WIN-NEXT:    .seh_save_regp x21, 16
; WIN-NEXT:    ldp x19, x20, [sp], #160 // 16-byte Folded Reload
; WIN-NEXT:    .seh_save_regp_x x19, 160
; WIN-NEXT:    .seh_endepilogue
; WIN-NEXT:    ret
; WIN-NEXT:    .seh_endfunclet
; WIN-NEXT:    .seh_endproc
  tail call preserve_nonecc void @callee(ptr %a)
  ret void
}

; Preserve_none caller calls preserve_none callee. Same function body.
; The tail call is preserved. No registers are saved/restored around the call.
; Actually a simple jmp instruction is generated.
define preserve_nonecc void @caller2(ptr %a) {
; CHECK-LABEL: caller2:
; CHECK:       // %bb.0:
; CHECK-NEXT:    b callee
;
; DARWIN-LABEL: caller2:
; DARWIN:       ; %bb.0:
; DARWIN-NEXT:    b _callee
;
; WIN-LABEL: caller2:
; WIN:       // %bb.0:
; WIN-NEXT:    b callee
  tail call preserve_nonecc void @callee(ptr %a)
  ret void
}

; Preserve_none function can use more registers to pass parameters.
declare preserve_nonecc i64 @callee_with_many_param2(i64 %a1, i64 %a2, i64 %a3, i64 %a4, i64 %a5, i64 %a6, i64 %a7, i64 %a8, i64 %a9, i64 %a10, i64 %a11, i64 %a12, i64 %a13, i64 %a14, i64 %a15, i64 %a16, i64 %a17, i64 %a18, i64 %a19, i64 %a20, i64 %a21, i64 %a22, i64 %a23, i64 %a24)
define preserve_nonecc i64 @callee_with_many_param(i64 %a1, i64 %a2, i64 %a3, i64 %a4, i64 %a5, i64 %a6, i64 %a7, i64 %a8, i64 %a9, i64 %a10, i64 %a11, i64 %a12, i64 %a13, i64 %a14, i64 %a15, i64 %a16, i64 %a17, i64 %a18, i64 %a19, i64 %a20, i64 %a21, i64 %a22, i64 %a23, i64 %a24) {
; CHECK-LABEL: callee_with_many_param:
; CHECK:       // %bb.0:
; CHECK-NEXT:    str x30, [sp, #-16]! // 8-byte Folded Spill
; CHECK-NEXT:    .cfi_def_cfa_offset 16
; CHECK-NEXT:    .cfi_offset w30, -16
; CHECK-NEXT:    mov x8, x15
; CHECK-NEXT:    mov x15, x20
; CHECK-NEXT:    mov x20, x21
; CHECK-NEXT:    mov x21, x22
; CHECK-NEXT:    mov x22, x23
; CHECK-NEXT:    mov x23, x24
; CHECK-NEXT:    mov x24, x25
; CHECK-NEXT:    mov x25, x26
; CHECK-NEXT:    mov x26, x27
; CHECK-NEXT:    mov x27, x28
; CHECK-NEXT:    mov x28, x0
; CHECK-NEXT:    mov x0, x1
; CHECK-NEXT:    mov x1, x2
; CHECK-NEXT:    mov x2, x3
; CHECK-NEXT:    mov x3, x4
; CHECK-NEXT:    mov x4, x5
; CHECK-NEXT:    mov x5, x6
; CHECK-NEXT:    mov x6, x7
; CHECK-NEXT:    mov x7, x10
; CHECK-NEXT:    mov x10, x11
; CHECK-NEXT:    mov x11, x12
; CHECK-NEXT:    mov x12, x13
; CHECK-NEXT:    mov x13, x14
; CHECK-NEXT:    mov x14, x9
; CHECK-NEXT:    mov x9, x8
; CHECK-NEXT:    bl callee_with_many_param2
; CHECK-NEXT:    ldr x30, [sp], #16 // 8-byte Folded Reload
; CHECK-NEXT:    ret
;
; DARWIN-LABEL: callee_with_many_param:
; DARWIN:       ; %bb.0:
; DARWIN-NEXT:    stp x29, x30, [sp, #-16]! ; 16-byte Folded Spill
; DARWIN-NEXT:    .cfi_def_cfa_offset 16
; DARWIN-NEXT:    .cfi_offset w30, -8
; DARWIN-NEXT:    .cfi_offset w29, -16
; DARWIN-NEXT:    mov x8, x15
; DARWIN-NEXT:    mov x15, x20
; DARWIN-NEXT:    mov x20, x21
; DARWIN-NEXT:    mov x21, x22
; DARWIN-NEXT:    mov x22, x23
; DARWIN-NEXT:    mov x23, x24
; DARWIN-NEXT:    mov x24, x25
; DARWIN-NEXT:    mov x25, x26
; DARWIN-NEXT:    mov x26, x27
; DARWIN-NEXT:    mov x27, x28
; DARWIN-NEXT:    mov x28, x0
; DARWIN-NEXT:    mov x0, x1
; DARWIN-NEXT:    mov x1, x2
; DARWIN-NEXT:    mov x2, x3
; DARWIN-NEXT:    mov x3, x4
; DARWIN-NEXT:    mov x4, x5
; DARWIN-NEXT:    mov x5, x6
; DARWIN-NEXT:    mov x6, x7
; DARWIN-NEXT:    mov x7, x10
; DARWIN-NEXT:    mov x10, x11
; DARWIN-NEXT:    mov x11, x12
; DARWIN-NEXT:    mov x12, x13
; DARWIN-NEXT:    mov x13, x14
; DARWIN-NEXT:    mov x14, x9
; DARWIN-NEXT:    mov x9, x8
; DARWIN-NEXT:    bl _callee_with_many_param2
; DARWIN-NEXT:    ldp x29, x30, [sp], #16 ; 16-byte Folded Reload
; DARWIN-NEXT:    ret
;
; WIN-LABEL: callee_with_many_param:
; WIN:       .seh_proc callee_with_many_param
; WIN-NEXT:  // %bb.0:
; WIN-NEXT:    sub sp, sp, #32
; WIN-NEXT:    .seh_stackalloc 32
; WIN-NEXT:    str x30, [sp, #16] // 8-byte Folded Spill
; WIN-NEXT:    .seh_save_reg x30, 16
; WIN-NEXT:    .seh_endprologue
; WIN-NEXT:    ldr x8, [sp, #32]
; WIN-NEXT:    mov x15, x20
; WIN-NEXT:    mov x20, x21
; WIN-NEXT:    mov x21, x22
; WIN-NEXT:    mov x22, x23
; WIN-NEXT:    mov x23, x24
; WIN-NEXT:    mov x24, x25
; WIN-NEXT:    mov x25, x26
; WIN-NEXT:    mov x26, x27
; WIN-NEXT:    mov x27, x28
; WIN-NEXT:    mov x28, x0
; WIN-NEXT:    mov x0, x1
; WIN-NEXT:    mov x1, x2
; WIN-NEXT:    mov x2, x3
; WIN-NEXT:    mov x3, x4
; WIN-NEXT:    mov x4, x5
; WIN-NEXT:    mov x5, x6
; WIN-NEXT:    mov x6, x7
; WIN-NEXT:    mov x7, x10
; WIN-NEXT:    mov x10, x11
; WIN-NEXT:    mov x11, x12
; WIN-NEXT:    mov x12, x13
; WIN-NEXT:    mov x13, x14
; WIN-NEXT:    mov x14, x9
; WIN-NEXT:    mov x9, x8
; WIN-NEXT:    str x15, [sp]
; WIN-NEXT:    bl callee_with_many_param2
; WIN-NEXT:    .seh_startepilogue
; WIN-NEXT:    ldr x30, [sp, #16] // 8-byte Folded Reload
; WIN-NEXT:    .seh_save_reg x30, 16
; WIN-NEXT:    add sp, sp, #32
; WIN-NEXT:    .seh_stackalloc 32
; WIN-NEXT:    .seh_endepilogue
; WIN-NEXT:    ret
; WIN-NEXT:    .seh_endfunclet
; WIN-NEXT:    .seh_endproc
  %ret = call preserve_nonecc i64 @callee_with_many_param2(i64 %a2, i64 %a3, i64 %a4, i64 %a5, i64 %a6, i64 %a7, i64 %a8, i64 %a9, i64 %a10, i64 %a11, i64 %a12, i64 %a13, i64 %a14, i64 %a15, i64 %a16, i64 %a17, i64 %a18, i64 %a19, i64 %a20, i64 %a21, i64 %a22, i64 %a23, i64 %a24, i64 %a1)
  ret i64 %ret
}

define i64 @caller3() {
; CHECK-LABEL: caller3:
; CHECK:       // %bb.0:
; CHECK-NEXT:    stp d15, d14, [sp, #-160]! // 16-byte Folded Spill
; CHECK-NEXT:    stp d13, d12, [sp, #16] // 16-byte Folded Spill
; CHECK-NEXT:    stp d11, d10, [sp, #32] // 16-byte Folded Spill
; CHECK-NEXT:    stp d9, d8, [sp, #48] // 16-byte Folded Spill
; CHECK-NEXT:    str x30, [sp, #64] // 8-byte Folded Spill
; CHECK-NEXT:    stp x28, x27, [sp, #80] // 16-byte Folded Spill
; CHECK-NEXT:    stp x26, x25, [sp, #96] // 16-byte Folded Spill
; CHECK-NEXT:    stp x24, x23, [sp, #112] // 16-byte Folded Spill
; CHECK-NEXT:    stp x22, x21, [sp, #128] // 16-byte Folded Spill
; CHECK-NEXT:    stp x20, x19, [sp, #144] // 16-byte Folded Spill
; CHECK-NEXT:    .cfi_def_cfa_offset 160
; CHECK-NEXT:    .cfi_offset w19, -8
; CHECK-NEXT:    .cfi_offset w20, -16
; CHECK-NEXT:    .cfi_offset w21, -24
; CHECK-NEXT:    .cfi_offset w22, -32
; CHECK-NEXT:    .cfi_offset w23, -40
; CHECK-NEXT:    .cfi_offset w24, -48
; CHECK-NEXT:    .cfi_offset w25, -56
; CHECK-NEXT:    .cfi_offset w26, -64
; CHECK-NEXT:    .cfi_offset w27, -72
; CHECK-NEXT:    .cfi_offset w28, -80
; CHECK-NEXT:    .cfi_offset w30, -96
; CHECK-NEXT:    .cfi_offset b8, -104
; CHECK-NEXT:    .cfi_offset b9, -112
; CHECK-NEXT:    .cfi_offset b10, -120
; CHECK-NEXT:    .cfi_offset b11, -128
; CHECK-NEXT:    .cfi_offset b12, -136
; CHECK-NEXT:    .cfi_offset b13, -144
; CHECK-NEXT:    .cfi_offset b14, -152
; CHECK-NEXT:    .cfi_offset b15, -160
; CHECK-NEXT:    mov w20, #1 // =0x1
; CHECK-NEXT:    mov w21, #2 // =0x2
; CHECK-NEXT:    mov w22, #3 // =0x3
; CHECK-NEXT:    mov w23, #4 // =0x4
; CHECK-NEXT:    mov w24, #5 // =0x5
; CHECK-NEXT:    mov w25, #6 // =0x6
; CHECK-NEXT:    mov w26, #7 // =0x7
; CHECK-NEXT:    mov w27, #8 // =0x8
; CHECK-NEXT:    mov w28, #9 // =0x9
; CHECK-NEXT:    mov w0, #10 // =0xa
; CHECK-NEXT:    mov w1, #11 // =0xb
; CHECK-NEXT:    mov w2, #12 // =0xc
; CHECK-NEXT:    mov w3, #13 // =0xd
; CHECK-NEXT:    mov w4, #14 // =0xe
; CHECK-NEXT:    mov w5, #15 // =0xf
; CHECK-NEXT:    mov w6, #16 // =0x10
; CHECK-NEXT:    mov w7, #17 // =0x11
; CHECK-NEXT:    mov w10, #18 // =0x12
; CHECK-NEXT:    mov w11, #19 // =0x13
; CHECK-NEXT:    mov w12, #20 // =0x14
; CHECK-NEXT:    mov w13, #21 // =0x15
; CHECK-NEXT:    mov w14, #22 // =0x16
; CHECK-NEXT:    mov w9, #23 // =0x17
; CHECK-NEXT:    mov w15, #24 // =0x18
; CHECK-NEXT:    bl callee_with_many_param
; CHECK-NEXT:    ldp x20, x19, [sp, #144] // 16-byte Folded Reload
; CHECK-NEXT:    ldr x30, [sp, #64] // 8-byte Folded Reload
; CHECK-NEXT:    ldp x22, x21, [sp, #128] // 16-byte Folded Reload
; CHECK-NEXT:    ldp x24, x23, [sp, #112] // 16-byte Folded Reload
; CHECK-NEXT:    ldp x26, x25, [sp, #96] // 16-byte Folded Reload
; CHECK-NEXT:    ldp x28, x27, [sp, #80] // 16-byte Folded Reload
; CHECK-NEXT:    ldp d9, d8, [sp, #48] // 16-byte Folded Reload
; CHECK-NEXT:    ldp d11, d10, [sp, #32] // 16-byte Folded Reload
; CHECK-NEXT:    ldp d13, d12, [sp, #16] // 16-byte Folded Reload
; CHECK-NEXT:    ldp d15, d14, [sp], #160 // 16-byte Folded Reload
; CHECK-NEXT:    ret
;
; DARWIN-LABEL: caller3:
; DARWIN:       ; %bb.0:
; DARWIN-NEXT:    stp d15, d14, [sp, #-160]! ; 16-byte Folded Spill
; DARWIN-NEXT:    stp d13, d12, [sp, #16] ; 16-byte Folded Spill
; DARWIN-NEXT:    stp d11, d10, [sp, #32] ; 16-byte Folded Spill
; DARWIN-NEXT:    stp d9, d8, [sp, #48] ; 16-byte Folded Spill
; DARWIN-NEXT:    stp x28, x27, [sp, #64] ; 16-byte Folded Spill
; DARWIN-NEXT:    stp x26, x25, [sp, #80] ; 16-byte Folded Spill
; DARWIN-NEXT:    stp x24, x23, [sp, #96] ; 16-byte Folded Spill
; DARWIN-NEXT:    stp x22, x21, [sp, #112] ; 16-byte Folded Spill
; DARWIN-NEXT:    stp x20, x19, [sp, #128] ; 16-byte Folded Spill
; DARWIN-NEXT:    stp x29, x30, [sp, #144] ; 16-byte Folded Spill
; DARWIN-NEXT:    .cfi_def_cfa_offset 160
; DARWIN-NEXT:    .cfi_offset w30, -8
; DARWIN-NEXT:    .cfi_offset w29, -16
; DARWIN-NEXT:    .cfi_offset w19, -24
; DARWIN-NEXT:    .cfi_offset w20, -32
; DARWIN-NEXT:    .cfi_offset w21, -40
; DARWIN-NEXT:    .cfi_offset w22, -48
; DARWIN-NEXT:    .cfi_offset w23, -56
; DARWIN-NEXT:    .cfi_offset w24, -64
; DARWIN-NEXT:    .cfi_offset w25, -72
; DARWIN-NEXT:    .cfi_offset w26, -80
; DARWIN-NEXT:    .cfi_offset w27, -88
; DARWIN-NEXT:    .cfi_offset w28, -96
; DARWIN-NEXT:    .cfi_offset b8, -104
; DARWIN-NEXT:    .cfi_offset b9, -112
; DARWIN-NEXT:    .cfi_offset b10, -120
; DARWIN-NEXT:    .cfi_offset b11, -128
; DARWIN-NEXT:    .cfi_offset b12, -136
; DARWIN-NEXT:    .cfi_offset b13, -144
; DARWIN-NEXT:    .cfi_offset b14, -152
; DARWIN-NEXT:    .cfi_offset b15, -160
; DARWIN-NEXT:    mov w20, #1 ; =0x1
; DARWIN-NEXT:    mov w21, #2 ; =0x2
; DARWIN-NEXT:    mov w22, #3 ; =0x3
; DARWIN-NEXT:    mov w23, #4 ; =0x4
; DARWIN-NEXT:    mov w24, #5 ; =0x5
; DARWIN-NEXT:    mov w25, #6 ; =0x6
; DARWIN-NEXT:    mov w26, #7 ; =0x7
; DARWIN-NEXT:    mov w27, #8 ; =0x8
; DARWIN-NEXT:    mov w28, #9 ; =0x9
; DARWIN-NEXT:    mov w0, #10 ; =0xa
; DARWIN-NEXT:    mov w1, #11 ; =0xb
; DARWIN-NEXT:    mov w2, #12 ; =0xc
; DARWIN-NEXT:    mov w3, #13 ; =0xd
; DARWIN-NEXT:    mov w4, #14 ; =0xe
; DARWIN-NEXT:    mov w5, #15 ; =0xf
; DARWIN-NEXT:    mov w6, #16 ; =0x10
; DARWIN-NEXT:    mov w7, #17 ; =0x11
; DARWIN-NEXT:    mov w10, #18 ; =0x12
; DARWIN-NEXT:    mov w11, #19 ; =0x13
; DARWIN-NEXT:    mov w12, #20 ; =0x14
; DARWIN-NEXT:    mov w13, #21 ; =0x15
; DARWIN-NEXT:    mov w14, #22 ; =0x16
; DARWIN-NEXT:    mov w9, #23 ; =0x17
; DARWIN-NEXT:    mov w15, #24 ; =0x18
; DARWIN-NEXT:    bl _callee_with_many_param
; DARWIN-NEXT:    ldp x29, x30, [sp, #144] ; 16-byte Folded Reload
; DARWIN-NEXT:    ldp x20, x19, [sp, #128] ; 16-byte Folded Reload
; DARWIN-NEXT:    ldp x22, x21, [sp, #112] ; 16-byte Folded Reload
; DARWIN-NEXT:    ldp x24, x23, [sp, #96] ; 16-byte Folded Reload
; DARWIN-NEXT:    ldp x26, x25, [sp, #80] ; 16-byte Folded Reload
; DARWIN-NEXT:    ldp x28, x27, [sp, #64] ; 16-byte Folded Reload
; DARWIN-NEXT:    ldp d9, d8, [sp, #48] ; 16-byte Folded Reload
; DARWIN-NEXT:    ldp d11, d10, [sp, #32] ; 16-byte Folded Reload
; DARWIN-NEXT:    ldp d13, d12, [sp, #16] ; 16-byte Folded Reload
; DARWIN-NEXT:    ldp d15, d14, [sp], #160 ; 16-byte Folded Reload
; DARWIN-NEXT:    ret
;
; WIN-LABEL: caller3:
; WIN:       .seh_proc caller3
; WIN-NEXT:  // %bb.0:
; WIN-NEXT:    sub sp, sp, #176
; WIN-NEXT:    .seh_stackalloc 176
; WIN-NEXT:    stp x19, x20, [sp, #16] // 16-byte Folded Spill
; WIN-NEXT:    .seh_save_regp x19, 16
; WIN-NEXT:    stp x21, x22, [sp, #32] // 16-byte Folded Spill
; WIN-NEXT:    .seh_save_regp x21, 32
; WIN-NEXT:    stp x23, x24, [sp, #48] // 16-byte Folded Spill
; WIN-NEXT:    .seh_save_regp x23, 48
; WIN-NEXT:    stp x25, x26, [sp, #64] // 16-byte Folded Spill
; WIN-NEXT:    .seh_save_regp x25, 64
; WIN-NEXT:    stp x27, x28, [sp, #80] // 16-byte Folded Spill
; WIN-NEXT:    .seh_save_regp x27, 80
; WIN-NEXT:    str x30, [sp, #96] // 8-byte Folded Spill
; WIN-NEXT:    .seh_save_reg x30, 96
; WIN-NEXT:    stp d8, d9, [sp, #104] // 16-byte Folded Spill
; WIN-NEXT:    .seh_save_fregp d8, 104
; WIN-NEXT:    stp d10, d11, [sp, #120] // 16-byte Folded Spill
; WIN-NEXT:    .seh_save_fregp d10, 120
; WIN-NEXT:    stp d12, d13, [sp, #136] // 16-byte Folded Spill
; WIN-NEXT:    .seh_save_fregp d12, 136
; WIN-NEXT:    stp d14, d15, [sp, #152] // 16-byte Folded Spill
; WIN-NEXT:    .seh_save_fregp d14, 152
; WIN-NEXT:    .seh_endprologue
; WIN-NEXT:    mov w8, #24 // =0x18
; WIN-NEXT:    mov w20, #1 // =0x1
; WIN-NEXT:    mov w21, #2 // =0x2
; WIN-NEXT:    mov w22, #3 // =0x3
; WIN-NEXT:    mov w23, #4 // =0x4
; WIN-NEXT:    mov w24, #5 // =0x5
; WIN-NEXT:    mov w25, #6 // =0x6
; WIN-NEXT:    mov w26, #7 // =0x7
; WIN-NEXT:    mov w27, #8 // =0x8
; WIN-NEXT:    mov w28, #9 // =0x9
; WIN-NEXT:    mov w0, #10 // =0xa
; WIN-NEXT:    mov w1, #11 // =0xb
; WIN-NEXT:    mov w2, #12 // =0xc
; WIN-NEXT:    mov w3, #13 // =0xd
; WIN-NEXT:    mov w4, #14 // =0xe
; WIN-NEXT:    mov w5, #15 // =0xf
; WIN-NEXT:    mov w6, #16 // =0x10
; WIN-NEXT:    mov w7, #17 // =0x11
; WIN-NEXT:    mov w10, #18 // =0x12
; WIN-NEXT:    mov w11, #19 // =0x13
; WIN-NEXT:    mov w12, #20 // =0x14
; WIN-NEXT:    mov w13, #21 // =0x15
; WIN-NEXT:    mov w14, #22 // =0x16
; WIN-NEXT:    mov w9, #23 // =0x17
; WIN-NEXT:    str x8, [sp]
; WIN-NEXT:    bl callee_with_many_param
; WIN-NEXT:    .seh_startepilogue
; WIN-NEXT:    ldp d14, d15, [sp, #152] // 16-byte Folded Reload
; WIN-NEXT:    .seh_save_fregp d14, 152
; WIN-NEXT:    ldp d12, d13, [sp, #136] // 16-byte Folded Reload
; WIN-NEXT:    .seh_save_fregp d12, 136
; WIN-NEXT:    ldp d10, d11, [sp, #120] // 16-byte Folded Reload
; WIN-NEXT:    .seh_save_fregp d10, 120
; WIN-NEXT:    ldp d8, d9, [sp, #104] // 16-byte Folded Reload
; WIN-NEXT:    .seh_save_fregp d8, 104
; WIN-NEXT:    ldr x30, [sp, #96] // 8-byte Folded Reload
; WIN-NEXT:    .seh_save_reg x30, 96
; WIN-NEXT:    ldp x27, x28, [sp, #80] // 16-byte Folded Reload
; WIN-NEXT:    .seh_save_regp x27, 80
; WIN-NEXT:    ldp x25, x26, [sp, #64] // 16-byte Folded Reload
; WIN-NEXT:    .seh_save_regp x25, 64
; WIN-NEXT:    ldp x23, x24, [sp, #48] // 16-byte Folded Reload
; WIN-NEXT:    .seh_save_regp x23, 48
; WIN-NEXT:    ldp x21, x22, [sp, #32] // 16-byte Folded Reload
; WIN-NEXT:    .seh_save_regp x21, 32
; WIN-NEXT:    ldp x19, x20, [sp, #16] // 16-byte Folded Reload
; WIN-NEXT:    .seh_save_regp x19, 16
; WIN-NEXT:    add sp, sp, #176
; WIN-NEXT:    .seh_stackalloc 176
; WIN-NEXT:    .seh_endepilogue
; WIN-NEXT:    ret
; WIN-NEXT:    .seh_endfunclet
; WIN-NEXT:    .seh_endproc
  %ret = call preserve_nonecc i64 @callee_with_many_param(i64 1, i64 2, i64 3, i64 4, i64 5, i64 6, i64 7, i64 8, i64 9, i64 10, i64 11, i64 12, i64 13, i64 14, i64 15, i64 16, i64 17, i64 18, i64 19, i64 20, i64 21, i64 22, i64 23, i64 24)
  ret i64 %ret
}