1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -global-isel -mtriple=aarch64-unknown-linux-gnu < %s | FileCheck %s
4 declare void @byval_i32(ptr byval(i32) %ptr)
6 define void @call_byval_i32(ptr %incoming) uwtable {
7 ; CHECK-LABEL: call_byval_i32:
9 ; CHECK-NEXT: sub sp, sp, #32
10 ; CHECK-NEXT: .cfi_def_cfa_offset 32
11 ; CHECK-NEXT: str x30, [sp, #16] // 8-byte Folded Spill
12 ; CHECK-NEXT: .cfi_offset w30, -16
13 ; CHECK-NEXT: ldr w8, [x0]
14 ; CHECK-NEXT: str w8, [sp]
15 ; CHECK-NEXT: bl byval_i32
16 ; CHECK-NEXT: ldr x30, [sp, #16] // 8-byte Folded Reload
17 ; CHECK-NEXT: add sp, sp, #32
18 ; CHECK-NEXT: .cfi_def_cfa_offset 0
19 ; CHECK-NEXT: .cfi_restore w30
21 call void @byval_i32(ptr byval(i32) %incoming)
25 declare void @byval_a64i32(ptr byval([64 x i32]) %ptr)
27 define void @call_byval_a64i32(ptr %incoming) uwtable {
28 ; CHECK-LABEL: call_byval_a64i32:
30 ; CHECK-NEXT: sub sp, sp, #288
31 ; CHECK-NEXT: .cfi_def_cfa_offset 288
32 ; CHECK-NEXT: stp x29, x30, [sp, #256] // 16-byte Folded Spill
33 ; CHECK-NEXT: str x28, [sp, #272] // 8-byte Folded Spill
34 ; CHECK-NEXT: add x29, sp, #256
35 ; CHECK-NEXT: .cfi_def_cfa w29, 32
36 ; CHECK-NEXT: .cfi_offset w28, -16
37 ; CHECK-NEXT: .cfi_offset w30, -24
38 ; CHECK-NEXT: .cfi_offset w29, -32
39 ; CHECK-NEXT: ldr q0, [x0]
40 ; CHECK-NEXT: str q0, [sp]
41 ; CHECK-NEXT: ldr q0, [x0, #16]
42 ; CHECK-NEXT: str q0, [sp, #16]
43 ; CHECK-NEXT: ldr q0, [x0, #32]
44 ; CHECK-NEXT: str q0, [sp, #32]
45 ; CHECK-NEXT: ldr q0, [x0, #48]
46 ; CHECK-NEXT: str q0, [sp, #48]
47 ; CHECK-NEXT: ldr q0, [x0, #64]
48 ; CHECK-NEXT: str q0, [sp, #64]
49 ; CHECK-NEXT: ldr q0, [x0, #80]
50 ; CHECK-NEXT: str q0, [sp, #80]
51 ; CHECK-NEXT: ldr q0, [x0, #96]
52 ; CHECK-NEXT: str q0, [sp, #96]
53 ; CHECK-NEXT: ldr q0, [x0, #112]
54 ; CHECK-NEXT: str q0, [sp, #112]
55 ; CHECK-NEXT: ldr q0, [x0, #128]
56 ; CHECK-NEXT: str q0, [sp, #128]
57 ; CHECK-NEXT: ldr q0, [x0, #144]
58 ; CHECK-NEXT: str q0, [sp, #144]
59 ; CHECK-NEXT: ldr q0, [x0, #160]
60 ; CHECK-NEXT: str q0, [sp, #160]
61 ; CHECK-NEXT: ldr q0, [x0, #176]
62 ; CHECK-NEXT: str q0, [sp, #176]
63 ; CHECK-NEXT: ldr q0, [x0, #192]
64 ; CHECK-NEXT: str q0, [sp, #192]
65 ; CHECK-NEXT: ldr q0, [x0, #208]
66 ; CHECK-NEXT: str q0, [sp, #208]
67 ; CHECK-NEXT: ldr q0, [x0, #224]
68 ; CHECK-NEXT: str q0, [sp, #224]
69 ; CHECK-NEXT: ldr q0, [x0, #240]
70 ; CHECK-NEXT: str q0, [sp, #240]
71 ; CHECK-NEXT: bl byval_a64i32
72 ; CHECK-NEXT: .cfi_def_cfa wsp, 288
73 ; CHECK-NEXT: ldp x29, x30, [sp, #256] // 16-byte Folded Reload
74 ; CHECK-NEXT: ldr x28, [sp, #272] // 8-byte Folded Reload
75 ; CHECK-NEXT: add sp, sp, #288
76 ; CHECK-NEXT: .cfi_def_cfa_offset 0
77 ; CHECK-NEXT: .cfi_restore w28
78 ; CHECK-NEXT: .cfi_restore w30
79 ; CHECK-NEXT: .cfi_restore w29
81 call void @byval_a64i32(ptr byval([64 x i32]) %incoming)