1; RUN: not llc -march=amdgcn -mcpu=bonaire -verify-machineinstrs < %s 2>&1 | FileCheck -check-prefix=GCN -check-prefix=SICI %s
2; RUN: not llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s 2>&1 | FileCheck -check-prefix=GCN %s
3; RUN: not llc -march=amdgcn -mcpu=tahiti -verify-machineinstrs < %s 2>&1 | FileCheck -check-prefix=GCN -check-prefix=SICI %s
4
5; GCN: error: couldn't allocate output register for constraint 's'
6; GCN: error: couldn't allocate input reg for constraint 's'
7define amdgpu_kernel void @s_input_output_i8() {
8  %v = tail call i8 asm sideeffect "s_mov_b32 $0, -1", "=s"()
9  tail call void asm sideeffect "; use $0", "s"(i8 %v)
10  ret void
11}
12
13; GCN: error: couldn't allocate output register for constraint 'v'
14; GCN: error: couldn't allocate input reg for constraint 'v'
15define amdgpu_kernel void @v_input_output_i8() {
16  %v = tail call i8 asm sideeffect "v_mov_b32 $0, -1", "=v"()
17  tail call void asm sideeffect "; use $0", "v"(i8 %v)
18  ret void
19}
20
21; GCN: error: couldn't allocate output register for constraint 's'
22; GCN: error: couldn't allocate input reg for constraint 's'
23define amdgpu_kernel void @s_input_output_v32f16() {
24  %v = tail call <32 x half> asm sideeffect "s_mov_b32 $0, -1", "=s"()
25  tail call void asm sideeffect "; use $0", "s"(<32 x half> %v)
26  ret void
27}
28
29; SICI: error: couldn't allocate output register for constraint 's'
30; SICI: error: couldn't allocate input reg for constraint 's'
31; VI-NOT: error
32define amdgpu_kernel void @s_input_output_v2f16() {
33  %v = tail call <2 x half> asm sideeffect "s_mov_b32 $0, -1", "=s"()
34  tail call void asm sideeffect "; use $0", "s"(<2 x half> %v)
35  ret void
36}
37
38; SICI: error: couldn't allocate output register for constraint 'v'
39; SICI: error: couldn't allocate input reg for constraint 'v'
40; VI-NOT: error
41define amdgpu_kernel void @v_input_output_v2f16() {
42  %v = tail call <2 x half> asm sideeffect "v_mov_b32 $0, -1", "=v"()
43  tail call void asm sideeffect "; use $0", "v"(<2 x half> %v)
44  ret void
45}
46
47; SICI: error: couldn't allocate output register for constraint 's'
48; SICI: error: couldn't allocate input reg for constraint 's'
49; VI-NOT: error
50define amdgpu_kernel void @s_input_output_v2i16() {
51  %v = tail call <2 x i16> asm sideeffect "s_mov_b32 $0, -1", "=s"()
52  tail call void asm sideeffect "; use $0", "s"(<2 x i16> %v)
53  ret void
54}
55
56; FIXME: Crash in codegen prepare
57; define amdgpu_kernel void @s_input_output_i3() {
58;   %v = tail call i3 asm sideeffect "s_mov_b32 $0, -1", "=s"()
59;   tail call void asm sideeffect "; use $0", "s"(i3 %v)
60;   ret void
61; }
62