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