1; RUN: llc -march=amdgcn -mcpu=hawaii -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefixes=GCN,CI,CIVI %s
2; RUN: llc -march=amdgcn -mcpu=fiji -mattr=-flat-for-global -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefixes=GCN,VI,CIVI,GFX89 %s
3; RUN: llc -march=amdgcn -mcpu=gfx900 -mattr=-flat-for-global -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefixes=GCN,VI,GFX89 %s
4
5; GCN-LABEL: {{^}}void_func_i1:
6; GCN: v_and_b32_e32 v0, 1, v0
7; GCN: buffer_store_byte v0, off
8define void @void_func_i1(i1 %arg0) #0 {
9  store i1 %arg0, i1 addrspace(1)* undef
10  ret void
11}
12
13; GCN-LABEL: {{^}}void_func_i1_zeroext:
14; GCN: s_waitcnt
15; GCN-NEXT: v_or_b32_e32 v0, 12, v0
16; GCN-NOT: v0
17; GCN: buffer_store_dword v0, off
18define void @void_func_i1_zeroext(i1 zeroext %arg0) #0 {
19  %ext = zext i1 %arg0 to i32
20  %add = add i32 %ext, 12
21  store i32 %add, i32 addrspace(1)* undef
22  ret void
23}
24
25; GCN-LABEL: {{^}}void_func_i1_signext:
26; GCN: s_waitcnt
27; GCN-NEXT: v_add_{{i|u}}32_e32 v0, {{(vcc, )?}}12, v0
28; GCN-NOT: v0
29; GCN: buffer_store_dword v0, off
30define void @void_func_i1_signext(i1 signext %arg0) #0 {
31  %ext = sext i1 %arg0 to i32
32  %add = add i32 %ext, 12
33  store i32 %add, i32 addrspace(1)* undef
34  ret void
35}
36
37; GCN-LABEL: {{^}}i1_arg_i1_use:
38; GCN: v_and_b32_e32 v0, 1, v0
39; GCN: v_cmp_eq_u32_e32 vcc, 1, v0
40; GCN: s_xor_b64 s{{\[[0-9]+:[0-9]+\]}}, vcc, -1
41define void @i1_arg_i1_use(i1 %arg) #0 {
42bb:
43  br i1 %arg, label %bb2, label %bb1
44
45bb1:
46  store volatile i32 0, i32 addrspace(1)* undef
47  br label %bb2
48
49bb2:
50  ret void
51}
52
53; GCN-LABEL: {{^}}void_func_i8:
54; GCN-NOT: v0
55; GCN: buffer_store_byte v0, off
56define void @void_func_i8(i8 %arg0) #0 {
57  store i8 %arg0, i8 addrspace(1)* undef
58  ret void
59}
60
61; GCN-LABEL: {{^}}void_func_i8_zeroext:
62; GCN-NOT: and_b32
63; GCN: v_add_{{i|u}}32_e32 v0, {{(vcc, )?}}12, v0
64define void @void_func_i8_zeroext(i8 zeroext %arg0) #0 {
65  %ext = zext i8 %arg0 to i32
66  %add = add i32 %ext, 12
67  store i32 %add, i32 addrspace(1)* undef
68  ret void
69}
70
71; GCN-LABEL: {{^}}void_func_i8_signext:
72; GCN-NOT: v_bfe_i32
73; GCN: v_add_{{i|u}}32_e32 v0, {{(vcc, )?}}12, v0
74define void @void_func_i8_signext(i8 signext %arg0) #0 {
75  %ext = sext i8 %arg0 to i32
76  %add = add i32 %ext, 12
77  store i32 %add, i32 addrspace(1)* undef
78  ret void
79}
80
81; GCN-LABEL: {{^}}void_func_i16:
82; GCN: buffer_store_short v0, off
83define void @void_func_i16(i16 %arg0) #0 {
84  store i16 %arg0, i16 addrspace(1)* undef
85  ret void
86}
87
88; GCN-LABEL: {{^}}void_func_i16_zeroext:
89; GCN-NOT: v0
90; GCN: v_add_{{i|u}}32_e32 v0, {{(vcc, )?}}12, v0
91define void @void_func_i16_zeroext(i16 zeroext %arg0) #0 {
92  %ext = zext i16 %arg0 to i32
93  %add = add i32 %ext, 12
94  store i32 %add, i32 addrspace(1)* undef
95  ret void
96}
97
98; GCN-LABEL: {{^}}void_func_i16_signext:
99; GCN-NOT: v0
100; GCN: v_add_{{i|u}}32_e32 v0, {{(vcc, )?}}12, v0
101define void @void_func_i16_signext(i16 signext %arg0) #0 {
102  %ext = sext i16 %arg0 to i32
103  %add = add i32 %ext, 12
104  store i32 %add, i32 addrspace(1)* undef
105  ret void
106}
107
108; GCN-LABEL: {{^}}void_func_i32:
109; GCN-NOT: v0
110; GCN: buffer_store_dword v0, off
111define void @void_func_i32(i32 %arg0) #0 {
112  store i32 %arg0, i32 addrspace(1)* undef
113  ret void
114}
115
116; GCN-LABEL: {{^}}void_func_i64:
117; GCN-NOT: v[0:1]
118; GCN-NOT: v0
119; GCN-NOT: v1
120; GCN: buffer_store_dwordx2 v[0:1], off
121define void @void_func_i64(i64 %arg0) #0 {
122  store i64 %arg0, i64 addrspace(1)* undef
123  ret void
124}
125
126; GCN-LABEL: {{^}}void_func_f16:
127; VI-NOT: v0
128; CI: v_cvt_f16_f32_e32 v0, v0
129; GCN: buffer_store_short v0, off
130define void @void_func_f16(half %arg0) #0 {
131  store half %arg0, half addrspace(1)* undef
132  ret void
133}
134
135; GCN-LABEL: {{^}}void_func_f32
136; GCN-NOT: v0
137; GCN: buffer_store_dword v0, off
138define void @void_func_f32(float %arg0) #0 {
139  store float %arg0, float addrspace(1)* undef
140  ret void
141}
142
143; GCN-LABEL: {{^}}void_func_f64:
144; GCN-NOT: v[0:1]
145; GCN-NOT: v0
146; GCN-NOT: v1
147; GCN: buffer_store_dwordx2 v[0:1], off
148define void @void_func_f64(double %arg0) #0 {
149  store double %arg0, double addrspace(1)* undef
150  ret void
151}
152
153; GCN-LABEL: {{^}}void_func_v2i32:
154; GCN-NOT: v[0:1]
155; GCN-NOT: v0
156; GCN-NOT: v1
157; GCN: buffer_store_dwordx2 v[0:1], off
158define void @void_func_v2i32(<2 x i32> %arg0) #0 {
159  store <2 x i32> %arg0, <2 x i32> addrspace(1)* undef
160  ret void
161}
162
163; GCN-LABEL: {{^}}void_func_v3i32:
164; GCN-DAG: buffer_store_dwordx3 v[0:2], off
165define void @void_func_v3i32(<3 x i32> %arg0) #0 {
166  store <3 x i32> %arg0, <3 x i32> addrspace(1)* undef
167  ret void
168}
169
170; GCN-LABEL: {{^}}void_func_v4i32:
171; GCN: buffer_store_dwordx4 v[0:3], off
172define void @void_func_v4i32(<4 x i32> %arg0) #0 {
173  store <4 x i32> %arg0, <4 x i32> addrspace(1)* undef
174  ret void
175}
176
177; GCN-LABEL: {{^}}void_func_v5i32:
178; GCN-DAG: buffer_store_dwordx4 v[0:3], off
179; GCN-DAG: buffer_store_dword v4, off
180define void @void_func_v5i32(<5 x i32> %arg0) #0 {
181  store <5 x i32> %arg0, <5 x i32> addrspace(1)* undef
182  ret void
183}
184
185; GCN-LABEL: {{^}}void_func_v8i32:
186; GCN-DAG: buffer_store_dwordx4 v[0:3], off
187; GCN-DAG: buffer_store_dwordx4 v[4:7], off
188define void @void_func_v8i32(<8 x i32> %arg0) #0 {
189  store <8 x i32> %arg0, <8 x i32> addrspace(1)* undef
190  ret void
191}
192
193; GCN-LABEL: {{^}}void_func_v16i32:
194; GCN-DAG: buffer_store_dwordx4 v[0:3], off
195; GCN-DAG: buffer_store_dwordx4 v[4:7], off
196; GCN-DAG: buffer_store_dwordx4 v[8:11], off
197; GCN-DAG: buffer_store_dwordx4 v[12:15], off
198define void @void_func_v16i32(<16 x i32> %arg0) #0 {
199  store <16 x i32> %arg0, <16 x i32> addrspace(1)* undef
200  ret void
201}
202
203; GCN-LABEL: {{^}}void_func_v32i32:
204; GCN-DAG: buffer_store_dwordx4 v[0:3], off
205; GCN-DAG: buffer_store_dwordx4 v[4:7], off
206; GCN-DAG: buffer_store_dwordx4 v[8:11], off
207; GCN-DAG: buffer_store_dwordx4 v[12:15], off
208; GCN-DAG: buffer_store_dwordx4 v[16:19], off
209; GCN-DAG: buffer_store_dwordx4 v[20:23], off
210; GCN-DAG: buffer_store_dwordx4 v[24:27], off
211; GCN-DAG: buffer_store_dwordx4 v[28:31], off
212define void @void_func_v32i32(<32 x i32> %arg0) #0 {
213  store <32 x i32> %arg0, <32 x i32> addrspace(1)* undef
214  ret void
215}
216
217; 1 over register limit
218; GCN-LABEL: {{^}}void_func_v33i32:
219; GCN-DAG: buffer_store_dwordx4 v[0:3], off
220; GCN-DAG: buffer_store_dwordx4 v[4:7], off
221; GCN-DAG: buffer_store_dwordx4 v[8:11], off
222; GCN-DAG: buffer_store_dwordx4 v[12:15], off
223; GCN-DAG: buffer_load_dword [[STACKLOAD:v[0-9]+]], off, s[0:3], s32
224; GCN-DAG: buffer_store_dwordx4 v[16:19], off
225; GCN-DAG: buffer_store_dwordx4 v[20:23], off
226; GCN-DAG: buffer_store_dwordx4 v[24:27], off
227; GCN-DAG: buffer_store_dwordx4 v[28:31], off
228; GCN: buffer_store_dword [[STACKLOAD]], off
229define void @void_func_v33i32(<33 x i32> %arg0) #0 {
230  store <33 x i32> %arg0, <33 x i32> addrspace(1)* undef
231  ret void
232}
233
234; GCN-LABEL: {{^}}void_func_v2i64:
235; GCN: buffer_store_dwordx4 v[0:3], off
236define void @void_func_v2i64(<2 x i64> %arg0) #0 {
237  store <2 x i64> %arg0, <2 x i64> addrspace(1)* undef
238  ret void
239}
240
241; GCN-LABEL: {{^}}void_func_v3i64:
242; GCN-DAG: buffer_store_dwordx4 v[0:3], off
243; GCN-DAG: buffer_store_dwordx2 v[4:5], off
244define void @void_func_v3i64(<3 x i64> %arg0) #0 {
245  store <3 x i64> %arg0, <3 x i64> addrspace(1)* undef
246  ret void
247}
248
249; GCN-LABEL: {{^}}void_func_v4i64:
250; GCN-DAG: buffer_store_dwordx4 v[0:3], off
251; GCN-DAG: buffer_store_dwordx4 v[4:7], off
252define void @void_func_v4i64(<4 x i64> %arg0) #0 {
253  store <4 x i64> %arg0, <4 x i64> addrspace(1)* undef
254  ret void
255}
256
257; GCN-LABEL: {{^}}void_func_v5i64:
258; GCN-DAG: buffer_store_dwordx4 v[0:3], off
259; GCN-DAG: buffer_store_dwordx4 v[4:7], off
260; GCN-DAG: buffer_store_dwordx2 v[8:9], off
261define void @void_func_v5i64(<5 x i64> %arg0) #0 {
262  store <5 x i64> %arg0, <5 x i64> addrspace(1)* undef
263  ret void
264}
265
266; GCN-LABEL: {{^}}void_func_v8i64:
267; GCN-DAG: buffer_store_dwordx4 v[0:3], off
268; GCN-DAG: buffer_store_dwordx4 v[4:7], off
269; GCN-DAG: buffer_store_dwordx4 v[8:11], off
270; GCN-DAG: buffer_store_dwordx4 v[12:15], off
271define void @void_func_v8i64(<8 x i64> %arg0) #0 {
272  store <8 x i64> %arg0, <8 x i64> addrspace(1)* undef
273  ret void
274}
275
276; GCN-LABEL: {{^}}void_func_v16i64:
277; GCN-DAG: buffer_store_dwordx4 v[0:3], off
278; GCN-DAG: buffer_store_dwordx4 v[4:7], off
279; GCN-DAG: buffer_store_dwordx4 v[8:11], off
280; GCN-DAG: buffer_store_dwordx4 v[12:15], off
281; GCN-DAG: buffer_store_dwordx4 v[16:19], off
282; GCN-DAG: buffer_store_dwordx4 v[20:23], off
283; GCN-DAG: buffer_store_dwordx4 v[24:27], off
284; GCN-DAG: buffer_store_dwordx4 v[28:31], off
285define void @void_func_v16i64(<16 x i64> %arg0) #0 {
286  store <16 x i64> %arg0, <16 x i64> addrspace(1)* undef
287  ret void
288}
289
290; GCN-LABEL: {{^}}void_func_v2i16:
291; GFX9-NOT: v0
292; GFX9: buffer_store_dword v0, off
293define void @void_func_v2i16(<2 x i16> %arg0) #0 {
294  store <2 x i16> %arg0, <2 x i16> addrspace(1)* undef
295  ret void
296}
297
298; GCN-LABEL: {{^}}void_func_v3i16:
299; GCN-DAG: buffer_store_dword v{{[0-9]+}}, off
300; GCN-DAG: buffer_store_short v{{[0-9]+}}, off
301define void @void_func_v3i16(<3 x i16> %arg0) #0 {
302  store <3 x i16> %arg0, <3 x i16> addrspace(1)* undef
303  ret void
304}
305
306; GCN-LABEL: {{^}}void_func_v4i16:
307; GFX9-NOT: v0
308; GFX9-NOT: v1
309; GFX9: buffer_store_dwordx2 v[0:1], off
310define void @void_func_v4i16(<4 x i16> %arg0) #0 {
311  store <4 x i16> %arg0, <4 x i16> addrspace(1)* undef
312  ret void
313}
314
315; GCN-LABEL: {{^}}void_func_v5i16:
316; CI: v_lshlrev_b32
317; CI: v_and_b32
318; CI: v_lshlrev_b32
319; CI: v_or_b32
320; CI: v_or_b32
321; CI-DAG: buffer_store_short v
322; CI-DAG: buffer_store_dwordx2 v
323
324; GFX89-DAG: buffer_store_short v2, off,
325; GFX89-DAG: buffer_store_dwordx2 v[0:1], off
326
327define void @void_func_v5i16(<5 x i16> %arg0) #0 {
328  store <5 x i16> %arg0, <5 x i16> addrspace(1)* undef
329  ret void
330}
331
332; GCN-LABEL: {{^}}void_func_v8i16:
333; GFX9-DAG: buffer_store_dwordx4 v[0:3], off
334define void @void_func_v8i16(<8 x i16> %arg0) #0 {
335  store <8 x i16> %arg0, <8 x i16> addrspace(1)* undef
336  ret void
337}
338
339; GCN-LABEL: {{^}}void_func_v16i16:
340; GFX9-DAG: buffer_store_dwordx4 v[0:3], off
341; GFX9-DAG: buffer_store_dwordx4 v[4:7], off
342define void @void_func_v16i16(<16 x i16> %arg0) #0 {
343  store <16 x i16> %arg0, <16 x i16> addrspace(1)* undef
344  ret void
345}
346
347; GCN-LABEL: {{^}}void_func_v2i24:
348; GCN: v_add_{{i|u}}32_e32 v0, {{(vcc, )?}}v0, v1
349define void @void_func_v2i24(<2 x i24> %arg0) #0 {
350  %elt0 = extractelement <2 x i24> %arg0, i32 0
351  %elt1 = extractelement <2 x i24> %arg0, i32 1
352  %add = add i24 %elt0, %elt1
353  store i24 %add, i24 addrspace(1)* undef
354  ret void
355}
356
357; GCN-LABEL: {{^}}void_func_v2f32:
358; GCN-NOT: v[0:1]
359; GCN-NOT: v0
360; GCN-NOT: v1
361; GCN: buffer_store_dwordx2 v[0:1], off
362define void @void_func_v2f32(<2 x float> %arg0) #0 {
363  store <2 x float> %arg0, <2 x float> addrspace(1)* undef
364  ret void
365}
366
367; GCN-LABEL: {{^}}void_func_v3f32:
368; GCN-DAG: buffer_store_dwordx3 v[0:2], off
369define void @void_func_v3f32(<3 x float> %arg0) #0 {
370  store <3 x float> %arg0, <3 x float> addrspace(1)* undef
371  ret void
372}
373
374; GCN-LABEL: {{^}}void_func_v4f32:
375; GCN: buffer_store_dwordx4 v[0:3], off
376define void @void_func_v4f32(<4 x float> %arg0) #0 {
377  store <4 x float> %arg0, <4 x float> addrspace(1)* undef
378  ret void
379}
380
381; GCN-LABEL: {{^}}void_func_v8f32:
382; GCN-DAG: buffer_store_dwordx4 v[0:3], off
383; GCN-DAG: buffer_store_dwordx4 v[4:7], off
384define void @void_func_v8f32(<8 x float> %arg0) #0 {
385  store <8 x float> %arg0, <8 x float> addrspace(1)* undef
386  ret void
387}
388
389; GCN-LABEL: {{^}}void_func_v16f32:
390; GCN-DAG: buffer_store_dwordx4 v[0:3], off
391; GCN-DAG: buffer_store_dwordx4 v[4:7], off
392; GCN-DAG: buffer_store_dwordx4 v[8:11], off
393; GCN-DAG: buffer_store_dwordx4 v[12:15], off
394define void @void_func_v16f32(<16 x float> %arg0) #0 {
395  store <16 x float> %arg0, <16 x float> addrspace(1)* undef
396  ret void
397}
398
399; GCN-LABEL: {{^}}void_func_v2f64:
400; GCN: buffer_store_dwordx4 v[0:3], off
401define void @void_func_v2f64(<2 x double> %arg0) #0 {
402  store <2 x double> %arg0, <2 x double> addrspace(1)* undef
403  ret void
404}
405
406; GCN-LABEL: {{^}}void_func_v3f64:
407; GCN-DAG: buffer_store_dwordx4 v[0:3], off
408; GCN-DAG: buffer_store_dwordx2 v[4:5], off
409define void @void_func_v3f64(<3 x double> %arg0) #0 {
410  store <3 x double> %arg0, <3 x double> addrspace(1)* undef
411  ret void
412}
413
414; GCN-LABEL: {{^}}void_func_v4f64:
415; GCN-DAG: buffer_store_dwordx4 v[0:3], off
416; GCN-DAG: buffer_store_dwordx4 v[4:7], off
417define void @void_func_v4f64(<4 x double> %arg0) #0 {
418  store <4 x double> %arg0, <4 x double> addrspace(1)* undef
419  ret void
420}
421
422; GCN-LABEL: {{^}}void_func_v8f64:
423; GCN-DAG: buffer_store_dwordx4 v[0:3], off
424; GCN-DAG: buffer_store_dwordx4 v[4:7], off
425; GCN-DAG: buffer_store_dwordx4 v[8:11], off
426; GCN-DAG: buffer_store_dwordx4 v[12:15], off
427define void @void_func_v8f64(<8 x double> %arg0) #0 {
428  store <8 x double> %arg0, <8 x double> addrspace(1)* undef
429  ret void
430}
431
432; GCN-LABEL: {{^}}void_func_v16f64:
433; GCN-DAG: buffer_store_dwordx4 v[0:3], off
434; GCN-DAG: buffer_store_dwordx4 v[4:7], off
435; GCN-DAG: buffer_store_dwordx4 v[8:11], off
436; GCN-DAG: buffer_store_dwordx4 v[12:15], off
437; GCN-DAG: buffer_store_dwordx4 v[16:19], off
438; GCN-DAG: buffer_store_dwordx4 v[20:23], off
439; GCN-DAG: buffer_store_dwordx4 v[24:27], off
440; GCN-DAG: buffer_store_dwordx4 v[28:31], off
441define void @void_func_v16f64(<16 x double> %arg0) #0 {
442  store <16 x double> %arg0, <16 x double> addrspace(1)* undef
443  ret void
444}
445
446; GCN-LABEL: {{^}}void_func_v2f16:
447; GFX9-NOT: v0
448; GFX9: buffer_store_dword v0, off
449define void @void_func_v2f16(<2 x half> %arg0) #0 {
450  store <2 x half> %arg0, <2 x half> addrspace(1)* undef
451  ret void
452}
453
454; FIXME: Different abi if f16 legal
455; GCN-LABEL: {{^}}void_func_v3f16:
456; CI-DAG: v_cvt_f16_f32_e32 v{{[0-9]+}}, v0
457; CI-DAG: v_cvt_f16_f32_e32 v{{[0-9]+}}, v1
458; CI-DAG: v_cvt_f16_f32_e32 v{{[0-9]+}}, v2
459
460; GFX89-DAG: v0
461; GFX89-DAG: v1
462
463; GCN-DAG: buffer_store_short
464; GCN-DAG: buffer_store_dword
465define void @void_func_v3f16(<3 x half> %arg0) #0 {
466  store <3 x half> %arg0, <3 x half> addrspace(1)* undef
467  ret void
468}
469
470; GCN-LABEL: {{^}}void_func_v4f16:
471; GFX9-NOT: v0
472; GFX9-NOT: v1
473; GFX9-NOT: v[0:1]
474; GFX9: buffer_store_dwordx2 v[0:1], off
475define void @void_func_v4f16(<4 x half> %arg0) #0 {
476  store <4 x half> %arg0, <4 x half> addrspace(1)* undef
477  ret void
478}
479
480; GCN-LABEL: {{^}}void_func_v8f16:
481; GFX9-NOT: v0
482; GFX9-NOT: v1
483; GFX9: buffer_store_dwordx4 v[0:3], off
484define void @void_func_v8f16(<8 x half> %arg0) #0 {
485  store <8 x half> %arg0, <8 x half> addrspace(1)* undef
486  ret void
487}
488
489; GCN-LABEL: {{^}}void_func_v16f16:
490; GFX9-NOT: v0
491; GFX9-NOT: v1
492; GFX9-DAG: buffer_store_dwordx4 v[0:3], off
493; GFX9-DAG: buffer_store_dwordx4 v[4:7], off
494define void @void_func_v16f16(<16 x half> %arg0) #0 {
495  store <16 x half> %arg0, <16 x half> addrspace(1)* undef
496  ret void
497}
498
499; Make sure there is no alignment requirement for passed vgprs.
500; GCN-LABEL: {{^}}void_func_i32_i64_i32:
501; GCN-NOT: v0
502; GCN: buffer_store_dword v0, off
503; GCN: buffer_store_dwordx2 v[1:2]
504; GCN: buffer_store_dword v3
505define void @void_func_i32_i64_i32(i32 %arg0, i64 %arg1, i32 %arg2) #0 {
506  store volatile i32 %arg0, i32 addrspace(1)* undef
507  store volatile i64 %arg1, i64 addrspace(1)* undef
508  store volatile i32 %arg2, i32 addrspace(1)* undef
509  ret void
510}
511
512; GCN-LABEL: {{^}}void_func_struct_i32:
513; GCN-NOT: v0
514; GCN: buffer_store_dword v0, off
515define void @void_func_struct_i32({ i32 } %arg0) #0 {
516  store { i32 } %arg0, { i32 } addrspace(1)* undef
517  ret void
518}
519
520; GCN-LABEL: {{^}}void_func_struct_i8_i32:
521; GCN-DAG: buffer_store_byte v0, off
522; GCN-DAG: buffer_store_dword v1, off
523define void @void_func_struct_i8_i32({ i8, i32 } %arg0) #0 {
524  store { i8, i32 } %arg0, { i8, i32 } addrspace(1)* undef
525  ret void
526}
527
528; GCN-LABEL: {{^}}void_func_byval_struct_i8_i32:
529; GCN-DAG: buffer_load_ubyte v[[ELT0:[0-9]+]], off, s[0:3], s32{{$}}
530; GCN-DAG: buffer_load_dword v[[ELT1:[0-9]+]], off, s[0:3], s32 offset:4{{$}}
531; GCN-DAG: buffer_store_dword v[[ELT1]]
532; GCN-DAG: buffer_store_byte v[[ELT0]]
533define void @void_func_byval_struct_i8_i32({ i8, i32 } addrspace(5)* byval({ i8, i32 }) %arg0) #0 {
534  %arg0.load = load { i8, i32 }, { i8, i32 } addrspace(5)* %arg0
535  store { i8, i32 } %arg0.load, { i8, i32 } addrspace(1)* undef
536  ret void
537}
538
539; GCN-LABEL: {{^}}void_func_byval_struct_i8_i32_x2:
540; GCN: buffer_load_ubyte v[[ELT0_0:[0-9]+]], off, s[0:3], s32{{$}}
541; GCN: buffer_load_dword v[[ELT1_0:[0-9]+]], off, s[0:3], s32 offset:4{{$}}
542; GCN: buffer_load_ubyte v[[ELT0_1:[0-9]+]], off, s[0:3], s32 offset:8{{$}}
543; GCN: buffer_load_dword v[[ELT1_1:[0-9]+]], off, s[0:3], s32 offset:12{{$}}
544
545; GCN: ds_write_b32 v0, v0
546; GCN: s_setpc_b64
547define void @void_func_byval_struct_i8_i32_x2({ i8, i32 } addrspace(5)* byval({ i8, i32 }) %arg0, { i8, i32 } addrspace(5)* byval({ i8, i32 }) %arg1, i32 %arg2) #0 {
548  %arg0.load = load volatile { i8, i32 }, { i8, i32 } addrspace(5)* %arg0
549  %arg1.load = load volatile { i8, i32 }, { i8, i32 } addrspace(5)* %arg1
550  store volatile { i8, i32 } %arg0.load, { i8, i32 } addrspace(1)* undef
551  store volatile { i8, i32 } %arg1.load, { i8, i32 } addrspace(1)* undef
552  store volatile i32 %arg2, i32 addrspace(3)* undef
553  ret void
554}
555
556; GCN-LABEL: {{^}}void_func_byval_i32_byval_i64:
557; GCN-DAG: buffer_load_dword v[[ARG0_LOAD:[0-9]+]], off, s[0:3], s32{{$}}
558; GCN-DAG: buffer_load_dword v[[ARG1_LOAD0:[0-9]+]], off, s[0:3], s32 offset:8{{$}}
559; GCN-DAG: buffer_load_dword v[[ARG1_LOAD1:[0-9]+]], off, s[0:3], s32 offset:12{{$}}
560; GCN-DAG: buffer_store_dword v[[ARG0_LOAD]], off
561; GCN-DAG: buffer_store_dwordx2 v{{\[}}[[ARG1_LOAD0]]:[[ARG1_LOAD1]]{{\]}}, off
562define void @void_func_byval_i32_byval_i64(i32 addrspace(5)* byval(i32) %arg0, i64 addrspace(5)* byval(i64) %arg1) #0 {
563  %arg0.load = load i32, i32 addrspace(5)* %arg0
564  %arg1.load = load i64, i64 addrspace(5)* %arg1
565  store i32 %arg0.load, i32 addrspace(1)* undef
566  store i64 %arg1.load, i64 addrspace(1)* undef
567  ret void
568}
569
570; GCN-LABEL: {{^}}void_func_v32i32_i32_i64:
571; GCN-DAG: buffer_store_dwordx4 v[0:3], off
572; GCN-DAG: buffer_store_dwordx4 v[4:7], off
573; GCN-DAG: buffer_store_dwordx4 v[8:11], off
574; GCN-DAG: buffer_store_dwordx4 v[12:15], off
575; GCN-DAG: buffer_store_dwordx4 v[16:19], off
576; GCN-DAG: buffer_store_dwordx4 v[20:23], off
577; GCN-DAG: buffer_store_dwordx4 v[24:27], off
578; GCN-DAG: buffer_store_dwordx4 v[28:31], off
579; GCN-DAG: buffer_load_dword v[[LOAD_ARG1:[0-9]+]], off, s[0:3], s32{{$}}
580; GCN-DAG: buffer_load_dword v[[LOAD_ARG2_0:[0-9]+]], off, s[0:3], s32 offset:4
581; GCN-DAG: buffer_load_dword v[[LOAD_ARG2_1:[0-9]+]], off, s[0:3], s32 offset:8
582
583; GCN: buffer_store_dword v[[LOAD_ARG1]]
584; GCN: buffer_store_dwordx2 v{{\[}}[[LOAD_ARG2_0]]:[[LOAD_ARG2_1]]{{\]}}, off
585define void @void_func_v32i32_i32_i64(<32 x i32> %arg0, i32 %arg1, i64 %arg2) #0 {
586  store volatile <32 x i32> %arg0, <32 x i32> addrspace(1)* undef
587  store volatile i32 %arg1, i32 addrspace(1)* undef
588  store volatile i64 %arg2, i64 addrspace(1)* undef
589  ret void
590}
591
592; FIXME: Different ext load types on CI vs. VI
593; GCN-LABEL: {{^}}void_func_v32i32_i1_i8_i16:
594; GCN-DAG: buffer_load_ubyte [[LOAD_ARG1:v[0-9]+]], off, s[0:3], s32{{$}}
595; VI-DAG: buffer_load_ushort [[LOAD_ARG2:v[0-9]+]], off, s[0:3], s32 offset:4{{$}}
596; VI-DAG: buffer_load_ushort [[LOAD_ARG3:v[0-9]+]], off, s[0:3], s32 offset:8{{$}}
597; VI-DAG: buffer_load_ushort [[LOAD_ARG4:v[0-9]+]], off, s[0:3], s32 offset:12{{$}}
598
599; CI-DAG: buffer_load_dword [[LOAD_ARG2:v[0-9]+]], off, s[0:3], s32 offset:4{{$}}
600; CI-DAG: buffer_load_dword [[LOAD_ARG3:v[0-9]+]], off, s[0:3], s32 offset:8{{$}}
601; CI-DAG: buffer_load_dword [[LOAD_ARG4:v[0-9]+]], off, s[0:3], s32 offset:12{{$}}
602
603; GCN-DAG: v_and_b32_e32 [[TRUNC_ARG1_I1:v[0-9]+]], 1, [[LOAD_ARG1]]
604; CI-DAG: v_cvt_f16_f32_e32 [[CVT_ARG4:v[0-9]+]], [[LOAD_ARG4]]
605
606; GCN: buffer_store_byte [[TRUNC_ARG1_I1]], off
607; GCN: buffer_store_byte [[LOAD_ARG2]], off
608; GCN: buffer_store_short [[LOAD_ARG3]], off
609; GFX89: buffer_store_short [[LOAD_ARG4]], off
610
611; CI: buffer_store_short [[CVT_ARG4]], off
612define void @void_func_v32i32_i1_i8_i16(<32 x i32> %arg0, i1 %arg1, i8 %arg2, i16 %arg3, half %arg4) #0 {
613  store volatile <32 x i32> %arg0, <32 x i32> addrspace(1)* undef
614  store volatile i1 %arg1, i1 addrspace(1)* undef
615  store volatile i8 %arg2, i8 addrspace(1)* undef
616  store volatile i16 %arg3, i16 addrspace(1)* undef
617  store volatile half %arg4, half addrspace(1)* undef
618  ret void
619}
620
621; GCN-LABEL: {{^}}void_func_v32i32_v2i32_v2f32:
622; GCN-DAG: buffer_load_dword v[[LOAD_ARG1_0:[0-9]+]], off, s[0:3], s32{{$}}
623; GCN-DAG: buffer_load_dword v[[LOAD_ARG1_1:[0-9]+]], off, s[0:3], s32 offset:4{{$}}
624; GCN-DAG: buffer_load_dword v[[LOAD_ARG2_0:[0-9]+]], off, s[0:3], s32 offset:8{{$}}
625; GCN-DAG: buffer_load_dword v[[LOAD_ARG2_1:[0-9]+]], off, s[0:3], s32 offset:12{{$}}
626
627; GCN: buffer_store_dwordx2 v{{\[}}[[LOAD_ARG1_0]]:[[LOAD_ARG1_1]]{{\]}}, off
628; GCN: buffer_store_dwordx2 v{{\[}}[[LOAD_ARG2_0]]:[[LOAD_ARG2_1]]{{\]}}, off
629define void @void_func_v32i32_v2i32_v2f32(<32 x i32> %arg0, <2 x i32> %arg1, <2 x float> %arg2) #0 {
630  store volatile <32 x i32> %arg0, <32 x i32> addrspace(1)* undef
631  store volatile <2 x i32> %arg1, <2 x i32> addrspace(1)* undef
632  store volatile <2 x float> %arg2, <2 x float> addrspace(1)* undef
633  ret void
634}
635
636; GCN-LABEL: {{^}}void_func_v32i32_v2i16_v2f16:
637; GFX9-DAG: buffer_load_dword [[LOAD_ARG1:v[0-9]+]], off, s[0:3], s32 offset:4{{$}}
638; GFX9-DAG: buffer_load_dword [[LOAD_ARG2:v[0-9]+]], off, s[0:3], s32 offset:8{{$}}
639; GFX9: buffer_store_dword [[LOAD_ARG1]], off
640; GFX9: buffer_store_short [[LOAD_ARG2]], off
641define void @void_func_v32i32_v2i16_v2f16(<32 x i32> %arg0, <2 x i16> %arg1, <2 x half> %arg2) #0 {
642  store volatile <32 x i32> %arg0, <32 x i32> addrspace(1)* undef
643  store volatile <2 x i16> %arg1, <2 x i16> addrspace(1)* undef
644  store volatile <2 x half> %arg2, <2 x half> addrspace(1)* undef
645  ret void
646}
647
648; GCN-LABEL: {{^}}void_func_v32i32_v2i64_v2f64:
649; GCN-DAG: buffer_load_dword v[[LOAD_ARG1_0:[0-9]+]], off, s[0:3], s32{{$}}
650; GCN-DAG: buffer_load_dword v[[LOAD_ARG1_1:[0-9]+]], off, s[0:3], s32 offset:4{{$}}
651; GCN-DAG: buffer_load_dword v[[LOAD_ARG1_2:[0-9]+]], off, s[0:3], s32 offset:8{{$}}
652; GCN-DAG: buffer_load_dword v[[LOAD_ARG1_3:[0-9]+]], off, s[0:3], s32 offset:12{{$}}
653
654; GCN-DAG: buffer_load_dword v[[LOAD_ARG2_0:[0-9]+]], off, s[0:3], s32 offset:16{{$}}
655; GCN-DAG: buffer_load_dword v[[LOAD_ARG2_1:[0-9]+]], off, s[0:3], s32 offset:20{{$}}
656; GCN-DAG: buffer_load_dword v[[LOAD_ARG2_2:[0-9]+]], off, s[0:3], s32 offset:24{{$}}
657; GCN-DAG: buffer_load_dword v[[LOAD_ARG2_3:[0-9]+]], off, s[0:3], s32 offset:28{{$}}
658
659; GCN: buffer_store_dwordx4 v{{\[}}[[LOAD_ARG1_0]]:[[LOAD_ARG1_3]]{{\]}}, off
660; GCN: buffer_store_dwordx4 v{{\[}}[[LOAD_ARG2_0]]:[[LOAD_ARG2_3]]{{\]}}, off
661define void @void_func_v32i32_v2i64_v2f64(<32 x i32> %arg0, <2 x i64> %arg1, <2 x double> %arg2) #0 {
662  store volatile <32 x i32> %arg0, <32 x i32> addrspace(1)* undef
663  store volatile <2 x i64> %arg1, <2 x i64> addrspace(1)* undef
664  store volatile <2 x double> %arg2, <2 x double> addrspace(1)* undef
665  ret void
666}
667
668; GCN-LABEL: {{^}}void_func_v32i32_v4i32_v4f32:
669; GCN-DAG: buffer_load_dword v[[LOAD_ARG1_0:[0-9]+]], off, s[0:3], s32{{$}}
670; GCN-DAG: buffer_load_dword v[[LOAD_ARG1_1:[0-9]+]], off, s[0:3], s32 offset:4{{$}}
671; GCN-DAG: buffer_load_dword v[[LOAD_ARG1_2:[0-9]+]], off, s[0:3], s32 offset:8{{$}}
672; GCN-DAG: buffer_load_dword v[[LOAD_ARG1_3:[0-9]+]], off, s[0:3], s32 offset:12{{$}}
673
674; GCN-DAG: buffer_load_dword v[[LOAD_ARG2_0:[0-9]+]], off, s[0:3], s32 offset:16{{$}}
675; GCN-DAG: buffer_load_dword v[[LOAD_ARG2_1:[0-9]+]], off, s[0:3], s32 offset:20{{$}}
676; GCN-DAG: buffer_load_dword v[[LOAD_ARG2_2:[0-9]+]], off, s[0:3], s32 offset:24{{$}}
677; GCN-DAG: buffer_load_dword v[[LOAD_ARG2_3:[0-9]+]], off, s[0:3], s32 offset:28{{$}}
678
679; GCN: buffer_store_dwordx4 v{{\[}}[[LOAD_ARG1_0]]:[[LOAD_ARG1_3]]{{\]}}, off
680; GCN: buffer_store_dwordx4 v{{\[}}[[LOAD_ARG2_0]]:[[LOAD_ARG2_3]]{{\]}}, off
681define void @void_func_v32i32_v4i32_v4f32(<32 x i32> %arg0, <4 x i32> %arg1, <4 x float> %arg2) #0 {
682  store volatile <32 x i32> %arg0, <32 x i32> addrspace(1)* undef
683  store volatile <4 x i32> %arg1, <4 x i32> addrspace(1)* undef
684  store volatile <4 x float> %arg2, <4 x float> addrspace(1)* undef
685  ret void
686}
687
688; GCN-LABEL: {{^}}void_func_v32i32_v8i32_v8f32:
689; GCN-DAG: buffer_load_dword v[[LOAD_ARG1_0:[0-9]+]], off, s[0:3], s32{{$}}
690; GCN-DAG: buffer_load_dword v[[LOAD_ARG1_1:[0-9]+]], off, s[0:3], s32 offset:4{{$}}
691; GCN-DAG: buffer_load_dword v[[LOAD_ARG1_2:[0-9]+]], off, s[0:3], s32 offset:8{{$}}
692; GCN-DAG: buffer_load_dword v[[LOAD_ARG1_3:[0-9]+]], off, s[0:3], s32 offset:12{{$}}
693; GCN-DAG: buffer_load_dword v[[LOAD_ARG1_4:[0-9]+]], off, s[0:3], s32 offset:16{{$}}
694; GCN-DAG: buffer_load_dword v[[LOAD_ARG1_5:[0-9]+]], off, s[0:3], s32 offset:20{{$}}
695; GCN-DAG: buffer_load_dword v[[LOAD_ARG1_6:[0-9]+]], off, s[0:3], s32 offset:24{{$}}
696; GCN-DAG: buffer_load_dword v[[LOAD_ARG1_7:[0-9]+]], off, s[0:3], s32 offset:28{{$}}
697
698; GCN-DAG: buffer_load_dword v[[LOAD_ARG2_0:[0-9]+]], off, s[0:3], s32 offset:32{{$}}
699; GCN-DAG: buffer_load_dword v[[LOAD_ARG2_1:[0-9]+]], off, s[0:3], s32 offset:36{{$}}
700; GCN-DAG: buffer_load_dword v[[LOAD_ARG2_2:[0-9]+]], off, s[0:3], s32 offset:40{{$}}
701; GCN-DAG: buffer_load_dword v[[LOAD_ARG2_3:[0-9]+]], off, s[0:3], s32 offset:44{{$}}
702; GCN-DAG: buffer_load_dword v[[LOAD_ARG2_4:[0-9]+]], off, s[0:3], s32 offset:48{{$}}
703; GCN-DAG: buffer_load_dword v[[LOAD_ARG2_5:[0-9]+]], off, s[0:3], s32 offset:52{{$}}
704; GCN-DAG: buffer_load_dword v[[LOAD_ARG2_6:[0-9]+]], off, s[0:3], s32 offset:56{{$}}
705; GCN-DAG: buffer_load_dword v[[LOAD_ARG2_7:[0-9]+]], off, s[0:3], s32 offset:60{{$}}
706
707; GCN: buffer_store_dwordx4 v{{\[}}[[LOAD_ARG1_4]]:[[LOAD_ARG1_7]]{{\]}}, off
708; GCN: buffer_store_dwordx4 v{{\[}}[[LOAD_ARG1_0]]:[[LOAD_ARG1_3]]{{\]}}, off
709; GCN: buffer_store_dwordx4 v{{\[}}[[LOAD_ARG2_4]]:[[LOAD_ARG2_7]]{{\]}}, off
710; GCN: buffer_store_dwordx4 v{{\[}}[[LOAD_ARG2_0]]:[[LOAD_ARG2_3]]{{\]}}, off
711define void @void_func_v32i32_v8i32_v8f32(<32 x i32> %arg0, <8 x i32> %arg1, <8 x float> %arg2) #0 {
712  store volatile <32 x i32> %arg0, <32 x i32> addrspace(1)* undef
713  store volatile <8 x i32> %arg1, <8 x i32> addrspace(1)* undef
714  store volatile <8 x float> %arg2, <8 x float> addrspace(1)* undef
715  ret void
716}
717
718; GCN-LABEL: {{^}}void_func_v32i32_v16i32_v16f32:
719; GCN-DAG: buffer_load_dword v[[LOAD_ARG1_0:[0-9]+]], off, s[0:3], s32{{$}}
720; GCN-DAG: buffer_load_dword v[[LOAD_ARG1_1:[0-9]+]], off, s[0:3], s32 offset:4{{$}}
721; GCN-DAG: buffer_load_dword v[[LOAD_ARG1_2:[0-9]+]], off, s[0:3], s32 offset:8{{$}}
722; GCN-DAG: buffer_load_dword v[[LOAD_ARG1_:[0-9]+]], off, s[0:3], s32 offset:12{{$}}
723; GCN-DAG: buffer_load_dword v[[LOAD_ARG1_4:[0-9]+]], off, s[0:3], s32 offset:16{{$}}
724; GCN-DAG: buffer_load_dword v[[LOAD_ARG1_5:[0-9]+]], off, s[0:3], s32 offset:20{{$}}
725; GCN-DAG: buffer_load_dword v[[LOAD_ARG1_6:[0-9]+]], off, s[0:3], s32 offset:24{{$}}
726; GCN-DAG: buffer_load_dword v[[LOAD_ARG1_7:[0-9]+]], off, s[0:3], s32 offset:28{{$}}
727; GCN-DAG: buffer_load_dword v[[LOAD_ARG1_8:[0-9]+]], off, s[0:3], s32 offset:32{{$}}
728; GCN-DAG: buffer_load_dword v[[LOAD_ARG1_9:[0-9]+]], off, s[0:3], s32 offset:36{{$}}
729; GCN-DAG: buffer_load_dword v[[LOAD_ARG1_10:[0-9]+]], off, s[0:3], s32 offset:40{{$}}
730; GCN-DAG: buffer_load_dword v[[LOAD_ARG1_11:[0-9]+]], off, s[0:3], s32 offset:44{{$}}
731; GCN-DAG: buffer_load_dword v[[LOAD_ARG1_12:[0-9]+]], off, s[0:3], s32 offset:48{{$}}
732; GCN-DAG: buffer_load_dword v[[LOAD_ARG1_13:[0-9]+]], off, s[0:3], s32 offset:52{{$}}
733; GCN-DAG: buffer_load_dword v[[LOAD_ARG1_14:[0-9]+]], off, s[0:3], s32 offset:56{{$}}
734; GCN-DAG: buffer_load_dword v[[LOAD_ARG2_15:[0-9]+]], off, s[0:3], s32 offset:60{{$}}
735
736; GCN-DAG: buffer_load_dword v[[LOAD_ARG2_0:[0-9]+]], off, s[0:3], s32 offset:64{{$}}
737; GCN-DAG: buffer_load_dword v[[LOAD_ARG2_1:[0-9]+]], off, s[0:3], s32 offset:68{{$}}
738; GCN-DAG: buffer_load_dword v[[LOAD_ARG2_2:[0-9]+]], off, s[0:3], s32 offset:72{{$}}
739; GCN-DAG: buffer_load_dword v[[LOAD_ARG2_3:[0-9]+]], off, s[0:3], s32 offset:76{{$}}
740; GCN-DAG: buffer_load_dword v[[LOAD_ARG2_4:[0-9]+]], off, s[0:3], s32 offset:80{{$}}
741; GCN-DAG: buffer_load_dword v[[LOAD_ARG2_5:[0-9]+]], off, s[0:3], s32 offset:84{{$}}
742; GCN-DAG: buffer_load_dword v[[LOAD_ARG2_6:[0-9]+]], off, s[0:3], s32 offset:88{{$}}
743; GCN-DAG: buffer_load_dword v[[LOAD_ARG2_7:[0-9]+]], off, s[0:3], s32 offset:92{{$}}
744; GCN-DAG: buffer_load_dword v[[LOAD_ARG2_8:[0-9]+]], off, s[0:3], s32 offset:96{{$}}
745; GCN-DAG: buffer_load_dword v[[LOAD_ARG2_9:[0-9]+]], off, s[0:3], s32 offset:100{{$}}
746; GCN-DAG: buffer_load_dword v[[LOAD_ARG2_10:[0-9]+]], off, s[0:3], s32 offset:104{{$}}
747; GCN-DAG: buffer_load_dword v[[LOAD_ARG2_11:[0-9]+]], off, s[0:3], s32 offset:108{{$}}
748; GCN-DAG: buffer_load_dword v[[LOAD_ARG2_12:[0-9]+]], off, s[0:3], s32 offset:112{{$}}
749; GCN-DAG: buffer_load_dword v[[LOAD_ARG2_13:[0-9]+]], off, s[0:3], s32 offset:116{{$}}
750; GCN-DAG: buffer_load_dword v[[LOAD_ARG2_14:[0-9]+]], off, s[0:3], s32 offset:120{{$}}
751; GCN-DAG: buffer_load_dword v[[LOAD_ARG2_15:[0-9]+]], off, s[0:3], s32 offset:124{{$}}
752define void @void_func_v32i32_v16i32_v16f32(<32 x i32> %arg0, <16 x i32> %arg1, <16 x float> %arg2) #0 {
753  store volatile <32 x i32> %arg0, <32 x i32> addrspace(1)* undef
754  store volatile <16 x i32> %arg1, <16 x i32> addrspace(1)* undef
755  store volatile <16 x float> %arg2, <16 x float> addrspace(1)* undef
756  ret void
757}
758
759; Make sure v3 isn't a wasted register because of v3 types being promoted to v4
760; GCN-LABEL: {{^}}void_func_v3f32_wasted_reg:
761; GCN: s_waitcnt
762; GCN: ds_write_b32 v{{[0-9]+}}, v0
763; GCN-NEXT: ds_write_b32 v{{[0-9]+}}, v1
764; GCN-NEXT: ds_write_b32 v{{[0-9]+}}, v2
765; GCN-NEXT: ds_write_b32 v{{[0-9]+}}, v3
766; GCN-NEXT: s_waitcnt
767; GCN-NEXT: s_setpc_b64
768define void @void_func_v3f32_wasted_reg(<3 x float> %arg0, i32 %arg1) #0 {
769  %arg0.0 = extractelement <3 x float> %arg0, i32 0
770  %arg0.1 = extractelement <3 x float> %arg0, i32 1
771  %arg0.2 = extractelement <3 x float> %arg0, i32 2
772  store volatile float %arg0.0, float addrspace(3)* undef
773  store volatile float %arg0.1, float addrspace(3)* undef
774  store volatile float %arg0.2, float addrspace(3)* undef
775  store volatile i32 %arg1, i32 addrspace(3)* undef
776  ret void
777}
778
779; GCN-LABEL: {{^}}void_func_v3i32_wasted_reg:
780; GCN: s_waitcnt
781; GCN: ds_write_b32 v{{[0-9]+}}, v0
782; GCN-NEXT: ds_write_b32 v{{[0-9]+}}, v1
783; GCN-NEXT: ds_write_b32 v{{[0-9]+}}, v2
784; GCN-NEXT: ds_write_b32 v{{[0-9]+}}, v3
785; GCN-NEXT: s_waitcnt
786; GCN-NEXT: s_setpc_b64
787define void @void_func_v3i32_wasted_reg(<3 x i32> %arg0, i32 %arg1) #0 {
788  %arg0.0 = extractelement <3 x i32> %arg0, i32 0
789  %arg0.1 = extractelement <3 x i32> %arg0, i32 1
790  %arg0.2 = extractelement <3 x i32> %arg0, i32 2
791  store volatile i32 %arg0.0, i32 addrspace(3)* undef
792  store volatile i32 %arg0.1, i32 addrspace(3)* undef
793  store volatile i32 %arg0.2, i32 addrspace(3)* undef
794  store volatile i32 %arg1, i32 addrspace(3)* undef
795  ret void
796}
797
798; Check there is no crash.
799; GCN-LABEL: {{^}}void_func_v16i8:
800define void @void_func_v16i8(<16 x i8> %arg0) #0 {
801  store volatile <16 x i8> %arg0, <16 x i8> addrspace(1)* undef
802  ret void
803}
804
805; Check there is no crash.
806; GCN-LABEL: {{^}}void_func_v32i32_v16i8:
807define void @void_func_v32i32_v16i8(<32 x i32> %arg0, <16 x i8> %arg1) #0 {
808  store volatile <32 x i32> %arg0, <32 x i32> addrspace(1)* undef
809  store volatile <16 x i8> %arg1, <16 x i8> addrspace(1)* undef
810  ret void
811}
812
813attributes #0 = { nounwind }
814