1 ; RUN: not llc -march=amdgcn < %s 2>&1 | FileCheck -check-prefix=ERR %s
2 ; RUN: not llc -march=amdgcn < %s | FileCheck -check-prefix=GCN %s
4 ; ERR: error: <unknown>:0:0: in function illegal_vgpr_to_sgpr_copy_i32 void (): illegal SGPR to VGPR copy
5 ; GCN: ; illegal copy v1 to s9
7 define amdgpu_kernel void @illegal_vgpr_to_sgpr_copy_i32() #0 {
8 %vgpr = call i32 asm sideeffect "; def $0", "=${v1}"()
9 call void asm sideeffect "; use $0", "${s9}"(i32 %vgpr)
13 ; ERR: error: <unknown>:0:0: in function illegal_vgpr_to_sgpr_copy_v2i32 void (): illegal SGPR to VGPR copy
14 ; GCN: ; illegal copy v[0:1] to s[10:11]
15 define amdgpu_kernel void @illegal_vgpr_to_sgpr_copy_v2i32() #0 {
16 %vgpr = call <2 x i32> asm sideeffect "; def $0", "=${v[0:1]}"()
17 call void asm sideeffect "; use $0", "${s[10:11]}"(<2 x i32> %vgpr)
21 ; ERR: error: <unknown>:0:0: in function illegal_vgpr_to_sgpr_copy_v4i32 void (): illegal SGPR to VGPR copy
22 ; GCN: ; illegal copy v[0:3] to s[8:11]
23 define amdgpu_kernel void @illegal_vgpr_to_sgpr_copy_v4i32() #0 {
24 %vgpr = call <4 x i32> asm sideeffect "; def $0", "=${v[0:3]}"()
25 call void asm sideeffect "; use $0", "${s[8:11]}"(<4 x i32> %vgpr)
29 ; ERR: error: <unknown>:0:0: in function illegal_vgpr_to_sgpr_copy_v8i32 void (): illegal SGPR to VGPR copy
30 ; GCN: ; illegal copy v[0:7] to s[8:15]
31 define amdgpu_kernel void @illegal_vgpr_to_sgpr_copy_v8i32() #0 {
32 %vgpr = call <8 x i32> asm sideeffect "; def $0", "=${v[0:7]}"()
33 call void asm sideeffect "; use $0", "${s[8:15]}"(<8 x i32> %vgpr)
37 ; ERR error: <unknown>:0:0: in function illegal_vgpr_to_sgpr_copy_v16i32 void (): illegal SGPR to VGPR copy
38 ; GCN: ; illegal copy v[0:15] to s[16:31]
39 define amdgpu_kernel void @illegal_vgpr_to_sgpr_copy_v16i32() #0 {
40 %vgpr = call <16 x i32> asm sideeffect "; def $0", "=${v[0:15]}"()
41 call void asm sideeffect "; use $0", "${s[16:31]}"(<16 x i32> %vgpr)
45 ; ERR: error: <unknown>:0:0: in function illegal_agpr_to_sgpr_copy_i32 void (): illegal SGPR to VGPR copy
46 ; GCN: ; illegal copy a1 to s9
47 define amdgpu_kernel void @illegal_agpr_to_sgpr_copy_i32() #1 {
48 %agpr = call i32 asm sideeffect "; def $0", "=${a1}"()
49 call void asm sideeffect "; use $0", "${s9}"(i32 %agpr)
53 ; ERR: error: <unknown>:0:0: in function illegal_agpr_to_sgpr_copy_v2i32 void (): illegal SGPR to VGPR copy
54 ; GCN: ; illegal copy a[0:1] to s[10:11]
55 define amdgpu_kernel void @illegal_agpr_to_sgpr_copy_v2i32() #1 {
56 %vgpr = call <2 x i32> asm sideeffect "; def $0", "=${a[0:1]}"()
57 call void asm sideeffect "; use $0", "${s[10:11]}"(<2 x i32> %vgpr)
61 attributes #0 = { nounwind }
62 attributes #1 = { nounwind "target-cpu"="gfx908" }