xref: /llvm-project/llvm/test/CodeGen/AMDGPU/inlineasm-illegal-type.ll (revision 9e9907f1cfa424366fba58d9520f9305b537cec9)
1; RUN: not llc -mtriple=amdgcn -mcpu=bonaire -verify-machineinstrs < %s 2>&1 | FileCheck -check-prefix=GCN -check-prefix=SICI %s
2; RUN: not llc -mtriple=amdgcn -mcpu=tonga -verify-machineinstrs < %s 2>&1 | FileCheck -check-prefix=GCN %s
3; RUN: not llc -mtriple=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; SICI: error: couldn't allocate output register for constraint 's'
22; SICI: error: couldn't allocate input reg for constraint 's'
23; VI-NOT: error
24define amdgpu_kernel void @s_input_output_v2f16() {
25  %v = tail call <2 x half> asm sideeffect "s_mov_b32 $0, -1", "=s"()
26  tail call void asm sideeffect "; use $0", "s"(<2 x half> %v)
27  ret void
28}
29
30; SICI: error: couldn't allocate output register for constraint 'v'
31; SICI: error: couldn't allocate input reg for constraint 'v'
32; VI-NOT: error
33define amdgpu_kernel void @v_input_output_v2f16() {
34  %v = tail call <2 x half> asm sideeffect "v_mov_b32 $0, -1", "=v"()
35  tail call void asm sideeffect "; use $0", "v"(<2 x half> %v)
36  ret void
37}
38
39; SICI: error: couldn't allocate output register for constraint 's'
40; SICI: error: couldn't allocate input reg for constraint 's'
41; VI-NOT: error
42define amdgpu_kernel void @s_input_output_v2i16() {
43  %v = tail call <2 x i16> asm sideeffect "s_mov_b32 $0, -1", "=s"()
44  tail call void asm sideeffect "; use $0", "s"(<2 x i16> %v)
45  ret void
46}
47
48; FIXME: Crash in codegen prepare
49; define amdgpu_kernel void @s_input_output_i3() {
50;   %v = tail call i3 asm sideeffect "s_mov_b32 $0, -1", "=s"()
51;   tail call void asm sideeffect "; use $0", "s"(i3 %v)
52;   ret void
53; }
54