1 ; RUN: llc -mtriple=amdgcn--amdhsa -mcpu=gfx908 -verify-machineinstrs < %s | FileCheck -check-prefixes=GCN,GFX908 %s
2 ; RUN: llc -mtriple=amdgcn--amdhsa -mcpu=gfx90a -verify-machineinstrs < %s | FileCheck -check-prefixes=GCN,GFX90A %s
4 ; GCN-LABEL: {{^}}kernel_32_agprs:
5 ; GFX908: .amdhsa_next_free_vgpr 32
6 ; GFX90A: .amdhsa_next_free_vgpr 44
7 ; GFX90A: .amdhsa_accum_offset 12
10 ; GFX908: TotalNumVgprs: 32
11 ; GFX90A: TotalNumVgprs: 44
12 ; GFX908: VGPRBlocks: 7
13 ; GFX90A: VGPRBlocks: 5
14 ; GFX908: NumVGPRsForWavesPerEU: 32
15 ; GFX90A: NumVGPRsForWavesPerEU: 44
16 ; GFX90A: AccumOffset: 12
18 ; GFX90A: COMPUTE_PGM_RSRC3_GFX90A:ACCUM_OFFSET: 2
19 define amdgpu_kernel void @kernel_32_agprs() #0 {
21 call void asm sideeffect "", "~{v8}" ()
22 call void asm sideeffect "", "~{a31}" ()
26 ; GCN-LABEL: {{^}}kernel_0_agprs:
27 ; GCN: .amdhsa_next_free_vgpr 1
28 ; GFX90A: .amdhsa_accum_offset 4
31 ; GCN: TotalNumVgprs: 1
33 ; GCN: NumVGPRsForWavesPerEU: 1
34 ; GFX90A: AccumOffset: 4
35 ; GFX908: Occupancy: 10
36 ; GFX90A: Occupancy: 8
37 ; GFX90A: COMPUTE_PGM_RSRC3_GFX90A:ACCUM_OFFSET: 0
38 define amdgpu_kernel void @kernel_0_agprs() #0 {
40 call void asm sideeffect "", "~{v0}" ()
44 ; GCN-LABEL: {{^}}kernel_40_vgprs:
45 ; GFX908: .amdhsa_next_free_vgpr 40
46 ; GFX90A: .amdhsa_next_free_vgpr 56
47 ; GFX90A: .amdhsa_accum_offset 40
50 ; GFX908: TotalNumVgprs: 40
51 ; GFX90A: TotalNumVgprs: 56
52 ; GFX908: VGPRBlocks: 9
53 ; GFX90A: VGPRBlocks: 6
54 ; GFX908: NumVGPRsForWavesPerEU: 40
55 ; GFX90A: NumVGPRsForWavesPerEU: 56
56 ; GFX90A: AccumOffset: 40
57 ; GFX908: Occupancy: 6
58 ; GFX90A: Occupancy: 8
59 ; GFX90A: COMPUTE_PGM_RSRC3_GFX90A:ACCUM_OFFSET: 9
60 define amdgpu_kernel void @kernel_40_vgprs() #0 {
62 call void asm sideeffect "", "~{v39}" ()
63 call void asm sideeffect "", "~{a15}" ()
67 ; GCN-LABEL: {{^}}func_32_agprs:
70 ; GFX908: TotalNumVgprs: 32
71 ; GFX90A: TotalNumVgprs: 44
72 define void @func_32_agprs() #0 {
74 call void asm sideeffect "", "~{v8}" ()
75 call void asm sideeffect "", "~{a31}" ()
79 ; GCN-LABEL: {{^}}func_32_vgprs:
82 ; GFX908: TotalNumVgprs: 32
83 ; GFX90A: TotalNumVgprs: 41
84 define void @func_32_vgprs() #0 {
86 call void asm sideeffect "", "~{v31}" ()
87 call void asm sideeffect "", "~{a8}" ()
91 ; GCN-LABEL: {{^}}func_0_agprs:
94 ; GCN: TotalNumVgprs: 1
95 define amdgpu_kernel void @func_0_agprs() #0 {
97 call void asm sideeffect "", "~{v0}" ()
101 ; GCN-LABEL: {{^}}kernel_max_gprs:
102 ; GFX908: .amdhsa_next_free_vgpr 256
103 ; GFX90A: .amdhsa_next_free_vgpr 512
104 ; GFX90A: .amdhsa_accum_offset 256
107 ; GFX908: TotalNumVgprs: 256
108 ; GFX90A: TotalNumVgprs: 512
109 ; GFX908: VGPRBlocks: 63
110 ; GFX90A: VGPRBlocks: 63
111 ; GFX908: NumVGPRsForWavesPerEU: 256
112 ; GFX90A: NumVGPRsForWavesPerEU: 512
113 ; GFX90A: AccumOffset: 256
115 ; GFX90A: COMPUTE_PGM_RSRC3_GFX90A:ACCUM_OFFSET: 63
116 define amdgpu_kernel void @kernel_max_gprs() #0 {
118 call void asm sideeffect "", "~{v255}" ()
119 call void asm sideeffect "", "~{a255}" ()
123 ; GCN-LABEL: {{^}}kernel_call_func_32_agprs:
124 ; GFX908: .amdhsa_next_free_vgpr 32
125 ; GFX90A: .amdhsa_accum_offset 12
128 ; GFX908: TotalNumVgprs: 32
129 ; GFX90A: TotalNumVgprs: 44
130 ; GFX908: VGPRBlocks: 7
131 ; GFX90A: VGPRBlocks: 5
132 ; GFX908: NumVGPRsForWavesPerEU: 32
133 ; GFX90A: NumVGPRsForWavesPerEU: 44
134 ; GFX90A: AccumOffset: 12
136 ; GFX90A: COMPUTE_PGM_RSRC3_GFX90A:ACCUM_OFFSET: 2
137 define amdgpu_kernel void @kernel_call_func_32_agprs() #0 {
139 call void @func_32_agprs() #0
143 ; GCN-LABEL: {{^}}func_call_func_32_agprs:
146 ; GFX908: TotalNumVgprs: 32
147 ; GFX90A: TotalNumVgprs: 44
148 define void @func_call_func_32_agprs() #0 {
150 call void @func_32_agprs() #0
154 declare void @undef_func()
156 ; GCN-LABEL: {{^}}kernel_call_undef_func:
157 ; GFX908: .amdhsa_next_free_vgpr 32
158 ; GFX90A: .amdhsa_next_free_vgpr 64
159 ; GFX90A: .amdhsa_accum_offset 32
162 ; GFX908: TotalNumVgprs: 32
163 ; GFX90A: TotalNumVgprs: 64
164 ; GFX908: VGPRBlocks: 7
165 ; GFX90A: VGPRBlocks: 7
166 ; GFX908: NumVGPRsForWavesPerEU: 32
167 ; GFX90A: NumVGPRsForWavesPerEU: 64
168 ; GFX90A: AccumOffset: 32
169 ; GFX908: Occupancy: 8
170 ; GFX90A: Occupancy: 8
171 ; GFX90A: COMPUTE_PGM_RSRC3_GFX90A:ACCUM_OFFSET: 7
172 define amdgpu_kernel void @kernel_call_undef_func() #0 {
174 call void @undef_func()
178 attributes #0 = { nounwind noinline "amdgpu-flat-work-group-size"="1,512" "amdgpu-no-workitem-id-x" "amdgpu-no-workitem-id-y" "amdgpu-no-workitem-id-z" }