1 ; RUN: llc -march=amdgcn -mcpu=gfx900 < %s | FileCheck --check-prefixes=GCN,GFX9 %s
2 ; RUN: llc -march=amdgcn -mcpu=gfx1010 < %s | FileCheck --check-prefixes=GCN,GFX10,GFX10W32,GFX1010,GFX1010W32 %s
3 ; RUN: llc -march=amdgcn -mcpu=gfx1010 -mattr=+wavefrontsize64 < %s | FileCheck --check-prefixes=GCN,GFX10,GFX10W64,GFX1010,GFX1010W64 %s
4 ; RUN: llc -march=amdgcn -mcpu=gfx1030 < %s | FileCheck --check-prefixes=GCN,GFX10,GFX10W32,GFX1030,GFX1030W32 %s
5 ; RUN: llc -march=amdgcn -mcpu=gfx1030 -mattr=+wavefrontsize64 < %s | FileCheck --check-prefixes=GCN,GFX10,GFX10W64,GFX1030,GFX1030W64 %s
7 ; GCN-LABEL: {{^}}max_occupancy:
8 ; GFX9: ; Occupancy: 10
9 ; GFX1010: ; Occupancy: 20
10 ; GFX1030: ; Occupancy: 16
11 define amdgpu_kernel void @max_occupancy() {
15 ; GCN-LABEL: {{^}}limited_occupancy_3:
16 ; GFX9: ; Occupancy: 3
17 ; GFX10W64: ; Occupancy: 3
18 ; GFX10W32: ; Occupancy: 4
19 define amdgpu_kernel void @limited_occupancy_3() #0 {
23 ; GCN-LABEL: {{^}}limited_occupancy_18:
24 ; GFX9: ; Occupancy: 10
25 ; GFX1010: ; Occupancy: 18
26 ; GFX1030: ; Occupancy: 16
27 define amdgpu_kernel void @limited_occupancy_18() #1 {
31 ; GCN-LABEL: {{^}}limited_occupancy_19:
32 ; GFX9: ; Occupancy: 10
33 ; GFX1010: ; Occupancy: 18
34 ; GFX1030: ; Occupancy: 16
35 define amdgpu_kernel void @limited_occupancy_19() #2 {
39 ; GCN-LABEL: {{^}}used_24_vgprs:
40 ; GFX9: ; Occupancy: 10
41 ; GFX1010: ; Occupancy: 20
42 ; GFX1030: ; Occupancy: 16
43 define amdgpu_kernel void @used_24_vgprs() {
44 call void asm sideeffect "", "~{v23}" ()
48 ; GCN-LABEL: {{^}}used_28_vgprs:
49 ; GFX9: ; Occupancy: 9
50 ; GFX1010W64: ; Occupancy: 18
51 ; GFX1010W32: ; Occupancy: 20
52 ; GFX1030: ; Occupancy: 16
53 define amdgpu_kernel void @used_28_vgprs() {
54 call void asm sideeffect "", "~{v27}" ()
58 ; GCN-LABEL: {{^}}used_32_vgprs:
59 ; GFX9: ; Occupancy: 8
60 ; GFX10W64: ; Occupancy: 16
61 ; GFX1010W32: ; Occupancy: 20
62 ; GFX1030W32: ; Occupancy: 16
63 define amdgpu_kernel void @used_32_vgprs() {
64 call void asm sideeffect "", "~{v31}" ()
68 ; GCN-LABEL: {{^}}used_36_vgprs:
69 ; GFX9: ; Occupancy: 7
70 ; GFX1010W64: ; Occupancy: 14
71 ; GFX1010W32: ; Occupancy: 20
72 ; GFX1030W64: ; Occupancy: 12
73 ; GFX1030W32: ; Occupancy: 16
74 define amdgpu_kernel void @used_36_vgprs() {
75 call void asm sideeffect "", "~{v35}" ()
79 ; GCN-LABEL: {{^}}used_40_vgprs:
80 ; GFX9: ; Occupancy: 6
81 ; GFX10W64: ; Occupancy: 12
82 ; GFX1010W32: ; Occupancy: 20
83 ; GFX1030W32: ; Occupancy: 16
84 define amdgpu_kernel void @used_40_vgprs() {
85 call void asm sideeffect "", "~{v39}" ()
89 ; GCN-LABEL: {{^}}used_44_vgprs:
90 ; GFX9: ; Occupancy: 5
91 ; GFX1010W64: ; Occupancy: 11
92 ; GFX1010W32: ; Occupancy: 20
93 ; GFX1030W64: ; Occupancy: 10
94 ; GFX1030W32: ; Occupancy: 16
95 define amdgpu_kernel void @used_44_vgprs() {
96 call void asm sideeffect "", "~{v43}" ()
100 ; GCN-LABEL: {{^}}used_48_vgprs:
101 ; GFX9: ; Occupancy: 5
102 ; GFX10W64: ; Occupancy: 10
103 ; GFX1010W32: ; Occupancy: 20
104 ; GFX1030W32: ; Occupancy: 16
105 define amdgpu_kernel void @used_48_vgprs() {
106 call void asm sideeffect "", "~{v47}" ()
110 ; GCN-LABEL: {{^}}used_56_vgprs:
111 ; GFX9: ; Occupancy: 4
112 ; GFX10W64: ; Occupancy: 9
113 ; GFX1010W32: ; Occupancy: 18
114 ; GFX1030W32: ; Occupancy: 16
115 define amdgpu_kernel void @used_56_vgprs() {
116 call void asm sideeffect "", "~{v55}" ()
120 ; GCN-LABEL: {{^}}used_64_vgprs:
121 ; GFX9: ; Occupancy: 4
122 ; GFX10W64: ; Occupancy: 8
123 ; GFX10W32: ; Occupancy: 16
124 define amdgpu_kernel void @used_64_vgprs() {
125 call void asm sideeffect "", "~{v63}" ()
129 ; GCN-LABEL: {{^}}used_72_vgprs:
130 ; GFX9: ; Occupancy: 3
131 ; GFX10W64: ; Occupancy: 7
132 ; GFX1010W32: ; Occupancy: 14
133 ; GFX1030W32: ; Occupancy: 12
134 define amdgpu_kernel void @used_72_vgprs() {
135 call void asm sideeffect "", "~{v71}" ()
139 ; GCN-LABEL: {{^}}used_80_vgprs:
140 ; GFX9: ; Occupancy: 3
141 ; GFX10W64: ; Occupancy: 6
142 ; GFX10W32: ; Occupancy: 12
143 define amdgpu_kernel void @used_80_vgprs() {
144 call void asm sideeffect "", "~{v79}" ()
148 ; GCN-LABEL: {{^}}used_84_vgprs:
149 ; GFX9: ; Occupancy: 3
150 ; GFX1010W64: ; Occupancy: 6
151 ; GFX1010W32: ; Occupancy: 11
152 ; GFX1030W64: ; Occupancy: 5
153 ; GFX1030W32: ; Occupancy: 10
154 define amdgpu_kernel void @used_84_vgprs() {
155 call void asm sideeffect "", "~{v83}" ()
159 ; GCN-LABEL: {{^}}used_88_vgprs:
160 ; GFX9: ; Occupancy: 2
161 ; GFX10W64: ; Occupancy: 5
162 ; GFX1010W32: ; Occupancy: 11
163 ; GFX1030W32: ; Occupancy: 10
164 define amdgpu_kernel void @used_88_vgprs() {
165 call void asm sideeffect "", "~{v87}" ()
169 ; GCN-LABEL: {{^}}used_96_vgprs:
170 ; GFX9: ; Occupancy: 2
171 ; GFX10W64: ; Occupancy: 5
172 ; GFX10W32: ; Occupancy: 10
173 define amdgpu_kernel void @used_96_vgprs() {
174 call void asm sideeffect "", "~{v95}" ()
178 ; GCN-LABEL: {{^}}used_100_vgprs:
179 ; GFX9: ; Occupancy: 2
180 ; GFX1010W64: ; Occupancy: 5
181 ; GFX1030W64: ; Occupancy: 4
182 ; GFX10W32: ; Occupancy: 9
183 define amdgpu_kernel void @used_100_vgprs() {
184 call void asm sideeffect "", "~{v99}" ()
188 ; GCN-LABEL: {{^}}used_112_vgprs:
189 ; GFX9: ; Occupancy: 2
190 ; GFX10W64: ; Occupancy: 4
191 ; GFX10W32: ; Occupancy: 9
192 define amdgpu_kernel void @used_112_vgprs() {
193 call void asm sideeffect "", "~{v111}" ()
197 ; GCN-LABEL: {{^}}used_128_vgprs:
198 ; GFX9: ; Occupancy: 2
199 ; GFX10W64: ; Occupancy: 4
200 ; GFX10W32: ; Occupancy: 8
201 define amdgpu_kernel void @used_128_vgprs() {
202 call void asm sideeffect "", "~{v127}" ()
206 ; GCN-LABEL: {{^}}used_144_vgprs:
207 ; GFX9: ; Occupancy: 1
208 ; GFX10W64: ; Occupancy: 3
209 ; GFX10W32: ; Occupancy: 7
210 define amdgpu_kernel void @used_144_vgprs() {
211 call void asm sideeffect "", "~{v143}" ()
215 ; GCN-LABEL: {{^}}used_168_vgprs:
216 ; GFX9: ; Occupancy: 1
217 ; GFX10W64: ; Occupancy: 3
218 ; GFX1010W32: ; Occupancy: 6
219 ; GFX1030W32: ; Occupancy: 5
220 define amdgpu_kernel void @used_168_vgprs() {
221 call void asm sideeffect "", "~{v167}" ()
225 ; GCN-LABEL: {{^}}used_200_vgprs:
226 ; GFX9: ; Occupancy: 1
227 ; GFX10W64: ; Occupancy: 2
228 ; GFX1010W32: ; Occupancy: 5
229 ; GFX1030W32: ; Occupancy: 4
230 define amdgpu_kernel void @used_200_vgprs() {
231 call void asm sideeffect "", "~{v199}" ()
235 ; GCN-LABEL: {{^}}used_256_vgprs:
236 ; GFX9: ; Occupancy: 1
237 ; GFX10W64: ; Occupancy: 2
238 ; GFX10W32: ; Occupancy: 4
239 define amdgpu_kernel void @used_256_vgprs() {
240 call void asm sideeffect "", "~{v255}" ()
244 ; GCN-LABEL: {{^}}used_80_sgprs:
245 ; GFX9: ; Occupancy: 10
246 ; GFX1010: ; Occupancy: 20
247 ; GFX1030: ; Occupancy: 16
248 define amdgpu_kernel void @used_80_sgprs() {
249 call void asm sideeffect "", "~{s79}" ()
253 ; GCN-LABEL: {{^}}used_88_sgprs:
254 ; GFX9: ; Occupancy: 9
255 ; GFX1010: ; Occupancy: 20
256 ; GFX1030: ; Occupancy: 16
257 define amdgpu_kernel void @used_88_sgprs() {
258 call void asm sideeffect "", "~{s87}" ()
262 ; GCN-LABEL: {{^}}used_100_sgprs:
263 ; GFX9: ; Occupancy: 8
264 ; GFX1010: ; Occupancy: 20
265 ; GFX1030: ; Occupancy: 16
266 define amdgpu_kernel void @used_100_sgprs() {
267 call void asm sideeffect "", "~{s99}" ()
271 ; GCN-LABEL: {{^}}used_101_sgprs:
272 ; GFX9: ; Occupancy: 7
273 ; GFX1010: ; Occupancy: 20
274 ; GFX1030: ; Occupancy: 16
275 define amdgpu_kernel void @used_101_sgprs() {
276 call void asm sideeffect "", "~{s100}" ()
280 ; GCN-LABEL: {{^}}used_lds_6552:
281 ; GFX9: ; Occupancy: 10
282 ; GFX1010: ; Occupancy: 20
283 ; GFX1030: ; Occupancy: 16
284 @lds6552 = internal addrspace(3) global [6552 x i8] undef, align 4
285 define amdgpu_kernel void @used_lds_6552() {
286 %p = bitcast [6552 x i8] addrspace(3)* @lds6552 to i8 addrspace(3)*
287 store volatile i8 1, i8 addrspace(3)* %p
291 ; GCN-LABEL: {{^}}used_lds_6556:
292 ; GFX9: ; Occupancy: 10
293 ; GFX1010: ; Occupancy: 20
294 ; GFX1030: ; Occupancy: 16
295 @lds6556 = internal addrspace(3) global [6556 x i8] undef, align 4
296 define amdgpu_kernel void @used_lds_6556() {
297 %p = bitcast [6556 x i8] addrspace(3)* @lds6556 to i8 addrspace(3)*
298 store volatile i8 1, i8 addrspace(3)* %p
302 ; GCN-LABEL: {{^}}used_lds_13112:
303 ; GFX9: ; Occupancy: 10
304 ; GFX1010: ; Occupancy: 20
305 ; GFX1030: ; Occupancy: 16
306 @lds13112 = internal addrspace(3) global [13112 x i8] undef, align 4
307 define amdgpu_kernel void @used_lds_13112() {
308 %p = bitcast [13112 x i8] addrspace(3)* @lds13112 to i8 addrspace(3)*
309 store volatile i8 1, i8 addrspace(3)* %p
313 ; GCN-LABEL: {{^}}used_lds_8252_max_group_size_64:
314 ; GFX9: ; Occupancy: 7{{$}}
315 ; GFX10W64: ; Occupancy: 7{{$}}
316 ; GFX10W32: ; Occupancy: 14{{$}}
317 @lds8252 = internal addrspace(3) global [8252 x i8] undef, align 4
318 define amdgpu_kernel void @used_lds_8252_max_group_size_64() #3 {
319 %p = bitcast [8252 x i8] addrspace(3)* @lds8252 to i8 addrspace(3)*
320 store volatile i8 1, i8 addrspace(3)* %p
324 ; GCN-LABEL: {{^}}used_lds_8252_max_group_size_96:
325 ; GFX9: ; Occupancy: 10{{$}}
326 ; GFX10W64: ; Occupancy: 14{{$}}
327 ; GFX1010W32: ; Occupancy: 20{{$}}
328 ; GFX1030W32: ; Occupancy: 16{{$}}
329 define amdgpu_kernel void @used_lds_8252_max_group_size_96() #4 {
330 %p = bitcast [8252 x i8] addrspace(3)* @lds8252 to i8 addrspace(3)*
331 store volatile i8 1, i8 addrspace(3)* %p
335 ; GCN-LABEL: {{^}}used_lds_8252_max_group_size_128:
336 ; GFX9: ; Occupancy: 10{{$}}
337 ; GFX10W64: ; Occupancy: 14{{$}}
338 ; GFX1010W32: ; Occupancy: 20{{$}}
339 ; GFX1030W32: ; Occupancy: 16{{$}}
340 define amdgpu_kernel void @used_lds_8252_max_group_size_128() #5 {
341 %p = bitcast [8252 x i8] addrspace(3)* @lds8252 to i8 addrspace(3)*
342 store volatile i8 1, i8 addrspace(3)* %p
346 ; GCN-LABEL: {{^}}used_lds_8252_max_group_size_192:
347 ; GFX9: ; Occupancy: 10{{$}}
348 ; GFX1010: ; Occupancy: 20{{$}}
349 ; GFX1030: ; Occupancy: 16{{$}}
350 define amdgpu_kernel void @used_lds_8252_max_group_size_192() #6 {
351 %p = bitcast [8252 x i8] addrspace(3)* @lds8252 to i8 addrspace(3)*
352 store volatile i8 1, i8 addrspace(3)* %p
356 ; GCN-LABEL: {{^}}used_lds_8252_max_group_size_256:
357 ; GFX9: ; Occupancy: 10{{$}}
358 ; GFX1010: ; Occupancy: 20{{$}}
359 ; GFX1030: ; Occupancy: 16{{$}}
360 define amdgpu_kernel void @used_lds_8252_max_group_size_256() #7 {
361 %p = bitcast [8252 x i8] addrspace(3)* @lds8252 to i8 addrspace(3)*
362 store volatile i8 1, i8 addrspace(3)* %p
366 ; GCN-LABEL: {{^}}used_lds_8252_max_group_size_512:
367 ; GFX9: ; Occupancy: 10{{$}}
368 ; GFX1010: ; Occupancy: 20{{$}}
369 ; GFX1030: ; Occupancy: 16{{$}}
370 define amdgpu_kernel void @used_lds_8252_max_group_size_512() #8 {
371 %p = bitcast [8252 x i8] addrspace(3)* @lds8252 to i8 addrspace(3)*
372 store volatile i8 1, i8 addrspace(3)* %p
376 ; GCN-LABEL: {{^}}used_lds_8252_max_group_size_1024:
377 ; GFX9: ; Occupancy: 10{{$}}
378 ; GFX1010: ; Occupancy: 20{{$}}
379 ; GFX1030: ; Occupancy: 16{{$}}
380 define amdgpu_kernel void @used_lds_8252_max_group_size_1024() #9 {
381 %p = bitcast [8252 x i8] addrspace(3)* @lds8252 to i8 addrspace(3)*
382 store volatile i8 1, i8 addrspace(3)* %p
386 ; GCN-LABEL: {{^}}used_lds_8252_max_group_size_32:
387 ; GFX9: ; Occupancy: 7{{$}}
388 ; GFX10: ; Occupancy: 7{{$}}
389 define amdgpu_kernel void @used_lds_8252_max_group_size_32() #10 {
390 %p = bitcast [8252 x i8] addrspace(3)* @lds8252 to i8 addrspace(3)*
391 store volatile i8 1, i8 addrspace(3)* %p
395 attributes #0 = { "amdgpu-waves-per-eu"="2,3" "amdgpu-flat-work-group-size"="1,64" }
396 attributes #1 = { "amdgpu-waves-per-eu"="18,18" }
397 attributes #2 = { "amdgpu-waves-per-eu"="19,19" }
398 attributes #3 = { "amdgpu-flat-work-group-size"="1,64" }
399 attributes #4 = { "amdgpu-flat-work-group-size"="1,96" }
400 attributes #5 = { "amdgpu-flat-work-group-size"="1,128" }
401 attributes #6 = { "amdgpu-flat-work-group-size"="1,192" }
402 attributes #7 = { "amdgpu-flat-work-group-size"="1,256" }
403 attributes #8 = { "amdgpu-flat-work-group-size"="1,512" }
404 attributes #9 = { "amdgpu-flat-work-group-size"="1,1024" }
405 attributes #10 = { "amdgpu-flat-work-group-size"="1,32" }