xref: /llvm-project/clang/test/CodeGenOpenCL/amdgpu-abi-struct-coerce.cl (revision 29441e4f5fa5f5c7709f7cf180815ba97f611297)
1// REQUIRES: amdgpu-registered-target
2// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -emit-llvm -o - %s | FileCheck %s
3// RUN: %clang_cc1 -triple r600-unknown-unknown -emit-llvm -o - %s | FileCheck %s
4
5typedef __attribute__(( ext_vector_type(2) )) char char2;
6typedef __attribute__(( ext_vector_type(3) )) char char3;
7typedef __attribute__(( ext_vector_type(4) )) char char4;
8
9typedef __attribute__(( ext_vector_type(2) )) short short2;
10typedef __attribute__(( ext_vector_type(3) )) short short3;
11typedef __attribute__(( ext_vector_type(4) )) short short4;
12
13typedef __attribute__(( ext_vector_type(2) )) int int2;
14typedef __attribute__(( ext_vector_type(3) )) int int3;
15typedef __attribute__(( ext_vector_type(4) )) int int4;
16typedef __attribute__(( ext_vector_type(16) )) int int16;
17typedef __attribute__(( ext_vector_type(32) )) int int32;
18
19// CHECK: %struct.empty_struct = type {}
20typedef struct empty_struct
21{
22} empty_struct;
23
24// CHECK-NOT: %struct.single_element_struct_arg
25typedef struct single_element_struct_arg
26{
27    int i;
28} single_element_struct_arg_t;
29
30// CHECK-NOT: %struct.nested_single_element_struct_arg
31typedef struct nested_single_element_struct_arg
32{
33  single_element_struct_arg_t i;
34} nested_single_element_struct_arg_t;
35
36// CHECK: %struct.struct_arg = type { i32, float, i32 }
37typedef struct struct_arg
38{
39    int i1;
40    float f;
41    int i2;
42} struct_arg_t;
43
44// CHECK: %struct.struct_padding_arg = type { i8, i64 }
45typedef struct struct_padding_arg
46{
47  char i1;
48  long f;
49} struct_padding_arg;
50
51// CHECK: %struct.struct_of_arrays_arg = type { [2 x i32], float, [4 x i32], [3 x float], i32 }
52typedef struct struct_of_arrays_arg
53{
54    int i1[2];
55    float f1;
56    int i2[4];
57    float f2[3];
58    int i3;
59} struct_of_arrays_arg_t;
60
61// CHECK: %struct.struct_of_structs_arg = type { i32, float, %struct.struct_arg, i32 }
62typedef struct struct_of_structs_arg
63{
64    int i1;
65    float f1;
66    struct_arg_t s1;
67    int i2;
68} struct_of_structs_arg_t;
69
70typedef union
71{
72  int b1;
73  float b2;
74} transparent_u __attribute__((__transparent_union__));
75
76// CHECK: %struct.single_array_element_struct_arg = type { [4 x i32] }
77typedef struct single_array_element_struct_arg
78{
79    int i[4];
80} single_array_element_struct_arg_t;
81
82// CHECK: %struct.single_struct_element_struct_arg = type { %struct.inner }
83// CHECK: %struct.inner = type { i32, i64 }
84typedef struct single_struct_element_struct_arg
85{
86  struct inner {
87    int a;
88    long b;
89  } s;
90} single_struct_element_struct_arg_t;
91
92// CHECK: %struct.different_size_type_pair
93typedef struct different_size_type_pair {
94  long l;
95  int i;
96} different_size_type_pair;
97
98// CHECK: %struct.flexible_array = type { i32, [0 x i32] }
99typedef struct flexible_array
100{
101  int i;
102  int flexible[];
103} flexible_array;
104
105// CHECK: %struct.struct_arr16 = type { [16 x i32] }
106typedef struct struct_arr16
107{
108    int arr[16];
109} struct_arr16;
110
111// CHECK: %struct.struct_arr32 = type { [32 x i32] }
112typedef struct struct_arr32
113{
114    int arr[32];
115} struct_arr32;
116
117// CHECK: %struct.struct_arr33 = type { [33 x i32] }
118typedef struct struct_arr33
119{
120    int arr[33];
121} struct_arr33;
122
123// CHECK: %struct.struct_char_arr32 = type { [32 x i8] }
124typedef struct struct_char_arr32
125{
126  char arr[32];
127} struct_char_arr32;
128
129// CHECK-NOT: %struct.struct_char_x8
130typedef struct struct_char_x8 {
131  char x, y, z, w;
132  char a, b, c, d;
133} struct_char_x8;
134
135// CHECK-NOT: %struct.struct_char_x4
136typedef struct struct_char_x4 {
137  char x, y, z, w;
138} struct_char_x4;
139
140// CHECK-NOT: %struct.struct_char_x3
141typedef struct struct_char_x3 {
142  char x, y, z;
143} struct_char_x3;
144
145// CHECK-NOT: %struct.struct_char_x2
146typedef struct struct_char_x2 {
147  char x, y;
148} struct_char_x2;
149
150// CHECK-NOT: %struct.struct_char_x1
151typedef struct struct_char_x1 {
152  char x;
153} struct_char_x1;
154
155// 4 registers from fields, 5 if padding included.
156// CHECK: %struct.nested = type { i8, i64 }
157// CHECK: %struct.num_regs_nested_struct = type { i32, %struct.nested }
158typedef struct num_regs_nested_struct {
159  int x;
160  struct nested {
161    char z;
162    long y;
163  } inner;
164} num_regs_nested_struct;
165
166// CHECK: %struct.double_nested = type { %struct.inner_inner }
167// CHECK: %struct.inner_inner = type { i8, i32, i8 }
168// CHECK: %struct.double_nested_struct = type { i32, %struct.double_nested, i16 }
169typedef struct double_nested_struct {
170  int x;
171  struct double_nested {
172    struct inner_inner {
173      char y;
174      int q;
175      char z;
176    } inner_inner;
177  } inner;
178
179  short w;
180} double_nested_struct;
181
182// This is a large struct, but uses fewer registers than the limit.
183// CHECK: %struct.large_struct_padding = type { i8, i32, i8, i32, i8, i8, i16, i16, [3 x i8], i64, i32, i8, i32, i16, i8 }
184typedef struct large_struct_padding {
185  char e0;
186  int e1;
187  char e2;
188  int e3;
189  char e4;
190  char e5;
191  short e6;
192  short e7;
193  char e8[3];
194  long e9;
195  int e10;
196  char e11;
197  int e12;
198  short e13;
199  char e14;
200} large_struct_padding;
201
202// The number of registers computed should be 6, not 8.
203typedef struct int3_pair {
204	int3 dx;
205	int3 dy;
206} int3_pair;
207
208// CHECK: %struct.struct_4regs = type { i32, i32, i32, i32 }
209typedef struct struct_4regs
210{
211  int x;
212  int y;
213  int z;
214  int w;
215} struct_4regs;
216
217// CHECK: void @kernel_empty_struct_arg(%struct.empty_struct %s.coerce)
218__kernel void kernel_empty_struct_arg(empty_struct s) { }
219
220// CHECK: void @kernel_single_element_struct_arg(i32 %arg1.coerce)
221__kernel void kernel_single_element_struct_arg(single_element_struct_arg_t arg1) { }
222
223// CHECK: void @kernel_nested_single_element_struct_arg(i32 %arg1.coerce)
224__kernel void kernel_nested_single_element_struct_arg(nested_single_element_struct_arg_t arg1) { }
225
226// CHECK: void @kernel_struct_arg(%struct.struct_arg %arg1.coerce)
227__kernel void kernel_struct_arg(struct_arg_t arg1) { }
228
229// CHECK: void @kernel_struct_padding_arg(%struct.struct_padding_arg %arg1.coerce)
230__kernel void kernel_struct_padding_arg(struct_padding_arg arg1) { }
231
232// CHECK: void @kernel_test_struct_of_arrays_arg(%struct.struct_of_arrays_arg %arg1.coerce)
233__kernel void kernel_test_struct_of_arrays_arg(struct_of_arrays_arg_t arg1) { }
234
235// CHECK: void @kernel_struct_of_structs_arg(%struct.struct_of_structs_arg %arg1.coerce)
236__kernel void kernel_struct_of_structs_arg(struct_of_structs_arg_t arg1) { }
237
238// CHECK: void @test_kernel_transparent_union_arg(i32 %u.coerce)
239__kernel void test_kernel_transparent_union_arg(transparent_u u) { }
240
241// CHECK: void @kernel_single_array_element_struct_arg(%struct.single_array_element_struct_arg %arg1.coerce)
242__kernel void kernel_single_array_element_struct_arg(single_array_element_struct_arg_t arg1) { }
243
244// CHECK: void @kernel_single_struct_element_struct_arg(%struct.single_struct_element_struct_arg %arg1.coerce)
245__kernel void kernel_single_struct_element_struct_arg(single_struct_element_struct_arg_t arg1) { }
246
247// CHECK: void @kernel_different_size_type_pair_arg(%struct.different_size_type_pair %arg1.coerce)
248__kernel void kernel_different_size_type_pair_arg(different_size_type_pair arg1) { }
249
250// CHECK: define{{.*}} void @func_f32_arg(float noundef %arg)
251void func_f32_arg(float arg) { }
252
253// CHECK: define{{.*}} void @func_v2i16_arg(<2 x i16> noundef %arg)
254void func_v2i16_arg(short2 arg) { }
255
256// CHECK: define{{.*}} void @func_v3i32_arg(<3 x i32> noundef %arg)
257void func_v3i32_arg(int3 arg) { }
258
259// CHECK: define{{.*}} void @func_v4i32_arg(<4 x i32> noundef %arg)
260void func_v4i32_arg(int4 arg) { }
261
262// CHECK: define{{.*}} void @func_v16i32_arg(<16 x i32> noundef %arg)
263void func_v16i32_arg(int16 arg) { }
264
265// CHECK: define{{.*}} void @func_v32i32_arg(<32 x i32> noundef %arg)
266void func_v32i32_arg(int32 arg) { }
267
268// CHECK: define{{.*}} void @func_empty_struct_arg()
269void func_empty_struct_arg(empty_struct empty) { }
270
271// CHECK: void @func_single_element_struct_arg(i32 %arg1.coerce)
272void func_single_element_struct_arg(single_element_struct_arg_t arg1) { }
273
274// CHECK: void @func_nested_single_element_struct_arg(i32 %arg1.coerce)
275void func_nested_single_element_struct_arg(nested_single_element_struct_arg_t arg1) { }
276
277// CHECK: void @func_struct_arg(i32 %arg1.coerce0, float %arg1.coerce1, i32 %arg1.coerce2)
278void func_struct_arg(struct_arg_t arg1) { }
279
280// CHECK: void @func_struct_padding_arg(i8 %arg1.coerce0, i64 %arg1.coerce1)
281void func_struct_padding_arg(struct_padding_arg arg1) { }
282
283// CHECK: define{{.*}} void @func_struct_char_x8([2 x i32] %arg.coerce)
284void func_struct_char_x8(struct_char_x8 arg) { }
285
286// CHECK: define{{.*}} void @func_struct_char_x4(i32 %arg.coerce)
287void func_struct_char_x4(struct_char_x4 arg) { }
288
289// CHECK: define{{.*}} void @func_struct_char_x3(i32 %arg.coerce)
290void func_struct_char_x3(struct_char_x3 arg) { }
291
292// CHECK: define{{.*}} void @func_struct_char_x2(i16 %arg.coerce)
293void func_struct_char_x2(struct_char_x2 arg) { }
294
295// CHECK: define{{.*}} void @func_struct_char_x1(i8 %arg.coerce)
296void func_struct_char_x1(struct_char_x1 arg) { }
297
298// CHECK: void @func_transparent_union_arg(i32 %u.coerce)
299void func_transparent_union_arg(transparent_u u) { }
300
301// CHECK: void @func_single_array_element_struct_arg([4 x i32] %arg1.coerce)
302void func_single_array_element_struct_arg(single_array_element_struct_arg_t arg1) { }
303
304// CHECK: void @func_single_struct_element_struct_arg(%struct.inner %arg1.coerce)
305void func_single_struct_element_struct_arg(single_struct_element_struct_arg_t arg1) { }
306
307// CHECK: void @func_different_size_type_pair_arg(i64 %arg1.coerce0, i32 %arg1.coerce1)
308void func_different_size_type_pair_arg(different_size_type_pair arg1) { }
309
310// CHECK: void @func_flexible_array_arg(ptr addrspace(5) noundef readnone byval(%struct.flexible_array) align 4 captures(none) %arg)
311void func_flexible_array_arg(flexible_array arg) { }
312
313// CHECK: define{{.*}} float @func_f32_ret()
314float func_f32_ret()
315{
316  return 0.0f;
317}
318
319// CHECK: define{{.*}} void @func_empty_struct_ret()
320empty_struct func_empty_struct_ret()
321{
322  empty_struct s = {};
323  return s;
324}
325
326// CHECK: define{{.*}} i32 @single_element_struct_ret()
327// CHECK: ret i32 0
328single_element_struct_arg_t single_element_struct_ret()
329{
330  single_element_struct_arg_t s = { 0 };
331  return s;
332}
333
334// CHECK: define{{.*}} i32 @nested_single_element_struct_ret()
335// CHECK: ret i32 0
336nested_single_element_struct_arg_t nested_single_element_struct_ret()
337{
338  nested_single_element_struct_arg_t s = { 0 };
339  return s;
340}
341
342// CHECK: define{{.*}} %struct.struct_arg @func_struct_ret()
343// CHECK: ret %struct.struct_arg zeroinitializer
344struct_arg_t func_struct_ret()
345{
346  struct_arg_t s = { 0 };
347  return s;
348}
349
350// CHECK: define{{.*}} %struct.struct_padding_arg @func_struct_padding_ret()
351// CHECK: ret %struct.struct_padding_arg zeroinitializer
352struct_padding_arg func_struct_padding_ret()
353{
354  struct_padding_arg s = { 0 };
355  return s;
356}
357
358// CHECK: define{{.*}} [2 x i32] @func_struct_char_x8_ret()
359// CHECK: ret [2 x i32] zeroinitializer
360struct_char_x8 func_struct_char_x8_ret()
361{
362  struct_char_x8 s = { 0 };
363  return s;
364}
365
366// CHECK: define{{.*}} i32 @func_struct_char_x4_ret()
367// CHECK: ret i32 0
368struct_char_x4 func_struct_char_x4_ret()
369{
370  struct_char_x4 s = { 0 };
371  return s;
372}
373
374// CHECK: define{{.*}} i32 @func_struct_char_x3_ret()
375// CHECK: ret i32 0
376struct_char_x3 func_struct_char_x3_ret()
377{
378  struct_char_x3 s = { 0 };
379  return s;
380}
381
382// CHECK: define{{.*}} i16 @func_struct_char_x2_ret()
383struct_char_x2 func_struct_char_x2_ret()
384{
385  struct_char_x2 s = { 0 };
386  return s;
387}
388
389// CHECK: define{{.*}} i8 @func_struct_char_x1_ret()
390// CHECK: ret i8 0
391struct_char_x1 func_struct_char_x1_ret()
392{
393  struct_char_x1 s = { 0 };
394  return s;
395}
396
397// CHECK: define{{.*}} %struct.struct_arr16 @func_ret_struct_arr16()
398// CHECK: ret %struct.struct_arr16 zeroinitializer
399struct_arr16 func_ret_struct_arr16()
400{
401  struct_arr16 s = { 0 };
402  return s;
403}
404
405// CHECK: define{{.*}} void @func_ret_struct_arr32(ptr addrspace(5) dead_on_unwind noalias writable writeonly sret(%struct.struct_arr32) align 4 captures(none) initializes((0, 128)) %agg.result)
406struct_arr32 func_ret_struct_arr32()
407{
408  struct_arr32 s = { 0 };
409  return s;
410}
411
412// CHECK: define{{.*}} void @func_ret_struct_arr33(ptr addrspace(5) dead_on_unwind noalias writable writeonly sret(%struct.struct_arr33) align 4 captures(none) initializes((0, 132)) %agg.result)
413struct_arr33 func_ret_struct_arr33()
414{
415  struct_arr33 s = { 0 };
416  return s;
417}
418
419// CHECK: define{{.*}} %struct.struct_char_arr32 @func_ret_struct_char_arr32()
420struct_char_arr32 func_ret_struct_char_arr32()
421{
422  struct_char_arr32 s = { 0 };
423  return s;
424}
425
426// CHECK: define{{.*}} i32 @func_transparent_union_ret() local_unnamed_addr #1 {
427// CHECK: ret i32 0
428transparent_u func_transparent_union_ret()
429{
430  transparent_u u = { 0 };
431  return u;
432}
433
434// CHECK: define{{.*}} %struct.different_size_type_pair @func_different_size_type_pair_ret()
435different_size_type_pair func_different_size_type_pair_ret()
436{
437  different_size_type_pair s = { 0 };
438  return s;
439}
440
441// CHECK: define{{.*}} void @func_flexible_array_ret(ptr addrspace(5) dead_on_unwind noalias writable writeonly sret(%struct.flexible_array) align 4 captures(none) initializes((0, 4)) %agg.result)
442flexible_array func_flexible_array_ret()
443{
444  flexible_array s = { 0 };
445  return s;
446}
447
448// CHECK: define{{.*}} void @func_reg_state_lo(<4 x i32> noundef %arg0, <4 x i32> noundef %arg1, <4 x i32> noundef %arg2, i32 noundef %arg3, i32 %s.coerce0, float %s.coerce1, i32 %s.coerce2)
449void func_reg_state_lo(int4 arg0, int4 arg1, int4 arg2, int arg3, struct_arg_t s) { }
450
451// CHECK: define{{.*}} void @func_reg_state_hi(<4 x i32> noundef %arg0, <4 x i32> noundef %arg1, <4 x i32> noundef %arg2, i32 noundef %arg3, i32 noundef %arg4, ptr addrspace(5) noundef readnone byref(%struct.struct_arg) align 4 captures(none) %{{.*}})
452void func_reg_state_hi(int4 arg0, int4 arg1, int4 arg2, int arg3, int arg4, struct_arg_t s) { }
453
454// XXX - Why don't the inner structs flatten?
455// CHECK: define{{.*}} void @func_reg_state_num_regs_nested_struct(<4 x i32> noundef %arg0, i32 noundef %arg1, i32 %arg2.coerce0, %struct.nested %arg2.coerce1, i32 %arg3.coerce0, %struct.nested %arg3.coerce1, ptr addrspace(5) noundef readnone byref(%struct.num_regs_nested_struct) align 8 captures(none) %{{.*}})
456void func_reg_state_num_regs_nested_struct(int4 arg0, int arg1, num_regs_nested_struct arg2, num_regs_nested_struct arg3, num_regs_nested_struct arg4) { }
457
458// CHECK: define{{.*}} void @func_double_nested_struct_arg(<4 x i32> noundef %arg0, i32 noundef %arg1, i32 %arg2.coerce0, %struct.double_nested %arg2.coerce1, i16 %arg2.coerce2)
459void func_double_nested_struct_arg(int4 arg0, int arg1, double_nested_struct arg2) { }
460
461// CHECK: define{{.*}} %struct.double_nested_struct @func_double_nested_struct_ret(<4 x i32> noundef %arg0, i32 noundef %arg1)
462double_nested_struct func_double_nested_struct_ret(int4 arg0, int arg1) {
463  double_nested_struct s = { 0 };
464  return s;
465}
466
467// CHECK: define{{.*}} void @func_large_struct_padding_arg_direct(i8 %arg.coerce0, i32 %arg.coerce1, i8 %arg.coerce2, i32 %arg.coerce3, i8 %arg.coerce4, i8 %arg.coerce5, i16 %arg.coerce6, i16 %arg.coerce7, [3 x i8] %arg.coerce8, i64 %arg.coerce9, i32 %arg.coerce10, i8 %arg.coerce11, i32 %arg.coerce12, i16 %arg.coerce13, i8 %arg.coerce14)
468void func_large_struct_padding_arg_direct(large_struct_padding arg) { }
469
470// CHECK: define{{.*}} void @func_large_struct_padding_arg_store(ptr addrspace(1) noundef writeonly captures(none) initializes((0, 56)) %out, ptr addrspace(5) noundef readonly byref(%struct.large_struct_padding) align 8 captures(none) %{{.*}})
471void func_large_struct_padding_arg_store(global large_struct_padding* out, large_struct_padding arg) {
472  *out = arg;
473}
474
475// CHECK: define{{.*}} void @v3i32_reg_count(<3 x i32> noundef %arg1, <3 x i32> noundef %arg2, <3 x i32> noundef %arg3, <3 x i32> noundef %arg4, i32 %arg5.coerce0, float %arg5.coerce1, i32 %arg5.coerce2)
476void v3i32_reg_count(int3 arg1, int3 arg2, int3 arg3, int3 arg4, struct_arg_t arg5) { }
477
478// Function signature from blender, nothing should be passed byval. The v3i32
479// should not count as 4 passed registers.
480// CHECK: define{{.*}} void @v3i32_pair_reg_count(ptr addrspace(5) noundef readnone captures(none) %arg0, <3 x i32> %arg1.coerce0, <3 x i32> %arg1.coerce1, <3 x i32> noundef %arg2, <3 x i32> %arg3.coerce0, <3 x i32> %arg3.coerce1, <3 x i32> noundef %arg4, float noundef %arg5)
481void v3i32_pair_reg_count(int3_pair *arg0, int3_pair arg1, int3 arg2, int3_pair arg3, int3 arg4, float arg5) { }
482
483// Each short4 should fit pack into 2 registers.
484// CHECK: define{{.*}} void @v4i16_reg_count(<4 x i16> noundef %arg0, <4 x i16> noundef %arg1, <4 x i16> noundef %arg2, <4 x i16> noundef %arg3, <4 x i16> noundef %arg4, <4 x i16> noundef %arg5, i32 %arg6.coerce0, i32 %arg6.coerce1, i32 %arg6.coerce2, i32 %arg6.coerce3)
485void v4i16_reg_count(short4 arg0, short4 arg1, short4 arg2, short4 arg3,
486                     short4 arg4, short4 arg5, struct_4regs arg6) { }
487
488// CHECK: define{{.*}} void @v4i16_pair_reg_count_over(<4 x i16> noundef %arg0, <4 x i16> noundef %arg1, <4 x i16> noundef %arg2, <4 x i16> noundef %arg3, <4 x i16> noundef %arg4, <4 x i16> noundef %arg5, <4 x i16> noundef %arg6, ptr addrspace(5) noundef readnone byref(%struct.struct_4regs) align 4 captures(none) %{{.*}})
489void v4i16_pair_reg_count_over(short4 arg0, short4 arg1, short4 arg2, short4 arg3,
490                               short4 arg4, short4 arg5, short4 arg6, struct_4regs arg7) { }
491
492// CHECK: define{{.*}} void @v3i16_reg_count(<3 x i16> noundef %arg0, <3 x i16> noundef %arg1, <3 x i16> noundef %arg2, <3 x i16> noundef %arg3, <3 x i16> noundef %arg4, <3 x i16> noundef %arg5, i32 %arg6.coerce0, i32 %arg6.coerce1, i32 %arg6.coerce2, i32 %arg6.coerce3)
493void v3i16_reg_count(short3 arg0, short3 arg1, short3 arg2, short3 arg3,
494                     short3 arg4, short3 arg5, struct_4regs arg6) { }
495
496// CHECK: define{{.*}} void @v3i16_reg_count_over(<3 x i16> noundef %arg0, <3 x i16> noundef %arg1, <3 x i16> noundef %arg2, <3 x i16> noundef %arg3, <3 x i16> noundef %arg4, <3 x i16> noundef %arg5, <3 x i16> noundef %arg6, ptr addrspace(5) noundef readnone byref(%struct.struct_4regs) align 4 captures(none) %{{.*}})
497void v3i16_reg_count_over(short3 arg0, short3 arg1, short3 arg2, short3 arg3,
498                          short3 arg4, short3 arg5, short3 arg6, struct_4regs arg7) { }
499
500// CHECK: define{{.*}} void @v2i16_reg_count(<2 x i16> noundef %arg0, <2 x i16> noundef %arg1, <2 x i16> noundef %arg2, <2 x i16> noundef %arg3, <2 x i16> noundef %arg4, <2 x i16> noundef %arg5, <2 x i16> noundef %arg6, <2 x i16> noundef %arg7, <2 x i16> noundef %arg8, <2 x i16> noundef %arg9, <2 x i16> noundef %arg10, <2 x i16> noundef %arg11, i32 %arg13.coerce0, i32 %arg13.coerce1, i32 %arg13.coerce2, i32 %arg13.coerce3)
501void v2i16_reg_count(short2 arg0, short2 arg1, short2 arg2, short2 arg3,
502                     short2 arg4, short2 arg5, short2 arg6, short2 arg7,
503                     short2 arg8, short2 arg9, short2 arg10, short2 arg11,
504                     struct_4regs arg13) { }
505
506// CHECK: define{{.*}} void @v2i16_reg_count_over(<2 x i16> noundef %arg0, <2 x i16> noundef %arg1, <2 x i16> noundef %arg2, <2 x i16> noundef %arg3, <2 x i16> noundef %arg4, <2 x i16> noundef %arg5, <2 x i16> noundef %arg6, <2 x i16> noundef %arg7, <2 x i16> noundef %arg8, <2 x i16> noundef %arg9, <2 x i16> noundef %arg10, <2 x i16> noundef %arg11, <2 x i16> noundef %arg12, ptr addrspace(5) noundef readnone byref(%struct.struct_4regs) align 4 captures(none) %{{.*}})
507void v2i16_reg_count_over(short2 arg0, short2 arg1, short2 arg2, short2 arg3,
508                          short2 arg4, short2 arg5, short2 arg6, short2 arg7,
509                          short2 arg8, short2 arg9, short2 arg10, short2 arg11,
510                          short2 arg12, struct_4regs arg13) { }
511
512// CHECK: define{{.*}} void @v2i8_reg_count(<2 x i8> noundef %arg0, <2 x i8> noundef %arg1, <2 x i8> noundef %arg2, <2 x i8> noundef %arg3, <2 x i8> noundef %arg4, <2 x i8> noundef %arg5, i32 %arg6.coerce0, i32 %arg6.coerce1, i32 %arg6.coerce2, i32 %arg6.coerce3)
513void v2i8_reg_count(char2 arg0, char2 arg1, char2 arg2, char2 arg3,
514                    char2 arg4, char2 arg5, struct_4regs arg6) { }
515
516// CHECK: define{{.*}} void @v2i8_reg_count_over(<2 x i8> noundef %arg0, <2 x i8> noundef %arg1, <2 x i8> noundef %arg2, <2 x i8> noundef %arg3, <2 x i8> noundef %arg4, <2 x i8> noundef %arg5, i32 noundef %arg6, ptr addrspace(5) noundef readnone byref(%struct.struct_4regs) align 4 captures(none) %{{.*}})
517void v2i8_reg_count_over(char2 arg0, char2 arg1, char2 arg2, char2 arg3,
518                         char2 arg4, char2 arg5, int arg6, struct_4regs arg7) { }
519
520// CHECK: define{{.*}} void @num_regs_left_64bit_aggregate(<4 x i32> noundef %arg0, <4 x i32> noundef %arg1, <4 x i32> noundef %arg2, <3 x i32> noundef %arg3, [2 x i32] %arg4.coerce, i32 noundef %arg5)
521void num_regs_left_64bit_aggregate(int4 arg0, int4 arg1, int4 arg2, int3 arg3, struct_char_x8 arg4, int arg5) { }
522