1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: -p --function-signature
2 ; RUN: opt -S --passes=expand-variadics --expand-variadics-override=lowering < %s | FileCheck %s
3 ; REQUIRES: amdgpu-registered-target
4 target datalayout = "e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-p7:160:256:256:32-p8:128:128-p9:192:256:256:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1-ni:7:8:9"
5 target triple = "amdgcn-amd-amdhsa"
7 ; Check the variables are lowered to the locations this target expects
9 ; The types show the call frames
10 ; CHECK: %single_i32.vararg = type <{ i32 }>
11 ; CHECK: %single_double.vararg = type <{ double }>
12 ; CHECK: %single_v4f32.vararg = type <{ <4 x float> }>
13 ; CHECK: %single_v8f32.vararg = type <{ <8 x float> }>
14 ; CHECK: %single_v16f32.vararg = type <{ <16 x float> }>
15 ; CHECK: %single_v32f32.vararg = type <{ <32 x float> }>
16 ; CHECK: %i32_double.vararg = type <{ i32, double }>
17 ; CHECK: %double_i32.vararg = type <{ double, i32 }>
18 ; CHECK: %i32_libcS.vararg = type <{ i32, %struct.libcS }>
19 ; CHECK: %libcS_i32.vararg = type <{ %struct.libcS, i32 }>
20 ; CHECK: %i32_v4f32.vararg = type <{ i32, <4 x float> }>
21 ; CHECK: %v4f32_i32.vararg = type <{ <4 x float>, i32 }>
22 ; CHECK: %i32_v8f32.vararg = type <{ i32, <8 x float> }>
23 ; CHECK: %v8f32_i32.vararg = type <{ <8 x float>, i32 }>
24 ; CHECK: %i32_v16f32.vararg = type <{ i32, <16 x float> }>
25 ; CHECK: %v16f32_i32.vararg = type <{ <16 x float>, i32 }>
26 ; CHECK: %i32_v32f32.vararg = type <{ i32, <32 x float> }>
27 ; CHECK: %v32f32_i32.vararg = type <{ <32 x float>, i32 }>
28 ; CHECK: %fptr_single_i32.vararg = type <{ i32 }>
29 ; CHECK: %fptr_libcS.vararg = type <{ %struct.libcS }>
31 %struct.libcS = type { i8, i16, i32, i64, float, double }
33 @vararg_ptr = hidden addrspace(1) global ptr @vararg, align 8
35 define hidden void @copy(ptr noundef %va) {
36 ; CHECK-LABEL: define {{[^@]+}}@copy(ptr noundef %va) {
38 ; CHECK-NEXT: %va.addr = alloca ptr, align 8, addrspace(5)
39 ; CHECK-NEXT: %cp = alloca ptr, align 8, addrspace(5)
40 ; CHECK-NEXT: %va.addr.ascast = addrspacecast ptr addrspace(5) %va.addr to ptr
41 ; CHECK-NEXT: %cp.ascast = addrspacecast ptr addrspace(5) %cp to ptr
42 ; CHECK-NEXT: store ptr %va, ptr addrspace(5) %va.addr, align 8
43 ; CHECK-NEXT: call void @llvm.lifetime.start.p5(i64 8, ptr addrspace(5) %cp)
44 ; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr %cp.ascast, ptr %va.addr.ascast, i32 8, i1 false)
45 ; CHECK-NEXT: %0 = load ptr, ptr addrspace(5) %cp, align 8
46 ; CHECK-NEXT: call void @valist(ptr noundef %0)
47 ; CHECK-NEXT: call void @llvm.lifetime.end.p5(i64 8, ptr addrspace(5) %cp)
48 ; CHECK-NEXT: ret void
51 %va.addr = alloca ptr, align 8, addrspace(5)
52 %cp = alloca ptr, align 8, addrspace(5)
53 %va.addr.ascast = addrspacecast ptr addrspace(5) %va.addr to ptr
54 %cp.ascast = addrspacecast ptr addrspace(5) %cp to ptr
55 store ptr %va, ptr addrspace(5) %va.addr, align 8
56 call void @llvm.lifetime.start.p5(i64 8, ptr addrspace(5) %cp)
57 call void @llvm.va_copy.p0(ptr %cp.ascast, ptr nonnull %va.addr.ascast)
58 %0 = load ptr, ptr addrspace(5) %cp, align 8
59 call void @valist(ptr noundef %0)
60 call void @llvm.lifetime.end.p5(i64 8, ptr addrspace(5) %cp)
64 declare void @llvm.lifetime.start.p5(i64 immarg, ptr addrspace(5) nocapture)
66 declare void @llvm.va_copy.p0(ptr, ptr)
68 declare hidden void @valist(ptr noundef)
70 declare void @llvm.lifetime.end.p5(i64 immarg, ptr addrspace(5) nocapture)
72 define hidden void @start_once(...) {
73 ; CHECK-LABEL: define {{[^@]+}}@start_once(ptr %varargs) {
75 ; CHECK-NEXT: %s = alloca ptr, align 8, addrspace(5)
76 ; CHECK-NEXT: %s.ascast = addrspacecast ptr addrspace(5) %s to ptr
77 ; CHECK-NEXT: call void @llvm.lifetime.start.p5(i64 8, ptr addrspace(5) %s)
78 ; CHECK-NEXT: store ptr %varargs, ptr %s.ascast, align 8
79 ; CHECK-NEXT: %0 = load ptr, ptr addrspace(5) %s, align 8
80 ; CHECK-NEXT: call void @valist(ptr noundef %0)
81 ; CHECK-NEXT: call void @llvm.lifetime.end.p5(i64 8, ptr addrspace(5) %s)
82 ; CHECK-NEXT: ret void
85 %s = alloca ptr, align 8, addrspace(5)
86 %s.ascast = addrspacecast ptr addrspace(5) %s to ptr
87 call void @llvm.lifetime.start.p5(i64 8, ptr addrspace(5) %s)
88 call void @llvm.va_start.p0(ptr %s.ascast)
89 %0 = load ptr, ptr addrspace(5) %s, align 8
90 call void @valist(ptr noundef %0)
91 call void @llvm.va_end.p0(ptr %s.ascast)
92 call void @llvm.lifetime.end.p5(i64 8, ptr addrspace(5) %s)
96 declare void @llvm.va_start.p0(ptr)
98 declare void @llvm.va_end.p0(ptr)
100 define hidden void @start_twice(...) {
101 ; CHECK-LABEL: define {{[^@]+}}@start_twice(ptr %varargs) {
103 ; CHECK-NEXT: %s0 = alloca ptr, align 8, addrspace(5)
104 ; CHECK-NEXT: %s1 = alloca ptr, align 8, addrspace(5)
105 ; CHECK-NEXT: %s0.ascast = addrspacecast ptr addrspace(5) %s0 to ptr
106 ; CHECK-NEXT: %s1.ascast = addrspacecast ptr addrspace(5) %s1 to ptr
107 ; CHECK-NEXT: call void @llvm.lifetime.start.p5(i64 8, ptr addrspace(5) %s0)
108 ; CHECK-NEXT: call void @llvm.lifetime.start.p5(i64 8, ptr addrspace(5) %s1)
109 ; CHECK-NEXT: store ptr %varargs, ptr %s0.ascast, align 8
110 ; CHECK-NEXT: %0 = load ptr, ptr addrspace(5) %s0, align 8
111 ; CHECK-NEXT: call void @valist(ptr noundef %0)
112 ; CHECK-NEXT: store ptr %varargs, ptr %s1.ascast, align 8
113 ; CHECK-NEXT: %1 = load ptr, ptr addrspace(5) %s1, align 8
114 ; CHECK-NEXT: call void @valist(ptr noundef %1)
115 ; CHECK-NEXT: call void @llvm.lifetime.end.p5(i64 8, ptr addrspace(5) %s1)
116 ; CHECK-NEXT: call void @llvm.lifetime.end.p5(i64 8, ptr addrspace(5) %s0)
117 ; CHECK-NEXT: ret void
120 %s0 = alloca ptr, align 8, addrspace(5)
121 %s1 = alloca ptr, align 8, addrspace(5)
122 %s0.ascast = addrspacecast ptr addrspace(5) %s0 to ptr
123 %s1.ascast = addrspacecast ptr addrspace(5) %s1 to ptr
124 call void @llvm.lifetime.start.p5(i64 8, ptr addrspace(5) %s0)
125 call void @llvm.lifetime.start.p5(i64 8, ptr addrspace(5) %s1)
126 call void @llvm.va_start.p0(ptr %s0.ascast)
127 %0 = load ptr, ptr addrspace(5) %s0, align 8
128 call void @valist(ptr noundef %0)
129 call void @llvm.va_end.p0(ptr %s0.ascast)
130 call void @llvm.va_start.p0(ptr %s1.ascast)
131 %1 = load ptr, ptr addrspace(5) %s1, align 8
132 call void @valist(ptr noundef %1)
133 call void @llvm.va_end.p0(ptr %s1.ascast)
134 call void @llvm.lifetime.end.p5(i64 8, ptr addrspace(5) %s1)
135 call void @llvm.lifetime.end.p5(i64 8, ptr addrspace(5) %s0)
139 define hidden void @single_i32(i32 noundef %x) {
140 ; CHECK-LABEL: define {{[^@]+}}@single_i32(i32 noundef %x) {
142 ; CHECK-NEXT: %vararg_buffer = alloca %single_i32.vararg, align 4, addrspace(5)
143 ; CHECK-NEXT: call void @llvm.lifetime.start.p5(i64 4, ptr addrspace(5) %vararg_buffer)
144 ; CHECK-NEXT: %0 = getelementptr inbounds %single_i32.vararg, ptr addrspace(5) %vararg_buffer, i32 0, i32 0
145 ; CHECK-NEXT: store i32 %x, ptr addrspace(5) %0, align 4
146 ; CHECK-NEXT: %1 = addrspacecast ptr addrspace(5) %vararg_buffer to ptr
147 ; CHECK-NEXT: call void @vararg(ptr %1)
148 ; CHECK-NEXT: call void @llvm.lifetime.end.p5(i64 4, ptr addrspace(5) %vararg_buffer)
149 ; CHECK-NEXT: ret void
152 tail call void (...) @vararg(i32 noundef %x)
156 declare hidden void @vararg(...)
158 define hidden void @single_double(double noundef %x) {
159 ; CHECK-LABEL: define {{[^@]+}}@single_double(double noundef %x) {
161 ; CHECK-NEXT: %vararg_buffer = alloca %single_double.vararg, align 4, addrspace(5)
162 ; CHECK-NEXT: call void @llvm.lifetime.start.p5(i64 8, ptr addrspace(5) %vararg_buffer)
163 ; CHECK-NEXT: %0 = getelementptr inbounds %single_double.vararg, ptr addrspace(5) %vararg_buffer, i32 0, i32 0
164 ; CHECK-NEXT: store double %x, ptr addrspace(5) %0, align 8
165 ; CHECK-NEXT: %1 = addrspacecast ptr addrspace(5) %vararg_buffer to ptr
166 ; CHECK-NEXT: call void @vararg(ptr %1)
167 ; CHECK-NEXT: call void @llvm.lifetime.end.p5(i64 8, ptr addrspace(5) %vararg_buffer)
168 ; CHECK-NEXT: ret void
171 tail call void (...) @vararg(double noundef %x)
175 define hidden void @single_v4f32(<4 x float> noundef %x) {
176 ; CHECK-LABEL: define {{[^@]+}}@single_v4f32(<4 x float> noundef %x) {
178 ; CHECK-NEXT: %vararg_buffer = alloca %single_v4f32.vararg, align 4, addrspace(5)
179 ; CHECK-NEXT: call void @llvm.lifetime.start.p5(i64 16, ptr addrspace(5) %vararg_buffer)
180 ; CHECK-NEXT: %0 = getelementptr inbounds %single_v4f32.vararg, ptr addrspace(5) %vararg_buffer, i32 0, i32 0
181 ; CHECK-NEXT: store <4 x float> %x, ptr addrspace(5) %0, align 16
182 ; CHECK-NEXT: %1 = addrspacecast ptr addrspace(5) %vararg_buffer to ptr
183 ; CHECK-NEXT: call void @vararg(ptr %1)
184 ; CHECK-NEXT: call void @llvm.lifetime.end.p5(i64 16, ptr addrspace(5) %vararg_buffer)
185 ; CHECK-NEXT: ret void
188 tail call void (...) @vararg(<4 x float> noundef %x)
192 define hidden void @single_v8f32(<8 x float> noundef %x) {
193 ; CHECK-LABEL: define {{[^@]+}}@single_v8f32(<8 x float> noundef %x) {
195 ; CHECK-NEXT: %vararg_buffer = alloca %single_v8f32.vararg, align 4, addrspace(5)
196 ; CHECK-NEXT: call void @llvm.lifetime.start.p5(i64 32, ptr addrspace(5) %vararg_buffer)
197 ; CHECK-NEXT: %0 = getelementptr inbounds %single_v8f32.vararg, ptr addrspace(5) %vararg_buffer, i32 0, i32 0
198 ; CHECK-NEXT: store <8 x float> %x, ptr addrspace(5) %0, align 32
199 ; CHECK-NEXT: %1 = addrspacecast ptr addrspace(5) %vararg_buffer to ptr
200 ; CHECK-NEXT: call void @vararg(ptr %1)
201 ; CHECK-NEXT: call void @llvm.lifetime.end.p5(i64 32, ptr addrspace(5) %vararg_buffer)
202 ; CHECK-NEXT: ret void
205 tail call void (...) @vararg(<8 x float> noundef %x)
209 define hidden void @single_v16f32(<16 x float> noundef %x) {
210 ; CHECK-LABEL: define {{[^@]+}}@single_v16f32(<16 x float> noundef %x) {
212 ; CHECK-NEXT: %vararg_buffer = alloca %single_v16f32.vararg, align 4, addrspace(5)
213 ; CHECK-NEXT: call void @llvm.lifetime.start.p5(i64 64, ptr addrspace(5) %vararg_buffer)
214 ; CHECK-NEXT: %0 = getelementptr inbounds %single_v16f32.vararg, ptr addrspace(5) %vararg_buffer, i32 0, i32 0
215 ; CHECK-NEXT: store <16 x float> %x, ptr addrspace(5) %0, align 64
216 ; CHECK-NEXT: %1 = addrspacecast ptr addrspace(5) %vararg_buffer to ptr
217 ; CHECK-NEXT: call void @vararg(ptr %1)
218 ; CHECK-NEXT: call void @llvm.lifetime.end.p5(i64 64, ptr addrspace(5) %vararg_buffer)
219 ; CHECK-NEXT: ret void
222 tail call void (...) @vararg(<16 x float> noundef %x)
226 define hidden void @single_v32f32(<32 x float> noundef %x) {
227 ; CHECK-LABEL: define {{[^@]+}}@single_v32f32(<32 x float> noundef %x) {
229 ; CHECK-NEXT: %vararg_buffer = alloca %single_v32f32.vararg, align 4, addrspace(5)
230 ; CHECK-NEXT: call void @llvm.lifetime.start.p5(i64 128, ptr addrspace(5) %vararg_buffer)
231 ; CHECK-NEXT: %0 = getelementptr inbounds %single_v32f32.vararg, ptr addrspace(5) %vararg_buffer, i32 0, i32 0
232 ; CHECK-NEXT: store <32 x float> %x, ptr addrspace(5) %0, align 128
233 ; CHECK-NEXT: %1 = addrspacecast ptr addrspace(5) %vararg_buffer to ptr
234 ; CHECK-NEXT: call void @vararg(ptr %1)
235 ; CHECK-NEXT: call void @llvm.lifetime.end.p5(i64 128, ptr addrspace(5) %vararg_buffer)
236 ; CHECK-NEXT: ret void
239 tail call void (...) @vararg(<32 x float> noundef %x)
243 define hidden void @i32_double(i32 noundef %x, double noundef %y) {
244 ; CHECK-LABEL: define {{[^@]+}}@i32_double(i32 noundef %x, double noundef %y) {
246 ; CHECK-NEXT: %vararg_buffer = alloca %i32_double.vararg, align 4, addrspace(5)
247 ; CHECK-NEXT: call void @llvm.lifetime.start.p5(i64 12, ptr addrspace(5) %vararg_buffer)
248 ; CHECK-NEXT: %0 = getelementptr inbounds %i32_double.vararg, ptr addrspace(5) %vararg_buffer, i32 0, i32 0
249 ; CHECK-NEXT: store i32 %x, ptr addrspace(5) %0, align 4
250 ; CHECK-NEXT: %1 = getelementptr inbounds %i32_double.vararg, ptr addrspace(5) %vararg_buffer, i32 0, i32 1
251 ; CHECK-NEXT: store double %y, ptr addrspace(5) %1, align 8
252 ; CHECK-NEXT: %2 = addrspacecast ptr addrspace(5) %vararg_buffer to ptr
253 ; CHECK-NEXT: call void @vararg(ptr %2)
254 ; CHECK-NEXT: call void @llvm.lifetime.end.p5(i64 12, ptr addrspace(5) %vararg_buffer)
255 ; CHECK-NEXT: ret void
258 tail call void (...) @vararg(i32 noundef %x, double noundef %y)
262 define hidden void @double_i32(double noundef %x, i32 noundef %y) {
263 ; CHECK-LABEL: define {{[^@]+}}@double_i32(double noundef %x, i32 noundef %y) {
265 ; CHECK-NEXT: %vararg_buffer = alloca %double_i32.vararg, align 4, addrspace(5)
266 ; CHECK-NEXT: call void @llvm.lifetime.start.p5(i64 12, ptr addrspace(5) %vararg_buffer)
267 ; CHECK-NEXT: %0 = getelementptr inbounds %double_i32.vararg, ptr addrspace(5) %vararg_buffer, i32 0, i32 0
268 ; CHECK-NEXT: store double %x, ptr addrspace(5) %0, align 8
269 ; CHECK-NEXT: %1 = getelementptr inbounds %double_i32.vararg, ptr addrspace(5) %vararg_buffer, i32 0, i32 1
270 ; CHECK-NEXT: store i32 %y, ptr addrspace(5) %1, align 4
271 ; CHECK-NEXT: %2 = addrspacecast ptr addrspace(5) %vararg_buffer to ptr
272 ; CHECK-NEXT: call void @vararg(ptr %2)
273 ; CHECK-NEXT: call void @llvm.lifetime.end.p5(i64 12, ptr addrspace(5) %vararg_buffer)
274 ; CHECK-NEXT: ret void
277 tail call void (...) @vararg(double noundef %x, i32 noundef %y)
281 define hidden void @i32_libcS(i32 noundef %x, i8 %y.coerce0, i16 %y.coerce1, i32 %y.coerce2, i64 %y.coerce3, float %y.coerce4, double %y.coerce5) {
282 ; CHECK-LABEL: define {{[^@]+}}@i32_libcS(i32 noundef %x, i8 %y.coerce0, i16 %y.coerce1, i32 %y.coerce2, i64 %y.coerce3, float %y.coerce4, double %y.coerce5) {
284 ; CHECK-NEXT: %vararg_buffer = alloca %i32_libcS.vararg, align 4, addrspace(5)
285 ; CHECK-NEXT: %.fca.0.insert = insertvalue %struct.libcS poison, i8 %y.coerce0, 0
286 ; CHECK-NEXT: %.fca.1.insert = insertvalue %struct.libcS %.fca.0.insert, i16 %y.coerce1, 1
287 ; CHECK-NEXT: %.fca.2.insert = insertvalue %struct.libcS %.fca.1.insert, i32 %y.coerce2, 2
288 ; CHECK-NEXT: %.fca.3.insert = insertvalue %struct.libcS %.fca.2.insert, i64 %y.coerce3, 3
289 ; CHECK-NEXT: %.fca.4.insert = insertvalue %struct.libcS %.fca.3.insert, float %y.coerce4, 4
290 ; CHECK-NEXT: %.fca.5.insert = insertvalue %struct.libcS %.fca.4.insert, double %y.coerce5, 5
291 ; CHECK-NEXT: call void @llvm.lifetime.start.p5(i64 36, ptr addrspace(5) %vararg_buffer)
292 ; CHECK-NEXT: %0 = getelementptr inbounds %i32_libcS.vararg, ptr addrspace(5) %vararg_buffer, i32 0, i32 0
293 ; CHECK-NEXT: store i32 %x, ptr addrspace(5) %0, align 4
294 ; CHECK-NEXT: %1 = getelementptr inbounds %i32_libcS.vararg, ptr addrspace(5) %vararg_buffer, i32 0, i32 1
295 ; CHECK-NEXT: store %struct.libcS %.fca.5.insert, ptr addrspace(5) %1, align 8
296 ; CHECK-NEXT: %2 = addrspacecast ptr addrspace(5) %vararg_buffer to ptr
297 ; CHECK-NEXT: call void @vararg(ptr %2)
298 ; CHECK-NEXT: call void @llvm.lifetime.end.p5(i64 36, ptr addrspace(5) %vararg_buffer)
299 ; CHECK-NEXT: ret void
302 %.fca.0.insert = insertvalue %struct.libcS poison, i8 %y.coerce0, 0
303 %.fca.1.insert = insertvalue %struct.libcS %.fca.0.insert, i16 %y.coerce1, 1
304 %.fca.2.insert = insertvalue %struct.libcS %.fca.1.insert, i32 %y.coerce2, 2
305 %.fca.3.insert = insertvalue %struct.libcS %.fca.2.insert, i64 %y.coerce3, 3
306 %.fca.4.insert = insertvalue %struct.libcS %.fca.3.insert, float %y.coerce4, 4
307 %.fca.5.insert = insertvalue %struct.libcS %.fca.4.insert, double %y.coerce5, 5
308 tail call void (...) @vararg(i32 noundef %x, %struct.libcS %.fca.5.insert)
312 define hidden void @libcS_i32(i8 %x.coerce0, i16 %x.coerce1, i32 %x.coerce2, i64 %x.coerce3, float %x.coerce4, double %x.coerce5, i32 noundef %y) {
313 ; CHECK-LABEL: define {{[^@]+}}@libcS_i32(i8 %x.coerce0, i16 %x.coerce1, i32 %x.coerce2, i64 %x.coerce3, float %x.coerce4, double %x.coerce5, i32 noundef %y) {
315 ; CHECK-NEXT: %vararg_buffer = alloca %libcS_i32.vararg, align 4, addrspace(5)
316 ; CHECK-NEXT: %.fca.0.insert = insertvalue %struct.libcS poison, i8 %x.coerce0, 0
317 ; CHECK-NEXT: %.fca.1.insert = insertvalue %struct.libcS %.fca.0.insert, i16 %x.coerce1, 1
318 ; CHECK-NEXT: %.fca.2.insert = insertvalue %struct.libcS %.fca.1.insert, i32 %x.coerce2, 2
319 ; CHECK-NEXT: %.fca.3.insert = insertvalue %struct.libcS %.fca.2.insert, i64 %x.coerce3, 3
320 ; CHECK-NEXT: %.fca.4.insert = insertvalue %struct.libcS %.fca.3.insert, float %x.coerce4, 4
321 ; CHECK-NEXT: %.fca.5.insert = insertvalue %struct.libcS %.fca.4.insert, double %x.coerce5, 5
322 ; CHECK-NEXT: call void @llvm.lifetime.start.p5(i64 36, ptr addrspace(5) %vararg_buffer)
323 ; CHECK-NEXT: %0 = getelementptr inbounds %libcS_i32.vararg, ptr addrspace(5) %vararg_buffer, i32 0, i32 0
324 ; CHECK-NEXT: store %struct.libcS %.fca.5.insert, ptr addrspace(5) %0, align 8
325 ; CHECK-NEXT: %1 = getelementptr inbounds %libcS_i32.vararg, ptr addrspace(5) %vararg_buffer, i32 0, i32 1
326 ; CHECK-NEXT: store i32 %y, ptr addrspace(5) %1, align 4
327 ; CHECK-NEXT: %2 = addrspacecast ptr addrspace(5) %vararg_buffer to ptr
328 ; CHECK-NEXT: call void @vararg(ptr %2)
329 ; CHECK-NEXT: call void @llvm.lifetime.end.p5(i64 36, ptr addrspace(5) %vararg_buffer)
330 ; CHECK-NEXT: ret void
333 %.fca.0.insert = insertvalue %struct.libcS poison, i8 %x.coerce0, 0
334 %.fca.1.insert = insertvalue %struct.libcS %.fca.0.insert, i16 %x.coerce1, 1
335 %.fca.2.insert = insertvalue %struct.libcS %.fca.1.insert, i32 %x.coerce2, 2
336 %.fca.3.insert = insertvalue %struct.libcS %.fca.2.insert, i64 %x.coerce3, 3
337 %.fca.4.insert = insertvalue %struct.libcS %.fca.3.insert, float %x.coerce4, 4
338 %.fca.5.insert = insertvalue %struct.libcS %.fca.4.insert, double %x.coerce5, 5
339 tail call void (...) @vararg(%struct.libcS %.fca.5.insert, i32 noundef %y)
343 define hidden void @i32_v4f32(i32 noundef %x, <4 x float> noundef %y) {
344 ; CHECK-LABEL: define {{[^@]+}}@i32_v4f32(i32 noundef %x, <4 x float> noundef %y) {
346 ; CHECK-NEXT: %vararg_buffer = alloca %i32_v4f32.vararg, align 4, addrspace(5)
347 ; CHECK-NEXT: call void @llvm.lifetime.start.p5(i64 20, ptr addrspace(5) %vararg_buffer)
348 ; CHECK-NEXT: %0 = getelementptr inbounds %i32_v4f32.vararg, ptr addrspace(5) %vararg_buffer, i32 0, i32 0
349 ; CHECK-NEXT: store i32 %x, ptr addrspace(5) %0, align 4
350 ; CHECK-NEXT: %1 = getelementptr inbounds %i32_v4f32.vararg, ptr addrspace(5) %vararg_buffer, i32 0, i32 1
351 ; CHECK-NEXT: store <4 x float> %y, ptr addrspace(5) %1, align 16
352 ; CHECK-NEXT: %2 = addrspacecast ptr addrspace(5) %vararg_buffer to ptr
353 ; CHECK-NEXT: call void @vararg(ptr %2)
354 ; CHECK-NEXT: call void @llvm.lifetime.end.p5(i64 20, ptr addrspace(5) %vararg_buffer)
355 ; CHECK-NEXT: ret void
358 tail call void (...) @vararg(i32 noundef %x, <4 x float> noundef %y)
362 define hidden void @v4f32_i32(<4 x float> noundef %x, i32 noundef %y) {
363 ; CHECK-LABEL: define {{[^@]+}}@v4f32_i32(<4 x float> noundef %x, i32 noundef %y) {
365 ; CHECK-NEXT: %vararg_buffer = alloca %v4f32_i32.vararg, align 4, addrspace(5)
366 ; CHECK-NEXT: call void @llvm.lifetime.start.p5(i64 20, ptr addrspace(5) %vararg_buffer)
367 ; CHECK-NEXT: %0 = getelementptr inbounds %v4f32_i32.vararg, ptr addrspace(5) %vararg_buffer, i32 0, i32 0
368 ; CHECK-NEXT: store <4 x float> %x, ptr addrspace(5) %0, align 16
369 ; CHECK-NEXT: %1 = getelementptr inbounds %v4f32_i32.vararg, ptr addrspace(5) %vararg_buffer, i32 0, i32 1
370 ; CHECK-NEXT: store i32 %y, ptr addrspace(5) %1, align 4
371 ; CHECK-NEXT: %2 = addrspacecast ptr addrspace(5) %vararg_buffer to ptr
372 ; CHECK-NEXT: call void @vararg(ptr %2)
373 ; CHECK-NEXT: call void @llvm.lifetime.end.p5(i64 20, ptr addrspace(5) %vararg_buffer)
374 ; CHECK-NEXT: ret void
377 tail call void (...) @vararg(<4 x float> noundef %x, i32 noundef %y)
381 define hidden void @i32_v8f32(i32 noundef %x, <8 x float> noundef %y) {
382 ; CHECK-LABEL: define {{[^@]+}}@i32_v8f32(i32 noundef %x, <8 x float> noundef %y) {
384 ; CHECK-NEXT: %vararg_buffer = alloca %i32_v8f32.vararg, align 4, addrspace(5)
385 ; CHECK-NEXT: call void @llvm.lifetime.start.p5(i64 36, ptr addrspace(5) %vararg_buffer)
386 ; CHECK-NEXT: %0 = getelementptr inbounds %i32_v8f32.vararg, ptr addrspace(5) %vararg_buffer, i32 0, i32 0
387 ; CHECK-NEXT: store i32 %x, ptr addrspace(5) %0, align 4
388 ; CHECK-NEXT: %1 = getelementptr inbounds %i32_v8f32.vararg, ptr addrspace(5) %vararg_buffer, i32 0, i32 1
389 ; CHECK-NEXT: store <8 x float> %y, ptr addrspace(5) %1, align 32
390 ; CHECK-NEXT: %2 = addrspacecast ptr addrspace(5) %vararg_buffer to ptr
391 ; CHECK-NEXT: call void @vararg(ptr %2)
392 ; CHECK-NEXT: call void @llvm.lifetime.end.p5(i64 36, ptr addrspace(5) %vararg_buffer)
393 ; CHECK-NEXT: ret void
396 tail call void (...) @vararg(i32 noundef %x, <8 x float> noundef %y)
400 define hidden void @v8f32_i32(<8 x float> noundef %x, i32 noundef %y) {
401 ; CHECK-LABEL: define {{[^@]+}}@v8f32_i32(<8 x float> noundef %x, i32 noundef %y) {
403 ; CHECK-NEXT: %vararg_buffer = alloca %v8f32_i32.vararg, align 4, addrspace(5)
404 ; CHECK-NEXT: call void @llvm.lifetime.start.p5(i64 36, ptr addrspace(5) %vararg_buffer)
405 ; CHECK-NEXT: %0 = getelementptr inbounds %v8f32_i32.vararg, ptr addrspace(5) %vararg_buffer, i32 0, i32 0
406 ; CHECK-NEXT: store <8 x float> %x, ptr addrspace(5) %0, align 32
407 ; CHECK-NEXT: %1 = getelementptr inbounds %v8f32_i32.vararg, ptr addrspace(5) %vararg_buffer, i32 0, i32 1
408 ; CHECK-NEXT: store i32 %y, ptr addrspace(5) %1, align 4
409 ; CHECK-NEXT: %2 = addrspacecast ptr addrspace(5) %vararg_buffer to ptr
410 ; CHECK-NEXT: call void @vararg(ptr %2)
411 ; CHECK-NEXT: call void @llvm.lifetime.end.p5(i64 36, ptr addrspace(5) %vararg_buffer)
412 ; CHECK-NEXT: ret void
415 tail call void (...) @vararg(<8 x float> noundef %x, i32 noundef %y)
419 define hidden void @i32_v16f32(i32 noundef %x, <16 x float> noundef %y) {
420 ; CHECK-LABEL: define {{[^@]+}}@i32_v16f32(i32 noundef %x, <16 x float> noundef %y) {
422 ; CHECK-NEXT: %vararg_buffer = alloca %i32_v16f32.vararg, align 4, addrspace(5)
423 ; CHECK-NEXT: call void @llvm.lifetime.start.p5(i64 68, ptr addrspace(5) %vararg_buffer)
424 ; CHECK-NEXT: %0 = getelementptr inbounds %i32_v16f32.vararg, ptr addrspace(5) %vararg_buffer, i32 0, i32 0
425 ; CHECK-NEXT: store i32 %x, ptr addrspace(5) %0, align 4
426 ; CHECK-NEXT: %1 = getelementptr inbounds %i32_v16f32.vararg, ptr addrspace(5) %vararg_buffer, i32 0, i32 1
427 ; CHECK-NEXT: store <16 x float> %y, ptr addrspace(5) %1, align 64
428 ; CHECK-NEXT: %2 = addrspacecast ptr addrspace(5) %vararg_buffer to ptr
429 ; CHECK-NEXT: call void @vararg(ptr %2)
430 ; CHECK-NEXT: call void @llvm.lifetime.end.p5(i64 68, ptr addrspace(5) %vararg_buffer)
431 ; CHECK-NEXT: ret void
434 tail call void (...) @vararg(i32 noundef %x, <16 x float> noundef %y)
438 define hidden void @v16f32_i32(<16 x float> noundef %x, i32 noundef %y) {
439 ; CHECK-LABEL: define {{[^@]+}}@v16f32_i32(<16 x float> noundef %x, i32 noundef %y) {
441 ; CHECK-NEXT: %vararg_buffer = alloca %v16f32_i32.vararg, align 4, addrspace(5)
442 ; CHECK-NEXT: call void @llvm.lifetime.start.p5(i64 68, ptr addrspace(5) %vararg_buffer)
443 ; CHECK-NEXT: %0 = getelementptr inbounds %v16f32_i32.vararg, ptr addrspace(5) %vararg_buffer, i32 0, i32 0
444 ; CHECK-NEXT: store <16 x float> %x, ptr addrspace(5) %0, align 64
445 ; CHECK-NEXT: %1 = getelementptr inbounds %v16f32_i32.vararg, ptr addrspace(5) %vararg_buffer, i32 0, i32 1
446 ; CHECK-NEXT: store i32 %y, ptr addrspace(5) %1, align 4
447 ; CHECK-NEXT: %2 = addrspacecast ptr addrspace(5) %vararg_buffer to ptr
448 ; CHECK-NEXT: call void @vararg(ptr %2)
449 ; CHECK-NEXT: call void @llvm.lifetime.end.p5(i64 68, ptr addrspace(5) %vararg_buffer)
450 ; CHECK-NEXT: ret void
453 tail call void (...) @vararg(<16 x float> noundef %x, i32 noundef %y)
457 define hidden void @i32_v32f32(i32 noundef %x, <32 x float> noundef %y) {
458 ; CHECK-LABEL: define {{[^@]+}}@i32_v32f32(i32 noundef %x, <32 x float> noundef %y) {
460 ; CHECK-NEXT: %vararg_buffer = alloca %i32_v32f32.vararg, align 4, addrspace(5)
461 ; CHECK-NEXT: call void @llvm.lifetime.start.p5(i64 132, ptr addrspace(5) %vararg_buffer)
462 ; CHECK-NEXT: %0 = getelementptr inbounds %i32_v32f32.vararg, ptr addrspace(5) %vararg_buffer, i32 0, i32 0
463 ; CHECK-NEXT: store i32 %x, ptr addrspace(5) %0, align 4
464 ; CHECK-NEXT: %1 = getelementptr inbounds %i32_v32f32.vararg, ptr addrspace(5) %vararg_buffer, i32 0, i32 1
465 ; CHECK-NEXT: store <32 x float> %y, ptr addrspace(5) %1, align 128
466 ; CHECK-NEXT: %2 = addrspacecast ptr addrspace(5) %vararg_buffer to ptr
467 ; CHECK-NEXT: call void @vararg(ptr %2)
468 ; CHECK-NEXT: call void @llvm.lifetime.end.p5(i64 132, ptr addrspace(5) %vararg_buffer)
469 ; CHECK-NEXT: ret void
472 tail call void (...) @vararg(i32 noundef %x, <32 x float> noundef %y)
476 define hidden void @v32f32_i32(<32 x float> noundef %x, i32 noundef %y) {
477 ; CHECK-LABEL: define {{[^@]+}}@v32f32_i32(<32 x float> noundef %x, i32 noundef %y) {
479 ; CHECK-NEXT: %vararg_buffer = alloca %v32f32_i32.vararg, align 4, addrspace(5)
480 ; CHECK-NEXT: call void @llvm.lifetime.start.p5(i64 132, ptr addrspace(5) %vararg_buffer)
481 ; CHECK-NEXT: %0 = getelementptr inbounds %v32f32_i32.vararg, ptr addrspace(5) %vararg_buffer, i32 0, i32 0
482 ; CHECK-NEXT: store <32 x float> %x, ptr addrspace(5) %0, align 128
483 ; CHECK-NEXT: %1 = getelementptr inbounds %v32f32_i32.vararg, ptr addrspace(5) %vararg_buffer, i32 0, i32 1
484 ; CHECK-NEXT: store i32 %y, ptr addrspace(5) %1, align 4
485 ; CHECK-NEXT: %2 = addrspacecast ptr addrspace(5) %vararg_buffer to ptr
486 ; CHECK-NEXT: call void @vararg(ptr %2)
487 ; CHECK-NEXT: call void @llvm.lifetime.end.p5(i64 132, ptr addrspace(5) %vararg_buffer)
488 ; CHECK-NEXT: ret void
491 tail call void (...) @vararg(<32 x float> noundef %x, i32 noundef %y)
495 define hidden void @fptr_single_i32(i32 noundef %x) {
496 ; CHECK-LABEL: define {{[^@]+}}@fptr_single_i32(i32 noundef %x) {
498 ; CHECK-NEXT: %vararg_buffer = alloca %fptr_single_i32.vararg, align 4, addrspace(5)
499 ; CHECK-NEXT: %0 = load volatile ptr, ptr addrspacecast (ptr addrspace(1) @vararg_ptr to ptr), align 8
500 ; CHECK-NEXT: call void @llvm.lifetime.start.p5(i64 4, ptr addrspace(5) %vararg_buffer)
501 ; CHECK-NEXT: %1 = getelementptr inbounds %fptr_single_i32.vararg, ptr addrspace(5) %vararg_buffer, i32 0, i32 0
502 ; CHECK-NEXT: store i32 %x, ptr addrspace(5) %1, align 4
503 ; CHECK-NEXT: %2 = addrspacecast ptr addrspace(5) %vararg_buffer to ptr
504 ; CHECK-NEXT: call void %0(ptr %2)
505 ; CHECK-NEXT: call void @llvm.lifetime.end.p5(i64 4, ptr addrspace(5) %vararg_buffer)
506 ; CHECK-NEXT: ret void
509 %0 = load volatile ptr, ptr addrspacecast (ptr addrspace(1) @vararg_ptr to ptr), align 8
510 tail call void (...) %0(i32 noundef %x)
514 define hidden void @fptr_libcS(i8 %x.coerce0, i16 %x.coerce1, i32 %x.coerce2, i64 %x.coerce3, float %x.coerce4, double %x.coerce5) {
515 ; CHECK-LABEL: define {{[^@]+}}@fptr_libcS(i8 %x.coerce0, i16 %x.coerce1, i32 %x.coerce2, i64 %x.coerce3, float %x.coerce4, double %x.coerce5) {
517 ; CHECK-NEXT: %vararg_buffer = alloca %fptr_libcS.vararg, align 4, addrspace(5)
518 ; CHECK-NEXT: %0 = load volatile ptr, ptr addrspacecast (ptr addrspace(1) @vararg_ptr to ptr), align 8
519 ; CHECK-NEXT: %.fca.0.insert = insertvalue %struct.libcS poison, i8 %x.coerce0, 0
520 ; CHECK-NEXT: %.fca.1.insert = insertvalue %struct.libcS %.fca.0.insert, i16 %x.coerce1, 1
521 ; CHECK-NEXT: %.fca.2.insert = insertvalue %struct.libcS %.fca.1.insert, i32 %x.coerce2, 2
522 ; CHECK-NEXT: %.fca.3.insert = insertvalue %struct.libcS %.fca.2.insert, i64 %x.coerce3, 3
523 ; CHECK-NEXT: %.fca.4.insert = insertvalue %struct.libcS %.fca.3.insert, float %x.coerce4, 4
524 ; CHECK-NEXT: %.fca.5.insert = insertvalue %struct.libcS %.fca.4.insert, double %x.coerce5, 5
525 ; CHECK-NEXT: call void @llvm.lifetime.start.p5(i64 32, ptr addrspace(5) %vararg_buffer)
526 ; CHECK-NEXT: %1 = getelementptr inbounds %fptr_libcS.vararg, ptr addrspace(5) %vararg_buffer, i32 0, i32 0
527 ; CHECK-NEXT: store %struct.libcS %.fca.5.insert, ptr addrspace(5) %1, align 8
528 ; CHECK-NEXT: %2 = addrspacecast ptr addrspace(5) %vararg_buffer to ptr
529 ; CHECK-NEXT: call void %0(ptr %2)
530 ; CHECK-NEXT: call void @llvm.lifetime.end.p5(i64 32, ptr addrspace(5) %vararg_buffer)
531 ; CHECK-NEXT: ret void
534 %0 = load volatile ptr, ptr addrspacecast (ptr addrspace(1) @vararg_ptr to ptr), align 8
535 %.fca.0.insert = insertvalue %struct.libcS poison, i8 %x.coerce0, 0
536 %.fca.1.insert = insertvalue %struct.libcS %.fca.0.insert, i16 %x.coerce1, 1
537 %.fca.2.insert = insertvalue %struct.libcS %.fca.1.insert, i32 %x.coerce2, 2
538 %.fca.3.insert = insertvalue %struct.libcS %.fca.2.insert, i64 %x.coerce3, 3
539 %.fca.4.insert = insertvalue %struct.libcS %.fca.3.insert, float %x.coerce4, 4
540 %.fca.5.insert = insertvalue %struct.libcS %.fca.4.insert, double %x.coerce5, 5
541 tail call void (...) %0(%struct.libcS %.fca.5.insert)