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,GFX1010,GFX1010W32 %s
3 ; RUN: llc -march=amdgcn -mcpu=gfx1010 -mattr=+wavefrontsize64 < %s | FileCheck --check-prefixes=GCN,GFX1010,GFX1010W64 %s
5 ; GCN-LABEL: {{^}}max_occupancy:
6 ; GFX9: ; Occupancy: 10
7 ; GFX1010: ; Occupancy: 20
8 define amdgpu_kernel void @max_occupancy() {
12 ; GCN-LABEL: {{^}}limited_occupancy_3:
13 ; GFX9: ; Occupancy: 3
14 ; GFX1010W64: ; Occupancy: 3
15 ; GFX1010W32: ; Occupancy: 4
16 define amdgpu_kernel void @limited_occupancy_3() #0 {
20 ; GCN-LABEL: {{^}}limited_occupancy_18:
21 ; GFX9: ; Occupancy: 10
22 ; GFX1010: ; Occupancy: 18
23 define amdgpu_kernel void @limited_occupancy_18() #1 {
27 ; GCN-LABEL: {{^}}limited_occupancy_19:
28 ; GFX9: ; Occupancy: 10
29 ; GFX1010: ; Occupancy: 18
30 define amdgpu_kernel void @limited_occupancy_19() #2 {
34 ; GCN-LABEL: {{^}}used_24_vgprs:
35 ; GFX9: ; Occupancy: 10
36 ; GFX1010: ; Occupancy: 20
37 define amdgpu_kernel void @used_24_vgprs() {
38 call void asm sideeffect "", "~{v23}" ()
42 ; GCN-LABEL: {{^}}used_28_vgprs:
43 ; GFX9: ; Occupancy: 9
44 ; GFX1010W64: ; Occupancy: 18
45 ; GFX1010W32: ; Occupancy: 20
46 define amdgpu_kernel void @used_28_vgprs() {
47 call void asm sideeffect "", "~{v27}" ()
51 ; GCN-LABEL: {{^}}used_32_vgprs:
52 ; GFX9: ; Occupancy: 8
53 ; GFX1010W64: ; Occupancy: 16
54 ; GFX1010W32: ; Occupancy: 20
55 define amdgpu_kernel void @used_32_vgprs() {
56 call void asm sideeffect "", "~{v31}" ()
60 ; GCN-LABEL: {{^}}used_36_vgprs:
61 ; GFX9: ; Occupancy: 7
62 ; GFX1010W64: ; Occupancy: 14
63 ; GFX1010W32: ; Occupancy: 20
64 define amdgpu_kernel void @used_36_vgprs() {
65 call void asm sideeffect "", "~{v35}" ()
69 ; GCN-LABEL: {{^}}used_40_vgprs:
70 ; GFX9: ; Occupancy: 6
71 ; GFX1010W64: ; Occupancy: 12
72 ; GFX1010W32: ; Occupancy: 20
73 define amdgpu_kernel void @used_40_vgprs() {
74 call void asm sideeffect "", "~{v39}" ()
78 ; GCN-LABEL: {{^}}used_44_vgprs:
79 ; GFX9: ; Occupancy: 5
80 ; GFX1010W64: ; Occupancy: 11
81 ; GFX1010W32: ; Occupancy: 20
82 define amdgpu_kernel void @used_44_vgprs() {
83 call void asm sideeffect "", "~{v43}" ()
87 ; GCN-LABEL: {{^}}used_48_vgprs:
88 ; GFX9: ; Occupancy: 5
89 ; GFX1010W64: ; Occupancy: 10
90 ; GFX1010W32: ; Occupancy: 20
91 define amdgpu_kernel void @used_48_vgprs() {
92 call void asm sideeffect "", "~{v47}" ()
96 ; GCN-LABEL: {{^}}used_56_vgprs:
97 ; GFX9: ; Occupancy: 4
98 ; GFX1010W64: ; Occupancy: 9
99 ; GFX1010W32: ; Occupancy: 18
100 define amdgpu_kernel void @used_56_vgprs() {
101 call void asm sideeffect "", "~{v55}" ()
105 ; GCN-LABEL: {{^}}used_64_vgprs:
106 ; GFX9: ; Occupancy: 4
107 ; GFX1010W64: ; Occupancy: 8
108 ; GFX1010W32: ; Occupancy: 16
109 define amdgpu_kernel void @used_64_vgprs() {
110 call void asm sideeffect "", "~{v63}" ()
114 ; GCN-LABEL: {{^}}used_72_vgprs:
115 ; GFX9: ; Occupancy: 3
116 ; GFX1010W64: ; Occupancy: 7
117 ; GFX1010W32: ; Occupancy: 14
118 define amdgpu_kernel void @used_72_vgprs() {
119 call void asm sideeffect "", "~{v71}" ()
123 ; GCN-LABEL: {{^}}used_80_vgprs:
124 ; GFX9: ; Occupancy: 3
125 ; GFX1010W64: ; Occupancy: 6
126 ; GFX1010W32: ; Occupancy: 12
127 define amdgpu_kernel void @used_80_vgprs() {
128 call void asm sideeffect "", "~{v79}" ()
132 ; GCN-LABEL: {{^}}used_84_vgprs:
133 ; GFX9: ; Occupancy: 3
134 ; GFX1010W64: ; Occupancy: 6
135 ; GFX1010W32: ; Occupancy: 11
136 define amdgpu_kernel void @used_84_vgprs() {
137 call void asm sideeffect "", "~{v83}" ()
141 ; GCN-LABEL: {{^}}used_88_vgprs:
142 ; GFX9: ; Occupancy: 2
143 ; GFX1010W64: ; Occupancy: 5
144 ; GFX1010W32: ; Occupancy: 11
145 define amdgpu_kernel void @used_88_vgprs() {
146 call void asm sideeffect "", "~{v87}" ()
150 ; GCN-LABEL: {{^}}used_96_vgprs:
151 ; GFX9: ; Occupancy: 2
152 ; GFX1010W64: ; Occupancy: 5
153 ; GFX1010W32: ; Occupancy: 10
154 define amdgpu_kernel void @used_96_vgprs() {
155 call void asm sideeffect "", "~{v95}" ()
159 ; GCN-LABEL: {{^}}used_100_vgprs:
160 ; GFX9: ; Occupancy: 2
161 ; GFX1010W64: ; Occupancy: 5
162 ; GFX1010W32: ; Occupancy: 9
163 define amdgpu_kernel void @used_100_vgprs() {
164 call void asm sideeffect "", "~{v99}" ()
168 ; GCN-LABEL: {{^}}used_112_vgprs:
169 ; GFX9: ; Occupancy: 2
170 ; GFX1010W64: ; Occupancy: 4
171 ; GFX1010W32: ; Occupancy: 9
172 define amdgpu_kernel void @used_112_vgprs() {
173 call void asm sideeffect "", "~{v111}" ()
177 ; GCN-LABEL: {{^}}used_128_vgprs:
178 ; GFX9: ; Occupancy: 2
179 ; GFX1010W64: ; Occupancy: 4
180 ; GFX1010W32: ; Occupancy: 8
181 define amdgpu_kernel void @used_128_vgprs() {
182 call void asm sideeffect "", "~{v127}" ()
186 ; GCN-LABEL: {{^}}used_144_vgprs:
187 ; GFX9: ; Occupancy: 1
188 ; GFX1010W64: ; Occupancy: 3
189 ; GFX1010W32: ; Occupancy: 7
190 define amdgpu_kernel void @used_144_vgprs() {
191 call void asm sideeffect "", "~{v143}" ()
195 ; GCN-LABEL: {{^}}used_168_vgprs:
196 ; GFX9: ; Occupancy: 1
197 ; GFX1010W64: ; Occupancy: 3
198 ; GFX1010W32: ; Occupancy: 6
199 define amdgpu_kernel void @used_168_vgprs() {
200 call void asm sideeffect "", "~{v167}" ()
204 ; GCN-LABEL: {{^}}used_200_vgprs:
205 ; GFX9: ; Occupancy: 1
206 ; GFX1010W64: ; Occupancy: 2
207 ; GFX1010W32: ; Occupancy: 5
208 define amdgpu_kernel void @used_200_vgprs() {
209 call void asm sideeffect "", "~{v199}" ()
213 ; GCN-LABEL: {{^}}used_256_vgprs:
214 ; GFX9: ; Occupancy: 1
215 ; GFX1010W64: ; Occupancy: 2
216 ; GFX1010W32: ; Occupancy: 4
217 define amdgpu_kernel void @used_256_vgprs() {
218 call void asm sideeffect "", "~{v255}" ()
222 ; GCN-LABEL: {{^}}used_80_sgprs:
223 ; GFX9: ; Occupancy: 10
224 ; GFX1010: ; Occupancy: 20
225 define amdgpu_kernel void @used_80_sgprs() {
226 call void asm sideeffect "", "~{s79}" ()
230 ; GCN-LABEL: {{^}}used_88_sgprs:
231 ; GFX9: ; Occupancy: 9
232 ; GFX1010: ; Occupancy: 20
233 define amdgpu_kernel void @used_88_sgprs() {
234 call void asm sideeffect "", "~{s87}" ()
238 ; GCN-LABEL: {{^}}used_100_sgprs:
239 ; GFX9: ; Occupancy: 8
240 ; GFX1010: ; Occupancy: 20
241 define amdgpu_kernel void @used_100_sgprs() {
242 call void asm sideeffect "", "~{s99}" ()
246 ; GCN-LABEL: {{^}}used_101_sgprs:
247 ; GFX9: ; Occupancy: 7
248 ; GFX1010: ; Occupancy: 20
249 define amdgpu_kernel void @used_101_sgprs() {
250 call void asm sideeffect "", "~{s100}" ()
254 ; GCN-LABEL: {{^}}used_lds_6552:
255 ; GFX9: ; Occupancy: 10
256 ; GFX1010: ; Occupancy: 20
257 @lds6552 = internal addrspace(3) global [6552 x i8] undef, align 4
258 define amdgpu_kernel void @used_lds_6552() {
259 %p = bitcast [6552 x i8] addrspace(3)* @lds6552 to i8 addrspace(3)*
260 store volatile i8 1, i8 addrspace(3)* %p
264 ; GCN-LABEL: {{^}}used_lds_6556:
265 ; GFX9: ; Occupancy: 9
266 ; GFX1010W64: ; Occupancy: 19
267 ; GFX1010W32: ; Occupancy: 20
268 @lds6556 = internal addrspace(3) global [6556 x i8] undef, align 4
269 define amdgpu_kernel void @used_lds_6556() {
270 %p = bitcast [6556 x i8] addrspace(3)* @lds6556 to i8 addrspace(3)*
271 store volatile i8 1, i8 addrspace(3)* %p
275 ; GCN-LABEL: {{^}}used_lds_13112:
276 ; GFX9: ; Occupancy: 4
277 ; GFX1010W64: ; Occupancy: 9
278 ; GFX1010W32: ; Occupancy: 19
279 @lds13112 = internal addrspace(3) global [13112 x i8] undef, align 4
280 define amdgpu_kernel void @used_lds_13112() {
281 %p = bitcast [13112 x i8] addrspace(3)* @lds13112 to i8 addrspace(3)*
282 store volatile i8 1, i8 addrspace(3)* %p
286 attributes #0 = { "amdgpu-waves-per-eu"="2,3" }
287 attributes #1 = { "amdgpu-waves-per-eu"="18,18" }
288 attributes #2 = { "amdgpu-waves-per-eu"="19,19" }