207
|
1 ; RUN: llc -march=amdgcn -mtriple=amdgcn-unknown-amdhsa --amdhsa-code-object-version=2 -mcpu=kaveri -verify-machineinstrs < %s | FileCheck --check-prefixes=ALL,CO-V2 %s
|
|
2 ; RUN: llc -march=amdgcn -mtriple=amdgcn-unknown-amdhsa --amdhsa-code-object-version=2 -mcpu=carrizo -mattr=-flat-for-global -verify-machineinstrs < %s | FileCheck --check-prefixes=ALL,CO-V2 %s
|
|
3 ; RUN: llc -march=amdgcn -mcpu=tahiti -verify-machineinstrs < %s | FileCheck --check-prefixes=ALL,MESA %s
|
|
4 ; RUN: llc -march=amdgcn -mcpu=tonga -mattr=-flat-for-global -verify-machineinstrs < %s | FileCheck --check-prefixes=ALL,MESA %s
|
|
5 ; RUN: llc -mtriple=amdgcn-unknown-mesa3d -mcpu=tahiti -verify-machineinstrs < %s | FileCheck -check-prefixes=ALL,CO-V2 %s
|
|
6 ; RUN: llc -mtriple=amdgcn-unknown-mesa3d -mcpu=tonga -mattr=-flat-for-global -verify-machineinstrs < %s | FileCheck -check-prefixes=ALL,CO-V2 %s
|
|
7 ; RUN: llc -march=amdgcn -mtriple=amdgcn-unknown-amdhsa -mcpu=gfx90a -verify-machineinstrs < %s | FileCheck -check-prefixes=ALL,PACKED-TID %s
|
150
|
8
|
|
9 declare i32 @llvm.amdgcn.workitem.id.x() #0
|
|
10 declare i32 @llvm.amdgcn.workitem.id.y() #0
|
|
11 declare i32 @llvm.amdgcn.workitem.id.z() #0
|
|
12
|
|
13 ; MESA: .section .AMDGPU.config
|
|
14 ; MESA: .long 47180
|
|
15 ; MESA-NEXT: .long 132{{$}}
|
|
16
|
173
|
17 ; ALL-LABEL: {{^}}test_workitem_id_x:
|
150
|
18 ; CO-V2: enable_vgpr_workitem_id = 0
|
|
19
|
|
20 ; ALL-NOT: v0
|
207
|
21 ; ALL: {{buffer|flat|global}}_store_dword {{.*}}v0
|
|
22
|
|
23 ; PACKED-TID: .amdhsa_system_vgpr_workitem_id 0
|
150
|
24 define amdgpu_kernel void @test_workitem_id_x(i32 addrspace(1)* %out) #1 {
|
|
25 %id = call i32 @llvm.amdgcn.workitem.id.x()
|
|
26 store i32 %id, i32 addrspace(1)* %out
|
|
27 ret void
|
|
28 }
|
|
29
|
|
30 ; MESA: .section .AMDGPU.config
|
|
31 ; MESA: .long 47180
|
|
32 ; MESA-NEXT: .long 2180{{$}}
|
|
33
|
173
|
34 ; ALL-LABEL: {{^}}test_workitem_id_y:
|
150
|
35 ; CO-V2: enable_vgpr_workitem_id = 1
|
207
|
36 ; CO-V2-NOT: v1
|
|
37 ; CO-V2: {{buffer|flat}}_store_dword {{.*}}v1
|
150
|
38
|
207
|
39 ; PACKED-TID: v_bfe_u32 [[ID:v[0-9]+]], v0, 10, 10
|
|
40 ; PACKED-TID: {{buffer|flat|global}}_store_dword {{.*}}[[ID]]
|
|
41 ; PACKED-TID: .amdhsa_system_vgpr_workitem_id 1
|
150
|
42 define amdgpu_kernel void @test_workitem_id_y(i32 addrspace(1)* %out) #1 {
|
|
43 %id = call i32 @llvm.amdgcn.workitem.id.y()
|
|
44 store i32 %id, i32 addrspace(1)* %out
|
|
45 ret void
|
|
46 }
|
|
47
|
|
48 ; MESA: .section .AMDGPU.config
|
|
49 ; MESA: .long 47180
|
|
50 ; MESA-NEXT: .long 4228{{$}}
|
|
51
|
173
|
52 ; ALL-LABEL: {{^}}test_workitem_id_z:
|
150
|
53 ; CO-V2: enable_vgpr_workitem_id = 2
|
207
|
54 ; CO-V2-NOT: v2
|
|
55 ; CO-V2: {{buffer|flat}}_store_dword {{.*}}v2
|
150
|
56
|
207
|
57 ; PACKED-TID: v_bfe_u32 [[ID:v[0-9]+]], v0, 20, 10
|
|
58 ; PACKED-TID: {{buffer|flat|global}}_store_dword {{.*}}[[ID]]
|
|
59 ; PACKED-TID: .amdhsa_system_vgpr_workitem_id 2
|
150
|
60 define amdgpu_kernel void @test_workitem_id_z(i32 addrspace(1)* %out) #1 {
|
|
61 %id = call i32 @llvm.amdgcn.workitem.id.z()
|
|
62 store i32 %id, i32 addrspace(1)* %out
|
|
63 ret void
|
|
64 }
|
|
65
|
|
66 attributes #0 = { nounwind readnone }
|
|
67 attributes #1 = { nounwind }
|