[MachineScheduler] Fix physreg dependencies of ExitSU (#123541)
[llvm-project.git] / llvm / test / CodeGen / AMDGPU / memory-legalizer-fence.ll
blobebda33d01a438f6ba48454ab2a37e3f90a7d4370
1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -O0 -mcpu=gfx600 < %s | FileCheck --check-prefixes=GFX6 %s
3 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -O0 -mcpu=gfx700 < %s | FileCheck --check-prefixes=GFX7 %s
4 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -O0 -mcpu=gfx1010 < %s | FileCheck --check-prefixes=GFX10-WGP %s
5 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -O0 -mcpu=gfx1010 -mattr=+cumode < %s | FileCheck --check-prefixes=GFX10-CU %s
6 ; RUN: llc -mtriple=amdgcn-amd-amdpal -O0 -mcpu=gfx700 -amdgcn-skip-cache-invalidations < %s | FileCheck --check-prefixes=SKIP-CACHE-INV %s
7 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -O0 -mcpu=gfx90a < %s | FileCheck -check-prefixes=GFX90A-NOTTGSPLIT %s
8 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -O0 -mcpu=gfx90a -mattr=+tgsplit < %s | FileCheck -check-prefixes=GFX90A-TGSPLIT %s
9 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -O0 -mcpu=gfx940 < %s | FileCheck -check-prefixes=GFX940-NOTTGSPLIT %s
10 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -O0 -mcpu=gfx940 -mattr=+tgsplit < %s | FileCheck -check-prefixes=GFX940-TGSPLIT %s
11 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -O0 -mcpu=gfx1100 < %s | FileCheck --check-prefixes=GFX11-WGP %s
12 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -O0 -mcpu=gfx1100 -mattr=+cumode < %s | FileCheck --check-prefixes=GFX11-CU %s
13 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -O0 -mcpu=gfx1200 < %s | FileCheck --check-prefixes=GFX12-WGP %s
14 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -O0 -mcpu=gfx1200 -mattr=+cumode < %s | FileCheck --check-prefixes=GFX12-CU %s
16 define amdgpu_kernel void @singlethread_acquire_fence() {
17 ; GFX6-LABEL: singlethread_acquire_fence:
18 ; GFX6:       ; %bb.0: ; %entry
19 ; GFX6-NEXT:    s_endpgm
21 ; GFX7-LABEL: singlethread_acquire_fence:
22 ; GFX7:       ; %bb.0: ; %entry
23 ; GFX7-NEXT:    s_endpgm
25 ; GFX10-WGP-LABEL: singlethread_acquire_fence:
26 ; GFX10-WGP:       ; %bb.0: ; %entry
27 ; GFX10-WGP-NEXT:    s_endpgm
29 ; GFX10-CU-LABEL: singlethread_acquire_fence:
30 ; GFX10-CU:       ; %bb.0: ; %entry
31 ; GFX10-CU-NEXT:    s_endpgm
33 ; SKIP-CACHE-INV-LABEL: singlethread_acquire_fence:
34 ; SKIP-CACHE-INV:       ; %bb.0: ; %entry
35 ; SKIP-CACHE-INV-NEXT:    s_endpgm
37 ; GFX90A-NOTTGSPLIT-LABEL: singlethread_acquire_fence:
38 ; GFX90A-NOTTGSPLIT:       ; %bb.0: ; %entry
39 ; GFX90A-NOTTGSPLIT-NEXT:    s_endpgm
41 ; GFX90A-TGSPLIT-LABEL: singlethread_acquire_fence:
42 ; GFX90A-TGSPLIT:       ; %bb.0: ; %entry
43 ; GFX90A-TGSPLIT-NEXT:    s_endpgm
45 ; GFX940-NOTTGSPLIT-LABEL: singlethread_acquire_fence:
46 ; GFX940-NOTTGSPLIT:       ; %bb.0: ; %entry
47 ; GFX940-NOTTGSPLIT-NEXT:    s_endpgm
49 ; GFX940-TGSPLIT-LABEL: singlethread_acquire_fence:
50 ; GFX940-TGSPLIT:       ; %bb.0: ; %entry
51 ; GFX940-TGSPLIT-NEXT:    s_endpgm
53 ; GFX11-WGP-LABEL: singlethread_acquire_fence:
54 ; GFX11-WGP:       ; %bb.0: ; %entry
55 ; GFX11-WGP-NEXT:    s_endpgm
57 ; GFX11-CU-LABEL: singlethread_acquire_fence:
58 ; GFX11-CU:       ; %bb.0: ; %entry
59 ; GFX11-CU-NEXT:    s_endpgm
61 ; GFX12-WGP-LABEL: singlethread_acquire_fence:
62 ; GFX12-WGP:       ; %bb.0: ; %entry
63 ; GFX12-WGP-NEXT:    s_endpgm
65 ; GFX12-CU-LABEL: singlethread_acquire_fence:
66 ; GFX12-CU:       ; %bb.0: ; %entry
67 ; GFX12-CU-NEXT:    s_endpgm
68 entry:
69   fence syncscope("singlethread") acquire
70   ret void
73 define amdgpu_kernel void @singlethread_release_fence() {
74 ; GFX6-LABEL: singlethread_release_fence:
75 ; GFX6:       ; %bb.0: ; %entry
76 ; GFX6-NEXT:    s_endpgm
78 ; GFX7-LABEL: singlethread_release_fence:
79 ; GFX7:       ; %bb.0: ; %entry
80 ; GFX7-NEXT:    s_endpgm
82 ; GFX10-WGP-LABEL: singlethread_release_fence:
83 ; GFX10-WGP:       ; %bb.0: ; %entry
84 ; GFX10-WGP-NEXT:    s_endpgm
86 ; GFX10-CU-LABEL: singlethread_release_fence:
87 ; GFX10-CU:       ; %bb.0: ; %entry
88 ; GFX10-CU-NEXT:    s_endpgm
90 ; SKIP-CACHE-INV-LABEL: singlethread_release_fence:
91 ; SKIP-CACHE-INV:       ; %bb.0: ; %entry
92 ; SKIP-CACHE-INV-NEXT:    s_endpgm
94 ; GFX90A-NOTTGSPLIT-LABEL: singlethread_release_fence:
95 ; GFX90A-NOTTGSPLIT:       ; %bb.0: ; %entry
96 ; GFX90A-NOTTGSPLIT-NEXT:    s_endpgm
98 ; GFX90A-TGSPLIT-LABEL: singlethread_release_fence:
99 ; GFX90A-TGSPLIT:       ; %bb.0: ; %entry
100 ; GFX90A-TGSPLIT-NEXT:    s_endpgm
102 ; GFX940-NOTTGSPLIT-LABEL: singlethread_release_fence:
103 ; GFX940-NOTTGSPLIT:       ; %bb.0: ; %entry
104 ; GFX940-NOTTGSPLIT-NEXT:    s_endpgm
106 ; GFX940-TGSPLIT-LABEL: singlethread_release_fence:
107 ; GFX940-TGSPLIT:       ; %bb.0: ; %entry
108 ; GFX940-TGSPLIT-NEXT:    s_endpgm
110 ; GFX11-WGP-LABEL: singlethread_release_fence:
111 ; GFX11-WGP:       ; %bb.0: ; %entry
112 ; GFX11-WGP-NEXT:    s_endpgm
114 ; GFX11-CU-LABEL: singlethread_release_fence:
115 ; GFX11-CU:       ; %bb.0: ; %entry
116 ; GFX11-CU-NEXT:    s_endpgm
118 ; GFX12-WGP-LABEL: singlethread_release_fence:
119 ; GFX12-WGP:       ; %bb.0: ; %entry
120 ; GFX12-WGP-NEXT:    s_endpgm
122 ; GFX12-CU-LABEL: singlethread_release_fence:
123 ; GFX12-CU:       ; %bb.0: ; %entry
124 ; GFX12-CU-NEXT:    s_endpgm
125 entry:
126   fence syncscope("singlethread") release
127   ret void
130 define amdgpu_kernel void @singlethread_acq_rel_fence() {
131 ; GFX6-LABEL: singlethread_acq_rel_fence:
132 ; GFX6:       ; %bb.0: ; %entry
133 ; GFX6-NEXT:    s_endpgm
135 ; GFX7-LABEL: singlethread_acq_rel_fence:
136 ; GFX7:       ; %bb.0: ; %entry
137 ; GFX7-NEXT:    s_endpgm
139 ; GFX10-WGP-LABEL: singlethread_acq_rel_fence:
140 ; GFX10-WGP:       ; %bb.0: ; %entry
141 ; GFX10-WGP-NEXT:    s_endpgm
143 ; GFX10-CU-LABEL: singlethread_acq_rel_fence:
144 ; GFX10-CU:       ; %bb.0: ; %entry
145 ; GFX10-CU-NEXT:    s_endpgm
147 ; SKIP-CACHE-INV-LABEL: singlethread_acq_rel_fence:
148 ; SKIP-CACHE-INV:       ; %bb.0: ; %entry
149 ; SKIP-CACHE-INV-NEXT:    s_endpgm
151 ; GFX90A-NOTTGSPLIT-LABEL: singlethread_acq_rel_fence:
152 ; GFX90A-NOTTGSPLIT:       ; %bb.0: ; %entry
153 ; GFX90A-NOTTGSPLIT-NEXT:    s_endpgm
155 ; GFX90A-TGSPLIT-LABEL: singlethread_acq_rel_fence:
156 ; GFX90A-TGSPLIT:       ; %bb.0: ; %entry
157 ; GFX90A-TGSPLIT-NEXT:    s_endpgm
159 ; GFX940-NOTTGSPLIT-LABEL: singlethread_acq_rel_fence:
160 ; GFX940-NOTTGSPLIT:       ; %bb.0: ; %entry
161 ; GFX940-NOTTGSPLIT-NEXT:    s_endpgm
163 ; GFX940-TGSPLIT-LABEL: singlethread_acq_rel_fence:
164 ; GFX940-TGSPLIT:       ; %bb.0: ; %entry
165 ; GFX940-TGSPLIT-NEXT:    s_endpgm
167 ; GFX11-WGP-LABEL: singlethread_acq_rel_fence:
168 ; GFX11-WGP:       ; %bb.0: ; %entry
169 ; GFX11-WGP-NEXT:    s_endpgm
171 ; GFX11-CU-LABEL: singlethread_acq_rel_fence:
172 ; GFX11-CU:       ; %bb.0: ; %entry
173 ; GFX11-CU-NEXT:    s_endpgm
175 ; GFX12-WGP-LABEL: singlethread_acq_rel_fence:
176 ; GFX12-WGP:       ; %bb.0: ; %entry
177 ; GFX12-WGP-NEXT:    s_endpgm
179 ; GFX12-CU-LABEL: singlethread_acq_rel_fence:
180 ; GFX12-CU:       ; %bb.0: ; %entry
181 ; GFX12-CU-NEXT:    s_endpgm
182 entry:
183   fence syncscope("singlethread") acq_rel
184   ret void
187 define amdgpu_kernel void @singlethread_seq_cst_fence() {
188 ; GFX6-LABEL: singlethread_seq_cst_fence:
189 ; GFX6:       ; %bb.0: ; %entry
190 ; GFX6-NEXT:    s_endpgm
192 ; GFX7-LABEL: singlethread_seq_cst_fence:
193 ; GFX7:       ; %bb.0: ; %entry
194 ; GFX7-NEXT:    s_endpgm
196 ; GFX10-WGP-LABEL: singlethread_seq_cst_fence:
197 ; GFX10-WGP:       ; %bb.0: ; %entry
198 ; GFX10-WGP-NEXT:    s_endpgm
200 ; GFX10-CU-LABEL: singlethread_seq_cst_fence:
201 ; GFX10-CU:       ; %bb.0: ; %entry
202 ; GFX10-CU-NEXT:    s_endpgm
204 ; SKIP-CACHE-INV-LABEL: singlethread_seq_cst_fence:
205 ; SKIP-CACHE-INV:       ; %bb.0: ; %entry
206 ; SKIP-CACHE-INV-NEXT:    s_endpgm
208 ; GFX90A-NOTTGSPLIT-LABEL: singlethread_seq_cst_fence:
209 ; GFX90A-NOTTGSPLIT:       ; %bb.0: ; %entry
210 ; GFX90A-NOTTGSPLIT-NEXT:    s_endpgm
212 ; GFX90A-TGSPLIT-LABEL: singlethread_seq_cst_fence:
213 ; GFX90A-TGSPLIT:       ; %bb.0: ; %entry
214 ; GFX90A-TGSPLIT-NEXT:    s_endpgm
216 ; GFX940-NOTTGSPLIT-LABEL: singlethread_seq_cst_fence:
217 ; GFX940-NOTTGSPLIT:       ; %bb.0: ; %entry
218 ; GFX940-NOTTGSPLIT-NEXT:    s_endpgm
220 ; GFX940-TGSPLIT-LABEL: singlethread_seq_cst_fence:
221 ; GFX940-TGSPLIT:       ; %bb.0: ; %entry
222 ; GFX940-TGSPLIT-NEXT:    s_endpgm
224 ; GFX11-WGP-LABEL: singlethread_seq_cst_fence:
225 ; GFX11-WGP:       ; %bb.0: ; %entry
226 ; GFX11-WGP-NEXT:    s_endpgm
228 ; GFX11-CU-LABEL: singlethread_seq_cst_fence:
229 ; GFX11-CU:       ; %bb.0: ; %entry
230 ; GFX11-CU-NEXT:    s_endpgm
232 ; GFX12-WGP-LABEL: singlethread_seq_cst_fence:
233 ; GFX12-WGP:       ; %bb.0: ; %entry
234 ; GFX12-WGP-NEXT:    s_endpgm
236 ; GFX12-CU-LABEL: singlethread_seq_cst_fence:
237 ; GFX12-CU:       ; %bb.0: ; %entry
238 ; GFX12-CU-NEXT:    s_endpgm
239 entry:
240   fence syncscope("singlethread") seq_cst
241   ret void
244 define amdgpu_kernel void @singlethread_one_as_acquire_fence() {
245 ; GFX6-LABEL: singlethread_one_as_acquire_fence:
246 ; GFX6:       ; %bb.0: ; %entry
247 ; GFX6-NEXT:    s_endpgm
249 ; GFX7-LABEL: singlethread_one_as_acquire_fence:
250 ; GFX7:       ; %bb.0: ; %entry
251 ; GFX7-NEXT:    s_endpgm
253 ; GFX10-WGP-LABEL: singlethread_one_as_acquire_fence:
254 ; GFX10-WGP:       ; %bb.0: ; %entry
255 ; GFX10-WGP-NEXT:    s_endpgm
257 ; GFX10-CU-LABEL: singlethread_one_as_acquire_fence:
258 ; GFX10-CU:       ; %bb.0: ; %entry
259 ; GFX10-CU-NEXT:    s_endpgm
261 ; SKIP-CACHE-INV-LABEL: singlethread_one_as_acquire_fence:
262 ; SKIP-CACHE-INV:       ; %bb.0: ; %entry
263 ; SKIP-CACHE-INV-NEXT:    s_endpgm
265 ; GFX90A-NOTTGSPLIT-LABEL: singlethread_one_as_acquire_fence:
266 ; GFX90A-NOTTGSPLIT:       ; %bb.0: ; %entry
267 ; GFX90A-NOTTGSPLIT-NEXT:    s_endpgm
269 ; GFX90A-TGSPLIT-LABEL: singlethread_one_as_acquire_fence:
270 ; GFX90A-TGSPLIT:       ; %bb.0: ; %entry
271 ; GFX90A-TGSPLIT-NEXT:    s_endpgm
273 ; GFX940-NOTTGSPLIT-LABEL: singlethread_one_as_acquire_fence:
274 ; GFX940-NOTTGSPLIT:       ; %bb.0: ; %entry
275 ; GFX940-NOTTGSPLIT-NEXT:    s_endpgm
277 ; GFX940-TGSPLIT-LABEL: singlethread_one_as_acquire_fence:
278 ; GFX940-TGSPLIT:       ; %bb.0: ; %entry
279 ; GFX940-TGSPLIT-NEXT:    s_endpgm
281 ; GFX11-WGP-LABEL: singlethread_one_as_acquire_fence:
282 ; GFX11-WGP:       ; %bb.0: ; %entry
283 ; GFX11-WGP-NEXT:    s_endpgm
285 ; GFX11-CU-LABEL: singlethread_one_as_acquire_fence:
286 ; GFX11-CU:       ; %bb.0: ; %entry
287 ; GFX11-CU-NEXT:    s_endpgm
289 ; GFX12-WGP-LABEL: singlethread_one_as_acquire_fence:
290 ; GFX12-WGP:       ; %bb.0: ; %entry
291 ; GFX12-WGP-NEXT:    s_endpgm
293 ; GFX12-CU-LABEL: singlethread_one_as_acquire_fence:
294 ; GFX12-CU:       ; %bb.0: ; %entry
295 ; GFX12-CU-NEXT:    s_endpgm
296 entry:
297   fence syncscope("singlethread-one-as") acquire
298   ret void
301 define amdgpu_kernel void @singlethread_one_as_release_fence() {
302 ; GFX6-LABEL: singlethread_one_as_release_fence:
303 ; GFX6:       ; %bb.0: ; %entry
304 ; GFX6-NEXT:    s_endpgm
306 ; GFX7-LABEL: singlethread_one_as_release_fence:
307 ; GFX7:       ; %bb.0: ; %entry
308 ; GFX7-NEXT:    s_endpgm
310 ; GFX10-WGP-LABEL: singlethread_one_as_release_fence:
311 ; GFX10-WGP:       ; %bb.0: ; %entry
312 ; GFX10-WGP-NEXT:    s_endpgm
314 ; GFX10-CU-LABEL: singlethread_one_as_release_fence:
315 ; GFX10-CU:       ; %bb.0: ; %entry
316 ; GFX10-CU-NEXT:    s_endpgm
318 ; SKIP-CACHE-INV-LABEL: singlethread_one_as_release_fence:
319 ; SKIP-CACHE-INV:       ; %bb.0: ; %entry
320 ; SKIP-CACHE-INV-NEXT:    s_endpgm
322 ; GFX90A-NOTTGSPLIT-LABEL: singlethread_one_as_release_fence:
323 ; GFX90A-NOTTGSPLIT:       ; %bb.0: ; %entry
324 ; GFX90A-NOTTGSPLIT-NEXT:    s_endpgm
326 ; GFX90A-TGSPLIT-LABEL: singlethread_one_as_release_fence:
327 ; GFX90A-TGSPLIT:       ; %bb.0: ; %entry
328 ; GFX90A-TGSPLIT-NEXT:    s_endpgm
330 ; GFX940-NOTTGSPLIT-LABEL: singlethread_one_as_release_fence:
331 ; GFX940-NOTTGSPLIT:       ; %bb.0: ; %entry
332 ; GFX940-NOTTGSPLIT-NEXT:    s_endpgm
334 ; GFX940-TGSPLIT-LABEL: singlethread_one_as_release_fence:
335 ; GFX940-TGSPLIT:       ; %bb.0: ; %entry
336 ; GFX940-TGSPLIT-NEXT:    s_endpgm
338 ; GFX11-WGP-LABEL: singlethread_one_as_release_fence:
339 ; GFX11-WGP:       ; %bb.0: ; %entry
340 ; GFX11-WGP-NEXT:    s_endpgm
342 ; GFX11-CU-LABEL: singlethread_one_as_release_fence:
343 ; GFX11-CU:       ; %bb.0: ; %entry
344 ; GFX11-CU-NEXT:    s_endpgm
346 ; GFX12-WGP-LABEL: singlethread_one_as_release_fence:
347 ; GFX12-WGP:       ; %bb.0: ; %entry
348 ; GFX12-WGP-NEXT:    s_endpgm
350 ; GFX12-CU-LABEL: singlethread_one_as_release_fence:
351 ; GFX12-CU:       ; %bb.0: ; %entry
352 ; GFX12-CU-NEXT:    s_endpgm
353 entry:
354   fence syncscope("singlethread-one-as") release
355   ret void
358 define amdgpu_kernel void @singlethread_one_as_acq_rel_fence() {
359 ; GFX6-LABEL: singlethread_one_as_acq_rel_fence:
360 ; GFX6:       ; %bb.0: ; %entry
361 ; GFX6-NEXT:    s_endpgm
363 ; GFX7-LABEL: singlethread_one_as_acq_rel_fence:
364 ; GFX7:       ; %bb.0: ; %entry
365 ; GFX7-NEXT:    s_endpgm
367 ; GFX10-WGP-LABEL: singlethread_one_as_acq_rel_fence:
368 ; GFX10-WGP:       ; %bb.0: ; %entry
369 ; GFX10-WGP-NEXT:    s_endpgm
371 ; GFX10-CU-LABEL: singlethread_one_as_acq_rel_fence:
372 ; GFX10-CU:       ; %bb.0: ; %entry
373 ; GFX10-CU-NEXT:    s_endpgm
375 ; SKIP-CACHE-INV-LABEL: singlethread_one_as_acq_rel_fence:
376 ; SKIP-CACHE-INV:       ; %bb.0: ; %entry
377 ; SKIP-CACHE-INV-NEXT:    s_endpgm
379 ; GFX90A-NOTTGSPLIT-LABEL: singlethread_one_as_acq_rel_fence:
380 ; GFX90A-NOTTGSPLIT:       ; %bb.0: ; %entry
381 ; GFX90A-NOTTGSPLIT-NEXT:    s_endpgm
383 ; GFX90A-TGSPLIT-LABEL: singlethread_one_as_acq_rel_fence:
384 ; GFX90A-TGSPLIT:       ; %bb.0: ; %entry
385 ; GFX90A-TGSPLIT-NEXT:    s_endpgm
387 ; GFX940-NOTTGSPLIT-LABEL: singlethread_one_as_acq_rel_fence:
388 ; GFX940-NOTTGSPLIT:       ; %bb.0: ; %entry
389 ; GFX940-NOTTGSPLIT-NEXT:    s_endpgm
391 ; GFX940-TGSPLIT-LABEL: singlethread_one_as_acq_rel_fence:
392 ; GFX940-TGSPLIT:       ; %bb.0: ; %entry
393 ; GFX940-TGSPLIT-NEXT:    s_endpgm
395 ; GFX11-WGP-LABEL: singlethread_one_as_acq_rel_fence:
396 ; GFX11-WGP:       ; %bb.0: ; %entry
397 ; GFX11-WGP-NEXT:    s_endpgm
399 ; GFX11-CU-LABEL: singlethread_one_as_acq_rel_fence:
400 ; GFX11-CU:       ; %bb.0: ; %entry
401 ; GFX11-CU-NEXT:    s_endpgm
403 ; GFX12-WGP-LABEL: singlethread_one_as_acq_rel_fence:
404 ; GFX12-WGP:       ; %bb.0: ; %entry
405 ; GFX12-WGP-NEXT:    s_endpgm
407 ; GFX12-CU-LABEL: singlethread_one_as_acq_rel_fence:
408 ; GFX12-CU:       ; %bb.0: ; %entry
409 ; GFX12-CU-NEXT:    s_endpgm
410 entry:
411   fence syncscope("singlethread-one-as") acq_rel
412   ret void
415 define amdgpu_kernel void @singlethread_one_as_seq_cst_fence() {
416 ; GFX6-LABEL: singlethread_one_as_seq_cst_fence:
417 ; GFX6:       ; %bb.0: ; %entry
418 ; GFX6-NEXT:    s_endpgm
420 ; GFX7-LABEL: singlethread_one_as_seq_cst_fence:
421 ; GFX7:       ; %bb.0: ; %entry
422 ; GFX7-NEXT:    s_endpgm
424 ; GFX10-WGP-LABEL: singlethread_one_as_seq_cst_fence:
425 ; GFX10-WGP:       ; %bb.0: ; %entry
426 ; GFX10-WGP-NEXT:    s_endpgm
428 ; GFX10-CU-LABEL: singlethread_one_as_seq_cst_fence:
429 ; GFX10-CU:       ; %bb.0: ; %entry
430 ; GFX10-CU-NEXT:    s_endpgm
432 ; SKIP-CACHE-INV-LABEL: singlethread_one_as_seq_cst_fence:
433 ; SKIP-CACHE-INV:       ; %bb.0: ; %entry
434 ; SKIP-CACHE-INV-NEXT:    s_endpgm
436 ; GFX90A-NOTTGSPLIT-LABEL: singlethread_one_as_seq_cst_fence:
437 ; GFX90A-NOTTGSPLIT:       ; %bb.0: ; %entry
438 ; GFX90A-NOTTGSPLIT-NEXT:    s_endpgm
440 ; GFX90A-TGSPLIT-LABEL: singlethread_one_as_seq_cst_fence:
441 ; GFX90A-TGSPLIT:       ; %bb.0: ; %entry
442 ; GFX90A-TGSPLIT-NEXT:    s_endpgm
444 ; GFX940-NOTTGSPLIT-LABEL: singlethread_one_as_seq_cst_fence:
445 ; GFX940-NOTTGSPLIT:       ; %bb.0: ; %entry
446 ; GFX940-NOTTGSPLIT-NEXT:    s_endpgm
448 ; GFX940-TGSPLIT-LABEL: singlethread_one_as_seq_cst_fence:
449 ; GFX940-TGSPLIT:       ; %bb.0: ; %entry
450 ; GFX940-TGSPLIT-NEXT:    s_endpgm
452 ; GFX11-WGP-LABEL: singlethread_one_as_seq_cst_fence:
453 ; GFX11-WGP:       ; %bb.0: ; %entry
454 ; GFX11-WGP-NEXT:    s_endpgm
456 ; GFX11-CU-LABEL: singlethread_one_as_seq_cst_fence:
457 ; GFX11-CU:       ; %bb.0: ; %entry
458 ; GFX11-CU-NEXT:    s_endpgm
460 ; GFX12-WGP-LABEL: singlethread_one_as_seq_cst_fence:
461 ; GFX12-WGP:       ; %bb.0: ; %entry
462 ; GFX12-WGP-NEXT:    s_endpgm
464 ; GFX12-CU-LABEL: singlethread_one_as_seq_cst_fence:
465 ; GFX12-CU:       ; %bb.0: ; %entry
466 ; GFX12-CU-NEXT:    s_endpgm
467 entry:
468   fence syncscope("singlethread-one-as") seq_cst
469   ret void
472 define amdgpu_kernel void @wavefront_acquire_fence() {
473 ; GFX6-LABEL: wavefront_acquire_fence:
474 ; GFX6:       ; %bb.0: ; %entry
475 ; GFX6-NEXT:    s_endpgm
477 ; GFX7-LABEL: wavefront_acquire_fence:
478 ; GFX7:       ; %bb.0: ; %entry
479 ; GFX7-NEXT:    s_endpgm
481 ; GFX10-WGP-LABEL: wavefront_acquire_fence:
482 ; GFX10-WGP:       ; %bb.0: ; %entry
483 ; GFX10-WGP-NEXT:    s_endpgm
485 ; GFX10-CU-LABEL: wavefront_acquire_fence:
486 ; GFX10-CU:       ; %bb.0: ; %entry
487 ; GFX10-CU-NEXT:    s_endpgm
489 ; SKIP-CACHE-INV-LABEL: wavefront_acquire_fence:
490 ; SKIP-CACHE-INV:       ; %bb.0: ; %entry
491 ; SKIP-CACHE-INV-NEXT:    s_endpgm
493 ; GFX90A-NOTTGSPLIT-LABEL: wavefront_acquire_fence:
494 ; GFX90A-NOTTGSPLIT:       ; %bb.0: ; %entry
495 ; GFX90A-NOTTGSPLIT-NEXT:    s_endpgm
497 ; GFX90A-TGSPLIT-LABEL: wavefront_acquire_fence:
498 ; GFX90A-TGSPLIT:       ; %bb.0: ; %entry
499 ; GFX90A-TGSPLIT-NEXT:    s_endpgm
501 ; GFX940-NOTTGSPLIT-LABEL: wavefront_acquire_fence:
502 ; GFX940-NOTTGSPLIT:       ; %bb.0: ; %entry
503 ; GFX940-NOTTGSPLIT-NEXT:    s_endpgm
505 ; GFX940-TGSPLIT-LABEL: wavefront_acquire_fence:
506 ; GFX940-TGSPLIT:       ; %bb.0: ; %entry
507 ; GFX940-TGSPLIT-NEXT:    s_endpgm
509 ; GFX11-WGP-LABEL: wavefront_acquire_fence:
510 ; GFX11-WGP:       ; %bb.0: ; %entry
511 ; GFX11-WGP-NEXT:    s_endpgm
513 ; GFX11-CU-LABEL: wavefront_acquire_fence:
514 ; GFX11-CU:       ; %bb.0: ; %entry
515 ; GFX11-CU-NEXT:    s_endpgm
517 ; GFX12-WGP-LABEL: wavefront_acquire_fence:
518 ; GFX12-WGP:       ; %bb.0: ; %entry
519 ; GFX12-WGP-NEXT:    s_endpgm
521 ; GFX12-CU-LABEL: wavefront_acquire_fence:
522 ; GFX12-CU:       ; %bb.0: ; %entry
523 ; GFX12-CU-NEXT:    s_endpgm
524 entry:
525   fence syncscope("wavefront") acquire
526   ret void
529 define amdgpu_kernel void @wavefront_release_fence() {
530 ; GFX6-LABEL: wavefront_release_fence:
531 ; GFX6:       ; %bb.0: ; %entry
532 ; GFX6-NEXT:    s_endpgm
534 ; GFX7-LABEL: wavefront_release_fence:
535 ; GFX7:       ; %bb.0: ; %entry
536 ; GFX7-NEXT:    s_endpgm
538 ; GFX10-WGP-LABEL: wavefront_release_fence:
539 ; GFX10-WGP:       ; %bb.0: ; %entry
540 ; GFX10-WGP-NEXT:    s_endpgm
542 ; GFX10-CU-LABEL: wavefront_release_fence:
543 ; GFX10-CU:       ; %bb.0: ; %entry
544 ; GFX10-CU-NEXT:    s_endpgm
546 ; SKIP-CACHE-INV-LABEL: wavefront_release_fence:
547 ; SKIP-CACHE-INV:       ; %bb.0: ; %entry
548 ; SKIP-CACHE-INV-NEXT:    s_endpgm
550 ; GFX90A-NOTTGSPLIT-LABEL: wavefront_release_fence:
551 ; GFX90A-NOTTGSPLIT:       ; %bb.0: ; %entry
552 ; GFX90A-NOTTGSPLIT-NEXT:    s_endpgm
554 ; GFX90A-TGSPLIT-LABEL: wavefront_release_fence:
555 ; GFX90A-TGSPLIT:       ; %bb.0: ; %entry
556 ; GFX90A-TGSPLIT-NEXT:    s_endpgm
558 ; GFX940-NOTTGSPLIT-LABEL: wavefront_release_fence:
559 ; GFX940-NOTTGSPLIT:       ; %bb.0: ; %entry
560 ; GFX940-NOTTGSPLIT-NEXT:    s_endpgm
562 ; GFX940-TGSPLIT-LABEL: wavefront_release_fence:
563 ; GFX940-TGSPLIT:       ; %bb.0: ; %entry
564 ; GFX940-TGSPLIT-NEXT:    s_endpgm
566 ; GFX11-WGP-LABEL: wavefront_release_fence:
567 ; GFX11-WGP:       ; %bb.0: ; %entry
568 ; GFX11-WGP-NEXT:    s_endpgm
570 ; GFX11-CU-LABEL: wavefront_release_fence:
571 ; GFX11-CU:       ; %bb.0: ; %entry
572 ; GFX11-CU-NEXT:    s_endpgm
574 ; GFX12-WGP-LABEL: wavefront_release_fence:
575 ; GFX12-WGP:       ; %bb.0: ; %entry
576 ; GFX12-WGP-NEXT:    s_endpgm
578 ; GFX12-CU-LABEL: wavefront_release_fence:
579 ; GFX12-CU:       ; %bb.0: ; %entry
580 ; GFX12-CU-NEXT:    s_endpgm
581 entry:
582   fence syncscope("wavefront") release
583   ret void
586 define amdgpu_kernel void @wavefront_acq_rel_fence() {
587 ; GFX6-LABEL: wavefront_acq_rel_fence:
588 ; GFX6:       ; %bb.0: ; %entry
589 ; GFX6-NEXT:    s_endpgm
591 ; GFX7-LABEL: wavefront_acq_rel_fence:
592 ; GFX7:       ; %bb.0: ; %entry
593 ; GFX7-NEXT:    s_endpgm
595 ; GFX10-WGP-LABEL: wavefront_acq_rel_fence:
596 ; GFX10-WGP:       ; %bb.0: ; %entry
597 ; GFX10-WGP-NEXT:    s_endpgm
599 ; GFX10-CU-LABEL: wavefront_acq_rel_fence:
600 ; GFX10-CU:       ; %bb.0: ; %entry
601 ; GFX10-CU-NEXT:    s_endpgm
603 ; SKIP-CACHE-INV-LABEL: wavefront_acq_rel_fence:
604 ; SKIP-CACHE-INV:       ; %bb.0: ; %entry
605 ; SKIP-CACHE-INV-NEXT:    s_endpgm
607 ; GFX90A-NOTTGSPLIT-LABEL: wavefront_acq_rel_fence:
608 ; GFX90A-NOTTGSPLIT:       ; %bb.0: ; %entry
609 ; GFX90A-NOTTGSPLIT-NEXT:    s_endpgm
611 ; GFX90A-TGSPLIT-LABEL: wavefront_acq_rel_fence:
612 ; GFX90A-TGSPLIT:       ; %bb.0: ; %entry
613 ; GFX90A-TGSPLIT-NEXT:    s_endpgm
615 ; GFX940-NOTTGSPLIT-LABEL: wavefront_acq_rel_fence:
616 ; GFX940-NOTTGSPLIT:       ; %bb.0: ; %entry
617 ; GFX940-NOTTGSPLIT-NEXT:    s_endpgm
619 ; GFX940-TGSPLIT-LABEL: wavefront_acq_rel_fence:
620 ; GFX940-TGSPLIT:       ; %bb.0: ; %entry
621 ; GFX940-TGSPLIT-NEXT:    s_endpgm
623 ; GFX11-WGP-LABEL: wavefront_acq_rel_fence:
624 ; GFX11-WGP:       ; %bb.0: ; %entry
625 ; GFX11-WGP-NEXT:    s_endpgm
627 ; GFX11-CU-LABEL: wavefront_acq_rel_fence:
628 ; GFX11-CU:       ; %bb.0: ; %entry
629 ; GFX11-CU-NEXT:    s_endpgm
631 ; GFX12-WGP-LABEL: wavefront_acq_rel_fence:
632 ; GFX12-WGP:       ; %bb.0: ; %entry
633 ; GFX12-WGP-NEXT:    s_endpgm
635 ; GFX12-CU-LABEL: wavefront_acq_rel_fence:
636 ; GFX12-CU:       ; %bb.0: ; %entry
637 ; GFX12-CU-NEXT:    s_endpgm
638 entry:
639   fence syncscope("wavefront") acq_rel
640   ret void
643 define amdgpu_kernel void @wavefront_seq_cst_fence() {
644 ; GFX6-LABEL: wavefront_seq_cst_fence:
645 ; GFX6:       ; %bb.0: ; %entry
646 ; GFX6-NEXT:    s_endpgm
648 ; GFX7-LABEL: wavefront_seq_cst_fence:
649 ; GFX7:       ; %bb.0: ; %entry
650 ; GFX7-NEXT:    s_endpgm
652 ; GFX10-WGP-LABEL: wavefront_seq_cst_fence:
653 ; GFX10-WGP:       ; %bb.0: ; %entry
654 ; GFX10-WGP-NEXT:    s_endpgm
656 ; GFX10-CU-LABEL: wavefront_seq_cst_fence:
657 ; GFX10-CU:       ; %bb.0: ; %entry
658 ; GFX10-CU-NEXT:    s_endpgm
660 ; SKIP-CACHE-INV-LABEL: wavefront_seq_cst_fence:
661 ; SKIP-CACHE-INV:       ; %bb.0: ; %entry
662 ; SKIP-CACHE-INV-NEXT:    s_endpgm
664 ; GFX90A-NOTTGSPLIT-LABEL: wavefront_seq_cst_fence:
665 ; GFX90A-NOTTGSPLIT:       ; %bb.0: ; %entry
666 ; GFX90A-NOTTGSPLIT-NEXT:    s_endpgm
668 ; GFX90A-TGSPLIT-LABEL: wavefront_seq_cst_fence:
669 ; GFX90A-TGSPLIT:       ; %bb.0: ; %entry
670 ; GFX90A-TGSPLIT-NEXT:    s_endpgm
672 ; GFX940-NOTTGSPLIT-LABEL: wavefront_seq_cst_fence:
673 ; GFX940-NOTTGSPLIT:       ; %bb.0: ; %entry
674 ; GFX940-NOTTGSPLIT-NEXT:    s_endpgm
676 ; GFX940-TGSPLIT-LABEL: wavefront_seq_cst_fence:
677 ; GFX940-TGSPLIT:       ; %bb.0: ; %entry
678 ; GFX940-TGSPLIT-NEXT:    s_endpgm
680 ; GFX11-WGP-LABEL: wavefront_seq_cst_fence:
681 ; GFX11-WGP:       ; %bb.0: ; %entry
682 ; GFX11-WGP-NEXT:    s_endpgm
684 ; GFX11-CU-LABEL: wavefront_seq_cst_fence:
685 ; GFX11-CU:       ; %bb.0: ; %entry
686 ; GFX11-CU-NEXT:    s_endpgm
688 ; GFX12-WGP-LABEL: wavefront_seq_cst_fence:
689 ; GFX12-WGP:       ; %bb.0: ; %entry
690 ; GFX12-WGP-NEXT:    s_endpgm
692 ; GFX12-CU-LABEL: wavefront_seq_cst_fence:
693 ; GFX12-CU:       ; %bb.0: ; %entry
694 ; GFX12-CU-NEXT:    s_endpgm
695 entry:
696   fence syncscope("wavefront") seq_cst
697   ret void
700 define amdgpu_kernel void @wavefront_one_as_acquire_fence() {
701 ; GFX6-LABEL: wavefront_one_as_acquire_fence:
702 ; GFX6:       ; %bb.0: ; %entry
703 ; GFX6-NEXT:    s_endpgm
705 ; GFX7-LABEL: wavefront_one_as_acquire_fence:
706 ; GFX7:       ; %bb.0: ; %entry
707 ; GFX7-NEXT:    s_endpgm
709 ; GFX10-WGP-LABEL: wavefront_one_as_acquire_fence:
710 ; GFX10-WGP:       ; %bb.0: ; %entry
711 ; GFX10-WGP-NEXT:    s_endpgm
713 ; GFX10-CU-LABEL: wavefront_one_as_acquire_fence:
714 ; GFX10-CU:       ; %bb.0: ; %entry
715 ; GFX10-CU-NEXT:    s_endpgm
717 ; SKIP-CACHE-INV-LABEL: wavefront_one_as_acquire_fence:
718 ; SKIP-CACHE-INV:       ; %bb.0: ; %entry
719 ; SKIP-CACHE-INV-NEXT:    s_endpgm
721 ; GFX90A-NOTTGSPLIT-LABEL: wavefront_one_as_acquire_fence:
722 ; GFX90A-NOTTGSPLIT:       ; %bb.0: ; %entry
723 ; GFX90A-NOTTGSPLIT-NEXT:    s_endpgm
725 ; GFX90A-TGSPLIT-LABEL: wavefront_one_as_acquire_fence:
726 ; GFX90A-TGSPLIT:       ; %bb.0: ; %entry
727 ; GFX90A-TGSPLIT-NEXT:    s_endpgm
729 ; GFX940-NOTTGSPLIT-LABEL: wavefront_one_as_acquire_fence:
730 ; GFX940-NOTTGSPLIT:       ; %bb.0: ; %entry
731 ; GFX940-NOTTGSPLIT-NEXT:    s_endpgm
733 ; GFX940-TGSPLIT-LABEL: wavefront_one_as_acquire_fence:
734 ; GFX940-TGSPLIT:       ; %bb.0: ; %entry
735 ; GFX940-TGSPLIT-NEXT:    s_endpgm
737 ; GFX11-WGP-LABEL: wavefront_one_as_acquire_fence:
738 ; GFX11-WGP:       ; %bb.0: ; %entry
739 ; GFX11-WGP-NEXT:    s_endpgm
741 ; GFX11-CU-LABEL: wavefront_one_as_acquire_fence:
742 ; GFX11-CU:       ; %bb.0: ; %entry
743 ; GFX11-CU-NEXT:    s_endpgm
745 ; GFX12-WGP-LABEL: wavefront_one_as_acquire_fence:
746 ; GFX12-WGP:       ; %bb.0: ; %entry
747 ; GFX12-WGP-NEXT:    s_endpgm
749 ; GFX12-CU-LABEL: wavefront_one_as_acquire_fence:
750 ; GFX12-CU:       ; %bb.0: ; %entry
751 ; GFX12-CU-NEXT:    s_endpgm
752 entry:
753   fence syncscope("wavefront-one-as") acquire
754   ret void
757 define amdgpu_kernel void @wavefront_one_as_release_fence() {
758 ; GFX6-LABEL: wavefront_one_as_release_fence:
759 ; GFX6:       ; %bb.0: ; %entry
760 ; GFX6-NEXT:    s_endpgm
762 ; GFX7-LABEL: wavefront_one_as_release_fence:
763 ; GFX7:       ; %bb.0: ; %entry
764 ; GFX7-NEXT:    s_endpgm
766 ; GFX10-WGP-LABEL: wavefront_one_as_release_fence:
767 ; GFX10-WGP:       ; %bb.0: ; %entry
768 ; GFX10-WGP-NEXT:    s_endpgm
770 ; GFX10-CU-LABEL: wavefront_one_as_release_fence:
771 ; GFX10-CU:       ; %bb.0: ; %entry
772 ; GFX10-CU-NEXT:    s_endpgm
774 ; SKIP-CACHE-INV-LABEL: wavefront_one_as_release_fence:
775 ; SKIP-CACHE-INV:       ; %bb.0: ; %entry
776 ; SKIP-CACHE-INV-NEXT:    s_endpgm
778 ; GFX90A-NOTTGSPLIT-LABEL: wavefront_one_as_release_fence:
779 ; GFX90A-NOTTGSPLIT:       ; %bb.0: ; %entry
780 ; GFX90A-NOTTGSPLIT-NEXT:    s_endpgm
782 ; GFX90A-TGSPLIT-LABEL: wavefront_one_as_release_fence:
783 ; GFX90A-TGSPLIT:       ; %bb.0: ; %entry
784 ; GFX90A-TGSPLIT-NEXT:    s_endpgm
786 ; GFX940-NOTTGSPLIT-LABEL: wavefront_one_as_release_fence:
787 ; GFX940-NOTTGSPLIT:       ; %bb.0: ; %entry
788 ; GFX940-NOTTGSPLIT-NEXT:    s_endpgm
790 ; GFX940-TGSPLIT-LABEL: wavefront_one_as_release_fence:
791 ; GFX940-TGSPLIT:       ; %bb.0: ; %entry
792 ; GFX940-TGSPLIT-NEXT:    s_endpgm
794 ; GFX11-WGP-LABEL: wavefront_one_as_release_fence:
795 ; GFX11-WGP:       ; %bb.0: ; %entry
796 ; GFX11-WGP-NEXT:    s_endpgm
798 ; GFX11-CU-LABEL: wavefront_one_as_release_fence:
799 ; GFX11-CU:       ; %bb.0: ; %entry
800 ; GFX11-CU-NEXT:    s_endpgm
802 ; GFX12-WGP-LABEL: wavefront_one_as_release_fence:
803 ; GFX12-WGP:       ; %bb.0: ; %entry
804 ; GFX12-WGP-NEXT:    s_endpgm
806 ; GFX12-CU-LABEL: wavefront_one_as_release_fence:
807 ; GFX12-CU:       ; %bb.0: ; %entry
808 ; GFX12-CU-NEXT:    s_endpgm
809 entry:
810   fence syncscope("wavefront-one-as") release
811   ret void
814 define amdgpu_kernel void @wavefront_one_as_acq_rel_fence() {
815 ; GFX6-LABEL: wavefront_one_as_acq_rel_fence:
816 ; GFX6:       ; %bb.0: ; %entry
817 ; GFX6-NEXT:    s_endpgm
819 ; GFX7-LABEL: wavefront_one_as_acq_rel_fence:
820 ; GFX7:       ; %bb.0: ; %entry
821 ; GFX7-NEXT:    s_endpgm
823 ; GFX10-WGP-LABEL: wavefront_one_as_acq_rel_fence:
824 ; GFX10-WGP:       ; %bb.0: ; %entry
825 ; GFX10-WGP-NEXT:    s_endpgm
827 ; GFX10-CU-LABEL: wavefront_one_as_acq_rel_fence:
828 ; GFX10-CU:       ; %bb.0: ; %entry
829 ; GFX10-CU-NEXT:    s_endpgm
831 ; SKIP-CACHE-INV-LABEL: wavefront_one_as_acq_rel_fence:
832 ; SKIP-CACHE-INV:       ; %bb.0: ; %entry
833 ; SKIP-CACHE-INV-NEXT:    s_endpgm
835 ; GFX90A-NOTTGSPLIT-LABEL: wavefront_one_as_acq_rel_fence:
836 ; GFX90A-NOTTGSPLIT:       ; %bb.0: ; %entry
837 ; GFX90A-NOTTGSPLIT-NEXT:    s_endpgm
839 ; GFX90A-TGSPLIT-LABEL: wavefront_one_as_acq_rel_fence:
840 ; GFX90A-TGSPLIT:       ; %bb.0: ; %entry
841 ; GFX90A-TGSPLIT-NEXT:    s_endpgm
843 ; GFX940-NOTTGSPLIT-LABEL: wavefront_one_as_acq_rel_fence:
844 ; GFX940-NOTTGSPLIT:       ; %bb.0: ; %entry
845 ; GFX940-NOTTGSPLIT-NEXT:    s_endpgm
847 ; GFX940-TGSPLIT-LABEL: wavefront_one_as_acq_rel_fence:
848 ; GFX940-TGSPLIT:       ; %bb.0: ; %entry
849 ; GFX940-TGSPLIT-NEXT:    s_endpgm
851 ; GFX11-WGP-LABEL: wavefront_one_as_acq_rel_fence:
852 ; GFX11-WGP:       ; %bb.0: ; %entry
853 ; GFX11-WGP-NEXT:    s_endpgm
855 ; GFX11-CU-LABEL: wavefront_one_as_acq_rel_fence:
856 ; GFX11-CU:       ; %bb.0: ; %entry
857 ; GFX11-CU-NEXT:    s_endpgm
859 ; GFX12-WGP-LABEL: wavefront_one_as_acq_rel_fence:
860 ; GFX12-WGP:       ; %bb.0: ; %entry
861 ; GFX12-WGP-NEXT:    s_endpgm
863 ; GFX12-CU-LABEL: wavefront_one_as_acq_rel_fence:
864 ; GFX12-CU:       ; %bb.0: ; %entry
865 ; GFX12-CU-NEXT:    s_endpgm
866 entry:
867   fence syncscope("wavefront-one-as") acq_rel
868   ret void
871 define amdgpu_kernel void @wavefront_one_as_seq_cst_fence() {
872 ; GFX6-LABEL: wavefront_one_as_seq_cst_fence:
873 ; GFX6:       ; %bb.0: ; %entry
874 ; GFX6-NEXT:    s_endpgm
876 ; GFX7-LABEL: wavefront_one_as_seq_cst_fence:
877 ; GFX7:       ; %bb.0: ; %entry
878 ; GFX7-NEXT:    s_endpgm
880 ; GFX10-WGP-LABEL: wavefront_one_as_seq_cst_fence:
881 ; GFX10-WGP:       ; %bb.0: ; %entry
882 ; GFX10-WGP-NEXT:    s_endpgm
884 ; GFX10-CU-LABEL: wavefront_one_as_seq_cst_fence:
885 ; GFX10-CU:       ; %bb.0: ; %entry
886 ; GFX10-CU-NEXT:    s_endpgm
888 ; SKIP-CACHE-INV-LABEL: wavefront_one_as_seq_cst_fence:
889 ; SKIP-CACHE-INV:       ; %bb.0: ; %entry
890 ; SKIP-CACHE-INV-NEXT:    s_endpgm
892 ; GFX90A-NOTTGSPLIT-LABEL: wavefront_one_as_seq_cst_fence:
893 ; GFX90A-NOTTGSPLIT:       ; %bb.0: ; %entry
894 ; GFX90A-NOTTGSPLIT-NEXT:    s_endpgm
896 ; GFX90A-TGSPLIT-LABEL: wavefront_one_as_seq_cst_fence:
897 ; GFX90A-TGSPLIT:       ; %bb.0: ; %entry
898 ; GFX90A-TGSPLIT-NEXT:    s_endpgm
900 ; GFX940-NOTTGSPLIT-LABEL: wavefront_one_as_seq_cst_fence:
901 ; GFX940-NOTTGSPLIT:       ; %bb.0: ; %entry
902 ; GFX940-NOTTGSPLIT-NEXT:    s_endpgm
904 ; GFX940-TGSPLIT-LABEL: wavefront_one_as_seq_cst_fence:
905 ; GFX940-TGSPLIT:       ; %bb.0: ; %entry
906 ; GFX940-TGSPLIT-NEXT:    s_endpgm
908 ; GFX11-WGP-LABEL: wavefront_one_as_seq_cst_fence:
909 ; GFX11-WGP:       ; %bb.0: ; %entry
910 ; GFX11-WGP-NEXT:    s_endpgm
912 ; GFX11-CU-LABEL: wavefront_one_as_seq_cst_fence:
913 ; GFX11-CU:       ; %bb.0: ; %entry
914 ; GFX11-CU-NEXT:    s_endpgm
916 ; GFX12-WGP-LABEL: wavefront_one_as_seq_cst_fence:
917 ; GFX12-WGP:       ; %bb.0: ; %entry
918 ; GFX12-WGP-NEXT:    s_endpgm
920 ; GFX12-CU-LABEL: wavefront_one_as_seq_cst_fence:
921 ; GFX12-CU:       ; %bb.0: ; %entry
922 ; GFX12-CU-NEXT:    s_endpgm
923 entry:
924   fence syncscope("wavefront-one-as") seq_cst
925   ret void
928 define amdgpu_kernel void @workgroup_acquire_fence() {
929 ; GFX6-LABEL: workgroup_acquire_fence:
930 ; GFX6:       ; %bb.0: ; %entry
931 ; GFX6-NEXT:    s_waitcnt lgkmcnt(0)
932 ; GFX6-NEXT:    s_endpgm
934 ; GFX7-LABEL: workgroup_acquire_fence:
935 ; GFX7:       ; %bb.0: ; %entry
936 ; GFX7-NEXT:    s_waitcnt lgkmcnt(0)
937 ; GFX7-NEXT:    s_endpgm
939 ; GFX10-WGP-LABEL: workgroup_acquire_fence:
940 ; GFX10-WGP:       ; %bb.0: ; %entry
941 ; GFX10-WGP-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
942 ; GFX10-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
943 ; GFX10-WGP-NEXT:    buffer_gl0_inv
944 ; GFX10-WGP-NEXT:    s_endpgm
946 ; GFX10-CU-LABEL: workgroup_acquire_fence:
947 ; GFX10-CU:       ; %bb.0: ; %entry
948 ; GFX10-CU-NEXT:    s_waitcnt lgkmcnt(0)
949 ; GFX10-CU-NEXT:    s_endpgm
951 ; SKIP-CACHE-INV-LABEL: workgroup_acquire_fence:
952 ; SKIP-CACHE-INV:       ; %bb.0: ; %entry
953 ; SKIP-CACHE-INV-NEXT:    s_waitcnt lgkmcnt(0)
954 ; SKIP-CACHE-INV-NEXT:    s_endpgm
956 ; GFX90A-NOTTGSPLIT-LABEL: workgroup_acquire_fence:
957 ; GFX90A-NOTTGSPLIT:       ; %bb.0: ; %entry
958 ; GFX90A-NOTTGSPLIT-NEXT:    s_waitcnt lgkmcnt(0)
959 ; GFX90A-NOTTGSPLIT-NEXT:    s_endpgm
961 ; GFX90A-TGSPLIT-LABEL: workgroup_acquire_fence:
962 ; GFX90A-TGSPLIT:       ; %bb.0: ; %entry
963 ; GFX90A-TGSPLIT-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
964 ; GFX90A-TGSPLIT-NEXT:    buffer_wbinvl1_vol
965 ; GFX90A-TGSPLIT-NEXT:    s_endpgm
967 ; GFX940-NOTTGSPLIT-LABEL: workgroup_acquire_fence:
968 ; GFX940-NOTTGSPLIT:       ; %bb.0: ; %entry
969 ; GFX940-NOTTGSPLIT-NEXT:    s_waitcnt lgkmcnt(0)
970 ; GFX940-NOTTGSPLIT-NEXT:    s_endpgm
972 ; GFX940-TGSPLIT-LABEL: workgroup_acquire_fence:
973 ; GFX940-TGSPLIT:       ; %bb.0: ; %entry
974 ; GFX940-TGSPLIT-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
975 ; GFX940-TGSPLIT-NEXT:    buffer_inv sc0
976 ; GFX940-TGSPLIT-NEXT:    s_endpgm
978 ; GFX11-WGP-LABEL: workgroup_acquire_fence:
979 ; GFX11-WGP:       ; %bb.0: ; %entry
980 ; GFX11-WGP-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
981 ; GFX11-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
982 ; GFX11-WGP-NEXT:    buffer_gl0_inv
983 ; GFX11-WGP-NEXT:    s_endpgm
985 ; GFX11-CU-LABEL: workgroup_acquire_fence:
986 ; GFX11-CU:       ; %bb.0: ; %entry
987 ; GFX11-CU-NEXT:    s_waitcnt lgkmcnt(0)
988 ; GFX11-CU-NEXT:    s_endpgm
990 ; GFX12-WGP-LABEL: workgroup_acquire_fence:
991 ; GFX12-WGP:       ; %bb.0: ; %entry
992 ; GFX12-WGP-NEXT:    s_wait_storecnt 0x0
993 ; GFX12-WGP-NEXT:    s_wait_loadcnt_dscnt 0x0
994 ; GFX12-WGP-NEXT:    global_inv scope:SCOPE_SE
995 ; GFX12-WGP-NEXT:    s_endpgm
997 ; GFX12-CU-LABEL: workgroup_acquire_fence:
998 ; GFX12-CU:       ; %bb.0: ; %entry
999 ; GFX12-CU-NEXT:    s_wait_dscnt 0x0
1000 ; GFX12-CU-NEXT:    s_endpgm
1001 entry:
1002   fence syncscope("workgroup") acquire
1003   ret void
1006 define amdgpu_kernel void @workgroup_release_fence() {
1007 ; GFX6-LABEL: workgroup_release_fence:
1008 ; GFX6:       ; %bb.0: ; %entry
1009 ; GFX6-NEXT:    s_waitcnt lgkmcnt(0)
1010 ; GFX6-NEXT:    s_endpgm
1012 ; GFX7-LABEL: workgroup_release_fence:
1013 ; GFX7:       ; %bb.0: ; %entry
1014 ; GFX7-NEXT:    s_waitcnt lgkmcnt(0)
1015 ; GFX7-NEXT:    s_endpgm
1017 ; GFX10-WGP-LABEL: workgroup_release_fence:
1018 ; GFX10-WGP:       ; %bb.0: ; %entry
1019 ; GFX10-WGP-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1020 ; GFX10-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
1021 ; GFX10-WGP-NEXT:    s_endpgm
1023 ; GFX10-CU-LABEL: workgroup_release_fence:
1024 ; GFX10-CU:       ; %bb.0: ; %entry
1025 ; GFX10-CU-NEXT:    s_waitcnt lgkmcnt(0)
1026 ; GFX10-CU-NEXT:    s_endpgm
1028 ; SKIP-CACHE-INV-LABEL: workgroup_release_fence:
1029 ; SKIP-CACHE-INV:       ; %bb.0: ; %entry
1030 ; SKIP-CACHE-INV-NEXT:    s_waitcnt lgkmcnt(0)
1031 ; SKIP-CACHE-INV-NEXT:    s_endpgm
1033 ; GFX90A-NOTTGSPLIT-LABEL: workgroup_release_fence:
1034 ; GFX90A-NOTTGSPLIT:       ; %bb.0: ; %entry
1035 ; GFX90A-NOTTGSPLIT-NEXT:    s_waitcnt lgkmcnt(0)
1036 ; GFX90A-NOTTGSPLIT-NEXT:    s_endpgm
1038 ; GFX90A-TGSPLIT-LABEL: workgroup_release_fence:
1039 ; GFX90A-TGSPLIT:       ; %bb.0: ; %entry
1040 ; GFX90A-TGSPLIT-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1041 ; GFX90A-TGSPLIT-NEXT:    s_endpgm
1043 ; GFX940-NOTTGSPLIT-LABEL: workgroup_release_fence:
1044 ; GFX940-NOTTGSPLIT:       ; %bb.0: ; %entry
1045 ; GFX940-NOTTGSPLIT-NEXT:    s_waitcnt lgkmcnt(0)
1046 ; GFX940-NOTTGSPLIT-NEXT:    s_endpgm
1048 ; GFX940-TGSPLIT-LABEL: workgroup_release_fence:
1049 ; GFX940-TGSPLIT:       ; %bb.0: ; %entry
1050 ; GFX940-TGSPLIT-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1051 ; GFX940-TGSPLIT-NEXT:    s_endpgm
1053 ; GFX11-WGP-LABEL: workgroup_release_fence:
1054 ; GFX11-WGP:       ; %bb.0: ; %entry
1055 ; GFX11-WGP-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1056 ; GFX11-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
1057 ; GFX11-WGP-NEXT:    s_endpgm
1059 ; GFX11-CU-LABEL: workgroup_release_fence:
1060 ; GFX11-CU:       ; %bb.0: ; %entry
1061 ; GFX11-CU-NEXT:    s_waitcnt lgkmcnt(0)
1062 ; GFX11-CU-NEXT:    s_endpgm
1064 ; GFX12-WGP-LABEL: workgroup_release_fence:
1065 ; GFX12-WGP:       ; %bb.0: ; %entry
1066 ; GFX12-WGP-NEXT:    s_wait_bvhcnt 0x0
1067 ; GFX12-WGP-NEXT:    s_wait_samplecnt 0x0
1068 ; GFX12-WGP-NEXT:    s_wait_storecnt 0x0
1069 ; GFX12-WGP-NEXT:    s_wait_loadcnt_dscnt 0x0
1070 ; GFX12-WGP-NEXT:    s_endpgm
1072 ; GFX12-CU-LABEL: workgroup_release_fence:
1073 ; GFX12-CU:       ; %bb.0: ; %entry
1074 ; GFX12-CU-NEXT:    s_wait_dscnt 0x0
1075 ; GFX12-CU-NEXT:    s_endpgm
1076 entry:
1077   fence syncscope("workgroup") release
1078   ret void
1081 define amdgpu_kernel void @workgroup_acq_rel_fence() {
1082 ; GFX6-LABEL: workgroup_acq_rel_fence:
1083 ; GFX6:       ; %bb.0: ; %entry
1084 ; GFX6-NEXT:    s_waitcnt lgkmcnt(0)
1085 ; GFX6-NEXT:    s_endpgm
1087 ; GFX7-LABEL: workgroup_acq_rel_fence:
1088 ; GFX7:       ; %bb.0: ; %entry
1089 ; GFX7-NEXT:    s_waitcnt lgkmcnt(0)
1090 ; GFX7-NEXT:    s_endpgm
1092 ; GFX10-WGP-LABEL: workgroup_acq_rel_fence:
1093 ; GFX10-WGP:       ; %bb.0: ; %entry
1094 ; GFX10-WGP-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1095 ; GFX10-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
1096 ; GFX10-WGP-NEXT:    buffer_gl0_inv
1097 ; GFX10-WGP-NEXT:    s_endpgm
1099 ; GFX10-CU-LABEL: workgroup_acq_rel_fence:
1100 ; GFX10-CU:       ; %bb.0: ; %entry
1101 ; GFX10-CU-NEXT:    s_waitcnt lgkmcnt(0)
1102 ; GFX10-CU-NEXT:    s_endpgm
1104 ; SKIP-CACHE-INV-LABEL: workgroup_acq_rel_fence:
1105 ; SKIP-CACHE-INV:       ; %bb.0: ; %entry
1106 ; SKIP-CACHE-INV-NEXT:    s_waitcnt lgkmcnt(0)
1107 ; SKIP-CACHE-INV-NEXT:    s_endpgm
1109 ; GFX90A-NOTTGSPLIT-LABEL: workgroup_acq_rel_fence:
1110 ; GFX90A-NOTTGSPLIT:       ; %bb.0: ; %entry
1111 ; GFX90A-NOTTGSPLIT-NEXT:    s_waitcnt lgkmcnt(0)
1112 ; GFX90A-NOTTGSPLIT-NEXT:    s_endpgm
1114 ; GFX90A-TGSPLIT-LABEL: workgroup_acq_rel_fence:
1115 ; GFX90A-TGSPLIT:       ; %bb.0: ; %entry
1116 ; GFX90A-TGSPLIT-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1117 ; GFX90A-TGSPLIT-NEXT:    buffer_wbinvl1_vol
1118 ; GFX90A-TGSPLIT-NEXT:    s_endpgm
1120 ; GFX940-NOTTGSPLIT-LABEL: workgroup_acq_rel_fence:
1121 ; GFX940-NOTTGSPLIT:       ; %bb.0: ; %entry
1122 ; GFX940-NOTTGSPLIT-NEXT:    s_waitcnt lgkmcnt(0)
1123 ; GFX940-NOTTGSPLIT-NEXT:    s_endpgm
1125 ; GFX940-TGSPLIT-LABEL: workgroup_acq_rel_fence:
1126 ; GFX940-TGSPLIT:       ; %bb.0: ; %entry
1127 ; GFX940-TGSPLIT-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1128 ; GFX940-TGSPLIT-NEXT:    buffer_inv sc0
1129 ; GFX940-TGSPLIT-NEXT:    s_endpgm
1131 ; GFX11-WGP-LABEL: workgroup_acq_rel_fence:
1132 ; GFX11-WGP:       ; %bb.0: ; %entry
1133 ; GFX11-WGP-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1134 ; GFX11-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
1135 ; GFX11-WGP-NEXT:    buffer_gl0_inv
1136 ; GFX11-WGP-NEXT:    s_endpgm
1138 ; GFX11-CU-LABEL: workgroup_acq_rel_fence:
1139 ; GFX11-CU:       ; %bb.0: ; %entry
1140 ; GFX11-CU-NEXT:    s_waitcnt lgkmcnt(0)
1141 ; GFX11-CU-NEXT:    s_endpgm
1143 ; GFX12-WGP-LABEL: workgroup_acq_rel_fence:
1144 ; GFX12-WGP:       ; %bb.0: ; %entry
1145 ; GFX12-WGP-NEXT:    s_wait_bvhcnt 0x0
1146 ; GFX12-WGP-NEXT:    s_wait_samplecnt 0x0
1147 ; GFX12-WGP-NEXT:    s_wait_storecnt 0x0
1148 ; GFX12-WGP-NEXT:    s_wait_loadcnt_dscnt 0x0
1149 ; GFX12-WGP-NEXT:    global_inv scope:SCOPE_SE
1150 ; GFX12-WGP-NEXT:    s_endpgm
1152 ; GFX12-CU-LABEL: workgroup_acq_rel_fence:
1153 ; GFX12-CU:       ; %bb.0: ; %entry
1154 ; GFX12-CU-NEXT:    s_wait_dscnt 0x0
1155 ; GFX12-CU-NEXT:    s_endpgm
1156 entry:
1157   fence syncscope("workgroup") acq_rel
1158   ret void
1161 define amdgpu_kernel void @workgroup_seq_cst_fence() {
1162 ; GFX6-LABEL: workgroup_seq_cst_fence:
1163 ; GFX6:       ; %bb.0: ; %entry
1164 ; GFX6-NEXT:    s_waitcnt lgkmcnt(0)
1165 ; GFX6-NEXT:    s_endpgm
1167 ; GFX7-LABEL: workgroup_seq_cst_fence:
1168 ; GFX7:       ; %bb.0: ; %entry
1169 ; GFX7-NEXT:    s_waitcnt lgkmcnt(0)
1170 ; GFX7-NEXT:    s_endpgm
1172 ; GFX10-WGP-LABEL: workgroup_seq_cst_fence:
1173 ; GFX10-WGP:       ; %bb.0: ; %entry
1174 ; GFX10-WGP-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1175 ; GFX10-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
1176 ; GFX10-WGP-NEXT:    buffer_gl0_inv
1177 ; GFX10-WGP-NEXT:    s_endpgm
1179 ; GFX10-CU-LABEL: workgroup_seq_cst_fence:
1180 ; GFX10-CU:       ; %bb.0: ; %entry
1181 ; GFX10-CU-NEXT:    s_waitcnt lgkmcnt(0)
1182 ; GFX10-CU-NEXT:    s_endpgm
1184 ; SKIP-CACHE-INV-LABEL: workgroup_seq_cst_fence:
1185 ; SKIP-CACHE-INV:       ; %bb.0: ; %entry
1186 ; SKIP-CACHE-INV-NEXT:    s_waitcnt lgkmcnt(0)
1187 ; SKIP-CACHE-INV-NEXT:    s_endpgm
1189 ; GFX90A-NOTTGSPLIT-LABEL: workgroup_seq_cst_fence:
1190 ; GFX90A-NOTTGSPLIT:       ; %bb.0: ; %entry
1191 ; GFX90A-NOTTGSPLIT-NEXT:    s_waitcnt lgkmcnt(0)
1192 ; GFX90A-NOTTGSPLIT-NEXT:    s_endpgm
1194 ; GFX90A-TGSPLIT-LABEL: workgroup_seq_cst_fence:
1195 ; GFX90A-TGSPLIT:       ; %bb.0: ; %entry
1196 ; GFX90A-TGSPLIT-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1197 ; GFX90A-TGSPLIT-NEXT:    buffer_wbinvl1_vol
1198 ; GFX90A-TGSPLIT-NEXT:    s_endpgm
1200 ; GFX940-NOTTGSPLIT-LABEL: workgroup_seq_cst_fence:
1201 ; GFX940-NOTTGSPLIT:       ; %bb.0: ; %entry
1202 ; GFX940-NOTTGSPLIT-NEXT:    s_waitcnt lgkmcnt(0)
1203 ; GFX940-NOTTGSPLIT-NEXT:    s_endpgm
1205 ; GFX940-TGSPLIT-LABEL: workgroup_seq_cst_fence:
1206 ; GFX940-TGSPLIT:       ; %bb.0: ; %entry
1207 ; GFX940-TGSPLIT-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1208 ; GFX940-TGSPLIT-NEXT:    buffer_inv sc0
1209 ; GFX940-TGSPLIT-NEXT:    s_endpgm
1211 ; GFX11-WGP-LABEL: workgroup_seq_cst_fence:
1212 ; GFX11-WGP:       ; %bb.0: ; %entry
1213 ; GFX11-WGP-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1214 ; GFX11-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
1215 ; GFX11-WGP-NEXT:    buffer_gl0_inv
1216 ; GFX11-WGP-NEXT:    s_endpgm
1218 ; GFX11-CU-LABEL: workgroup_seq_cst_fence:
1219 ; GFX11-CU:       ; %bb.0: ; %entry
1220 ; GFX11-CU-NEXT:    s_waitcnt lgkmcnt(0)
1221 ; GFX11-CU-NEXT:    s_endpgm
1223 ; GFX12-WGP-LABEL: workgroup_seq_cst_fence:
1224 ; GFX12-WGP:       ; %bb.0: ; %entry
1225 ; GFX12-WGP-NEXT:    s_wait_bvhcnt 0x0
1226 ; GFX12-WGP-NEXT:    s_wait_samplecnt 0x0
1227 ; GFX12-WGP-NEXT:    s_wait_storecnt 0x0
1228 ; GFX12-WGP-NEXT:    s_wait_loadcnt_dscnt 0x0
1229 ; GFX12-WGP-NEXT:    global_inv scope:SCOPE_SE
1230 ; GFX12-WGP-NEXT:    s_endpgm
1232 ; GFX12-CU-LABEL: workgroup_seq_cst_fence:
1233 ; GFX12-CU:       ; %bb.0: ; %entry
1234 ; GFX12-CU-NEXT:    s_wait_dscnt 0x0
1235 ; GFX12-CU-NEXT:    s_endpgm
1236 entry:
1237   fence syncscope("workgroup") seq_cst
1238   ret void
1241 define amdgpu_kernel void @workgroup_one_as_acquire_fence() {
1242 ; GFX6-LABEL: workgroup_one_as_acquire_fence:
1243 ; GFX6:       ; %bb.0: ; %entry
1244 ; GFX6-NEXT:    s_endpgm
1246 ; GFX7-LABEL: workgroup_one_as_acquire_fence:
1247 ; GFX7:       ; %bb.0: ; %entry
1248 ; GFX7-NEXT:    s_endpgm
1250 ; GFX10-WGP-LABEL: workgroup_one_as_acquire_fence:
1251 ; GFX10-WGP:       ; %bb.0: ; %entry
1252 ; GFX10-WGP-NEXT:    s_waitcnt vmcnt(0)
1253 ; GFX10-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
1254 ; GFX10-WGP-NEXT:    buffer_gl0_inv
1255 ; GFX10-WGP-NEXT:    s_endpgm
1257 ; GFX10-CU-LABEL: workgroup_one_as_acquire_fence:
1258 ; GFX10-CU:       ; %bb.0: ; %entry
1259 ; GFX10-CU-NEXT:    s_endpgm
1261 ; SKIP-CACHE-INV-LABEL: workgroup_one_as_acquire_fence:
1262 ; SKIP-CACHE-INV:       ; %bb.0: ; %entry
1263 ; SKIP-CACHE-INV-NEXT:    s_endpgm
1265 ; GFX90A-NOTTGSPLIT-LABEL: workgroup_one_as_acquire_fence:
1266 ; GFX90A-NOTTGSPLIT:       ; %bb.0: ; %entry
1267 ; GFX90A-NOTTGSPLIT-NEXT:    s_endpgm
1269 ; GFX90A-TGSPLIT-LABEL: workgroup_one_as_acquire_fence:
1270 ; GFX90A-TGSPLIT:       ; %bb.0: ; %entry
1271 ; GFX90A-TGSPLIT-NEXT:    s_waitcnt vmcnt(0)
1272 ; GFX90A-TGSPLIT-NEXT:    buffer_wbinvl1_vol
1273 ; GFX90A-TGSPLIT-NEXT:    s_endpgm
1275 ; GFX940-NOTTGSPLIT-LABEL: workgroup_one_as_acquire_fence:
1276 ; GFX940-NOTTGSPLIT:       ; %bb.0: ; %entry
1277 ; GFX940-NOTTGSPLIT-NEXT:    s_endpgm
1279 ; GFX940-TGSPLIT-LABEL: workgroup_one_as_acquire_fence:
1280 ; GFX940-TGSPLIT:       ; %bb.0: ; %entry
1281 ; GFX940-TGSPLIT-NEXT:    s_waitcnt vmcnt(0)
1282 ; GFX940-TGSPLIT-NEXT:    buffer_inv sc0
1283 ; GFX940-TGSPLIT-NEXT:    s_endpgm
1285 ; GFX11-WGP-LABEL: workgroup_one_as_acquire_fence:
1286 ; GFX11-WGP:       ; %bb.0: ; %entry
1287 ; GFX11-WGP-NEXT:    s_waitcnt vmcnt(0)
1288 ; GFX11-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
1289 ; GFX11-WGP-NEXT:    buffer_gl0_inv
1290 ; GFX11-WGP-NEXT:    s_endpgm
1292 ; GFX11-CU-LABEL: workgroup_one_as_acquire_fence:
1293 ; GFX11-CU:       ; %bb.0: ; %entry
1294 ; GFX11-CU-NEXT:    s_endpgm
1296 ; GFX12-WGP-LABEL: workgroup_one_as_acquire_fence:
1297 ; GFX12-WGP:       ; %bb.0: ; %entry
1298 ; GFX12-WGP-NEXT:    s_wait_loadcnt 0x0
1299 ; GFX12-WGP-NEXT:    s_wait_storecnt 0x0
1300 ; GFX12-WGP-NEXT:    global_inv scope:SCOPE_SE
1301 ; GFX12-WGP-NEXT:    s_endpgm
1303 ; GFX12-CU-LABEL: workgroup_one_as_acquire_fence:
1304 ; GFX12-CU:       ; %bb.0: ; %entry
1305 ; GFX12-CU-NEXT:    s_endpgm
1306 entry:
1307   fence syncscope("workgroup-one-as") acquire
1308   ret void
1311 define amdgpu_kernel void @workgroup_one_as_release_fence() {
1312 ; GFX6-LABEL: workgroup_one_as_release_fence:
1313 ; GFX6:       ; %bb.0: ; %entry
1314 ; GFX6-NEXT:    s_endpgm
1316 ; GFX7-LABEL: workgroup_one_as_release_fence:
1317 ; GFX7:       ; %bb.0: ; %entry
1318 ; GFX7-NEXT:    s_endpgm
1320 ; GFX10-WGP-LABEL: workgroup_one_as_release_fence:
1321 ; GFX10-WGP:       ; %bb.0: ; %entry
1322 ; GFX10-WGP-NEXT:    s_waitcnt vmcnt(0)
1323 ; GFX10-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
1324 ; GFX10-WGP-NEXT:    s_endpgm
1326 ; GFX10-CU-LABEL: workgroup_one_as_release_fence:
1327 ; GFX10-CU:       ; %bb.0: ; %entry
1328 ; GFX10-CU-NEXT:    s_endpgm
1330 ; SKIP-CACHE-INV-LABEL: workgroup_one_as_release_fence:
1331 ; SKIP-CACHE-INV:       ; %bb.0: ; %entry
1332 ; SKIP-CACHE-INV-NEXT:    s_endpgm
1334 ; GFX90A-NOTTGSPLIT-LABEL: workgroup_one_as_release_fence:
1335 ; GFX90A-NOTTGSPLIT:       ; %bb.0: ; %entry
1336 ; GFX90A-NOTTGSPLIT-NEXT:    s_endpgm
1338 ; GFX90A-TGSPLIT-LABEL: workgroup_one_as_release_fence:
1339 ; GFX90A-TGSPLIT:       ; %bb.0: ; %entry
1340 ; GFX90A-TGSPLIT-NEXT:    s_waitcnt vmcnt(0)
1341 ; GFX90A-TGSPLIT-NEXT:    s_endpgm
1343 ; GFX940-NOTTGSPLIT-LABEL: workgroup_one_as_release_fence:
1344 ; GFX940-NOTTGSPLIT:       ; %bb.0: ; %entry
1345 ; GFX940-NOTTGSPLIT-NEXT:    s_endpgm
1347 ; GFX940-TGSPLIT-LABEL: workgroup_one_as_release_fence:
1348 ; GFX940-TGSPLIT:       ; %bb.0: ; %entry
1349 ; GFX940-TGSPLIT-NEXT:    s_waitcnt vmcnt(0)
1350 ; GFX940-TGSPLIT-NEXT:    s_endpgm
1352 ; GFX11-WGP-LABEL: workgroup_one_as_release_fence:
1353 ; GFX11-WGP:       ; %bb.0: ; %entry
1354 ; GFX11-WGP-NEXT:    s_waitcnt vmcnt(0)
1355 ; GFX11-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
1356 ; GFX11-WGP-NEXT:    s_endpgm
1358 ; GFX11-CU-LABEL: workgroup_one_as_release_fence:
1359 ; GFX11-CU:       ; %bb.0: ; %entry
1360 ; GFX11-CU-NEXT:    s_endpgm
1362 ; GFX12-WGP-LABEL: workgroup_one_as_release_fence:
1363 ; GFX12-WGP:       ; %bb.0: ; %entry
1364 ; GFX12-WGP-NEXT:    s_wait_bvhcnt 0x0
1365 ; GFX12-WGP-NEXT:    s_wait_samplecnt 0x0
1366 ; GFX12-WGP-NEXT:    s_wait_loadcnt 0x0
1367 ; GFX12-WGP-NEXT:    s_wait_storecnt 0x0
1368 ; GFX12-WGP-NEXT:    s_endpgm
1370 ; GFX12-CU-LABEL: workgroup_one_as_release_fence:
1371 ; GFX12-CU:       ; %bb.0: ; %entry
1372 ; GFX12-CU-NEXT:    s_endpgm
1373 entry:
1374   fence syncscope("workgroup-one-as") release
1375   ret void
1378 define amdgpu_kernel void @workgroup_one_as_acq_rel_fence() {
1379 ; GFX6-LABEL: workgroup_one_as_acq_rel_fence:
1380 ; GFX6:       ; %bb.0: ; %entry
1381 ; GFX6-NEXT:    s_endpgm
1383 ; GFX7-LABEL: workgroup_one_as_acq_rel_fence:
1384 ; GFX7:       ; %bb.0: ; %entry
1385 ; GFX7-NEXT:    s_endpgm
1387 ; GFX10-WGP-LABEL: workgroup_one_as_acq_rel_fence:
1388 ; GFX10-WGP:       ; %bb.0: ; %entry
1389 ; GFX10-WGP-NEXT:    s_waitcnt vmcnt(0)
1390 ; GFX10-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
1391 ; GFX10-WGP-NEXT:    buffer_gl0_inv
1392 ; GFX10-WGP-NEXT:    s_endpgm
1394 ; GFX10-CU-LABEL: workgroup_one_as_acq_rel_fence:
1395 ; GFX10-CU:       ; %bb.0: ; %entry
1396 ; GFX10-CU-NEXT:    s_endpgm
1398 ; SKIP-CACHE-INV-LABEL: workgroup_one_as_acq_rel_fence:
1399 ; SKIP-CACHE-INV:       ; %bb.0: ; %entry
1400 ; SKIP-CACHE-INV-NEXT:    s_endpgm
1402 ; GFX90A-NOTTGSPLIT-LABEL: workgroup_one_as_acq_rel_fence:
1403 ; GFX90A-NOTTGSPLIT:       ; %bb.0: ; %entry
1404 ; GFX90A-NOTTGSPLIT-NEXT:    s_endpgm
1406 ; GFX90A-TGSPLIT-LABEL: workgroup_one_as_acq_rel_fence:
1407 ; GFX90A-TGSPLIT:       ; %bb.0: ; %entry
1408 ; GFX90A-TGSPLIT-NEXT:    s_waitcnt vmcnt(0)
1409 ; GFX90A-TGSPLIT-NEXT:    buffer_wbinvl1_vol
1410 ; GFX90A-TGSPLIT-NEXT:    s_endpgm
1412 ; GFX940-NOTTGSPLIT-LABEL: workgroup_one_as_acq_rel_fence:
1413 ; GFX940-NOTTGSPLIT:       ; %bb.0: ; %entry
1414 ; GFX940-NOTTGSPLIT-NEXT:    s_endpgm
1416 ; GFX940-TGSPLIT-LABEL: workgroup_one_as_acq_rel_fence:
1417 ; GFX940-TGSPLIT:       ; %bb.0: ; %entry
1418 ; GFX940-TGSPLIT-NEXT:    s_waitcnt vmcnt(0)
1419 ; GFX940-TGSPLIT-NEXT:    buffer_inv sc0
1420 ; GFX940-TGSPLIT-NEXT:    s_endpgm
1422 ; GFX11-WGP-LABEL: workgroup_one_as_acq_rel_fence:
1423 ; GFX11-WGP:       ; %bb.0: ; %entry
1424 ; GFX11-WGP-NEXT:    s_waitcnt vmcnt(0)
1425 ; GFX11-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
1426 ; GFX11-WGP-NEXT:    buffer_gl0_inv
1427 ; GFX11-WGP-NEXT:    s_endpgm
1429 ; GFX11-CU-LABEL: workgroup_one_as_acq_rel_fence:
1430 ; GFX11-CU:       ; %bb.0: ; %entry
1431 ; GFX11-CU-NEXT:    s_endpgm
1433 ; GFX12-WGP-LABEL: workgroup_one_as_acq_rel_fence:
1434 ; GFX12-WGP:       ; %bb.0: ; %entry
1435 ; GFX12-WGP-NEXT:    s_wait_bvhcnt 0x0
1436 ; GFX12-WGP-NEXT:    s_wait_samplecnt 0x0
1437 ; GFX12-WGP-NEXT:    s_wait_loadcnt 0x0
1438 ; GFX12-WGP-NEXT:    s_wait_storecnt 0x0
1439 ; GFX12-WGP-NEXT:    global_inv scope:SCOPE_SE
1440 ; GFX12-WGP-NEXT:    s_endpgm
1442 ; GFX12-CU-LABEL: workgroup_one_as_acq_rel_fence:
1443 ; GFX12-CU:       ; %bb.0: ; %entry
1444 ; GFX12-CU-NEXT:    s_endpgm
1445 entry:
1446   fence syncscope("workgroup-one-as") acq_rel
1447   ret void
1450 define amdgpu_kernel void @workgroup_one_as_seq_cst_fence() {
1451 ; GFX6-LABEL: workgroup_one_as_seq_cst_fence:
1452 ; GFX6:       ; %bb.0: ; %entry
1453 ; GFX6-NEXT:    s_endpgm
1455 ; GFX7-LABEL: workgroup_one_as_seq_cst_fence:
1456 ; GFX7:       ; %bb.0: ; %entry
1457 ; GFX7-NEXT:    s_endpgm
1459 ; GFX10-WGP-LABEL: workgroup_one_as_seq_cst_fence:
1460 ; GFX10-WGP:       ; %bb.0: ; %entry
1461 ; GFX10-WGP-NEXT:    s_waitcnt vmcnt(0)
1462 ; GFX10-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
1463 ; GFX10-WGP-NEXT:    buffer_gl0_inv
1464 ; GFX10-WGP-NEXT:    s_endpgm
1466 ; GFX10-CU-LABEL: workgroup_one_as_seq_cst_fence:
1467 ; GFX10-CU:       ; %bb.0: ; %entry
1468 ; GFX10-CU-NEXT:    s_endpgm
1470 ; SKIP-CACHE-INV-LABEL: workgroup_one_as_seq_cst_fence:
1471 ; SKIP-CACHE-INV:       ; %bb.0: ; %entry
1472 ; SKIP-CACHE-INV-NEXT:    s_endpgm
1474 ; GFX90A-NOTTGSPLIT-LABEL: workgroup_one_as_seq_cst_fence:
1475 ; GFX90A-NOTTGSPLIT:       ; %bb.0: ; %entry
1476 ; GFX90A-NOTTGSPLIT-NEXT:    s_endpgm
1478 ; GFX90A-TGSPLIT-LABEL: workgroup_one_as_seq_cst_fence:
1479 ; GFX90A-TGSPLIT:       ; %bb.0: ; %entry
1480 ; GFX90A-TGSPLIT-NEXT:    s_waitcnt vmcnt(0)
1481 ; GFX90A-TGSPLIT-NEXT:    buffer_wbinvl1_vol
1482 ; GFX90A-TGSPLIT-NEXT:    s_endpgm
1484 ; GFX940-NOTTGSPLIT-LABEL: workgroup_one_as_seq_cst_fence:
1485 ; GFX940-NOTTGSPLIT:       ; %bb.0: ; %entry
1486 ; GFX940-NOTTGSPLIT-NEXT:    s_endpgm
1488 ; GFX940-TGSPLIT-LABEL: workgroup_one_as_seq_cst_fence:
1489 ; GFX940-TGSPLIT:       ; %bb.0: ; %entry
1490 ; GFX940-TGSPLIT-NEXT:    s_waitcnt vmcnt(0)
1491 ; GFX940-TGSPLIT-NEXT:    buffer_inv sc0
1492 ; GFX940-TGSPLIT-NEXT:    s_endpgm
1494 ; GFX11-WGP-LABEL: workgroup_one_as_seq_cst_fence:
1495 ; GFX11-WGP:       ; %bb.0: ; %entry
1496 ; GFX11-WGP-NEXT:    s_waitcnt vmcnt(0)
1497 ; GFX11-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
1498 ; GFX11-WGP-NEXT:    buffer_gl0_inv
1499 ; GFX11-WGP-NEXT:    s_endpgm
1501 ; GFX11-CU-LABEL: workgroup_one_as_seq_cst_fence:
1502 ; GFX11-CU:       ; %bb.0: ; %entry
1503 ; GFX11-CU-NEXT:    s_endpgm
1505 ; GFX12-WGP-LABEL: workgroup_one_as_seq_cst_fence:
1506 ; GFX12-WGP:       ; %bb.0: ; %entry
1507 ; GFX12-WGP-NEXT:    s_wait_bvhcnt 0x0
1508 ; GFX12-WGP-NEXT:    s_wait_samplecnt 0x0
1509 ; GFX12-WGP-NEXT:    s_wait_loadcnt 0x0
1510 ; GFX12-WGP-NEXT:    s_wait_storecnt 0x0
1511 ; GFX12-WGP-NEXT:    global_inv scope:SCOPE_SE
1512 ; GFX12-WGP-NEXT:    s_endpgm
1514 ; GFX12-CU-LABEL: workgroup_one_as_seq_cst_fence:
1515 ; GFX12-CU:       ; %bb.0: ; %entry
1516 ; GFX12-CU-NEXT:    s_endpgm
1517 entry:
1518   fence syncscope("workgroup-one-as") seq_cst
1519   ret void
1522 define amdgpu_kernel void @agent_acquire_fence() {
1523 ; GFX6-LABEL: agent_acquire_fence:
1524 ; GFX6:       ; %bb.0: ; %entry
1525 ; GFX6-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1526 ; GFX6-NEXT:    buffer_wbinvl1
1527 ; GFX6-NEXT:    s_endpgm
1529 ; GFX7-LABEL: agent_acquire_fence:
1530 ; GFX7:       ; %bb.0: ; %entry
1531 ; GFX7-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1532 ; GFX7-NEXT:    buffer_wbinvl1_vol
1533 ; GFX7-NEXT:    s_endpgm
1535 ; GFX10-WGP-LABEL: agent_acquire_fence:
1536 ; GFX10-WGP:       ; %bb.0: ; %entry
1537 ; GFX10-WGP-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1538 ; GFX10-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
1539 ; GFX10-WGP-NEXT:    buffer_gl1_inv
1540 ; GFX10-WGP-NEXT:    buffer_gl0_inv
1541 ; GFX10-WGP-NEXT:    s_endpgm
1543 ; GFX10-CU-LABEL: agent_acquire_fence:
1544 ; GFX10-CU:       ; %bb.0: ; %entry
1545 ; GFX10-CU-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1546 ; GFX10-CU-NEXT:    s_waitcnt_vscnt null, 0x0
1547 ; GFX10-CU-NEXT:    buffer_gl1_inv
1548 ; GFX10-CU-NEXT:    buffer_gl0_inv
1549 ; GFX10-CU-NEXT:    s_endpgm
1551 ; SKIP-CACHE-INV-LABEL: agent_acquire_fence:
1552 ; SKIP-CACHE-INV:       ; %bb.0: ; %entry
1553 ; SKIP-CACHE-INV-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1554 ; SKIP-CACHE-INV-NEXT:    s_endpgm
1556 ; GFX90A-NOTTGSPLIT-LABEL: agent_acquire_fence:
1557 ; GFX90A-NOTTGSPLIT:       ; %bb.0: ; %entry
1558 ; GFX90A-NOTTGSPLIT-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1559 ; GFX90A-NOTTGSPLIT-NEXT:    buffer_wbinvl1_vol
1560 ; GFX90A-NOTTGSPLIT-NEXT:    s_endpgm
1562 ; GFX90A-TGSPLIT-LABEL: agent_acquire_fence:
1563 ; GFX90A-TGSPLIT:       ; %bb.0: ; %entry
1564 ; GFX90A-TGSPLIT-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1565 ; GFX90A-TGSPLIT-NEXT:    buffer_wbinvl1_vol
1566 ; GFX90A-TGSPLIT-NEXT:    s_endpgm
1568 ; GFX940-NOTTGSPLIT-LABEL: agent_acquire_fence:
1569 ; GFX940-NOTTGSPLIT:       ; %bb.0: ; %entry
1570 ; GFX940-NOTTGSPLIT-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1571 ; GFX940-NOTTGSPLIT-NEXT:    buffer_inv sc1
1572 ; GFX940-NOTTGSPLIT-NEXT:    s_endpgm
1574 ; GFX940-TGSPLIT-LABEL: agent_acquire_fence:
1575 ; GFX940-TGSPLIT:       ; %bb.0: ; %entry
1576 ; GFX940-TGSPLIT-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1577 ; GFX940-TGSPLIT-NEXT:    buffer_inv sc1
1578 ; GFX940-TGSPLIT-NEXT:    s_endpgm
1580 ; GFX11-WGP-LABEL: agent_acquire_fence:
1581 ; GFX11-WGP:       ; %bb.0: ; %entry
1582 ; GFX11-WGP-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1583 ; GFX11-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
1584 ; GFX11-WGP-NEXT:    buffer_gl1_inv
1585 ; GFX11-WGP-NEXT:    buffer_gl0_inv
1586 ; GFX11-WGP-NEXT:    s_endpgm
1588 ; GFX11-CU-LABEL: agent_acquire_fence:
1589 ; GFX11-CU:       ; %bb.0: ; %entry
1590 ; GFX11-CU-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1591 ; GFX11-CU-NEXT:    s_waitcnt_vscnt null, 0x0
1592 ; GFX11-CU-NEXT:    buffer_gl1_inv
1593 ; GFX11-CU-NEXT:    buffer_gl0_inv
1594 ; GFX11-CU-NEXT:    s_endpgm
1596 ; GFX12-WGP-LABEL: agent_acquire_fence:
1597 ; GFX12-WGP:       ; %bb.0: ; %entry
1598 ; GFX12-WGP-NEXT:    s_wait_storecnt 0x0
1599 ; GFX12-WGP-NEXT:    s_wait_loadcnt_dscnt 0x0
1600 ; GFX12-WGP-NEXT:    global_inv scope:SCOPE_DEV
1601 ; GFX12-WGP-NEXT:    s_endpgm
1603 ; GFX12-CU-LABEL: agent_acquire_fence:
1604 ; GFX12-CU:       ; %bb.0: ; %entry
1605 ; GFX12-CU-NEXT:    s_wait_storecnt 0x0
1606 ; GFX12-CU-NEXT:    s_wait_loadcnt_dscnt 0x0
1607 ; GFX12-CU-NEXT:    global_inv scope:SCOPE_DEV
1608 ; GFX12-CU-NEXT:    s_endpgm
1609 entry:
1610   fence syncscope("agent") acquire
1611   ret void
1614 define amdgpu_kernel void @agent_release_fence() {
1615 ; GFX6-LABEL: agent_release_fence:
1616 ; GFX6:       ; %bb.0: ; %entry
1617 ; GFX6-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1618 ; GFX6-NEXT:    s_endpgm
1620 ; GFX7-LABEL: agent_release_fence:
1621 ; GFX7:       ; %bb.0: ; %entry
1622 ; GFX7-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1623 ; GFX7-NEXT:    s_endpgm
1625 ; GFX10-WGP-LABEL: agent_release_fence:
1626 ; GFX10-WGP:       ; %bb.0: ; %entry
1627 ; GFX10-WGP-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1628 ; GFX10-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
1629 ; GFX10-WGP-NEXT:    s_endpgm
1631 ; GFX10-CU-LABEL: agent_release_fence:
1632 ; GFX10-CU:       ; %bb.0: ; %entry
1633 ; GFX10-CU-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1634 ; GFX10-CU-NEXT:    s_waitcnt_vscnt null, 0x0
1635 ; GFX10-CU-NEXT:    s_endpgm
1637 ; SKIP-CACHE-INV-LABEL: agent_release_fence:
1638 ; SKIP-CACHE-INV:       ; %bb.0: ; %entry
1639 ; SKIP-CACHE-INV-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1640 ; SKIP-CACHE-INV-NEXT:    s_endpgm
1642 ; GFX90A-NOTTGSPLIT-LABEL: agent_release_fence:
1643 ; GFX90A-NOTTGSPLIT:       ; %bb.0: ; %entry
1644 ; GFX90A-NOTTGSPLIT-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1645 ; GFX90A-NOTTGSPLIT-NEXT:    s_endpgm
1647 ; GFX90A-TGSPLIT-LABEL: agent_release_fence:
1648 ; GFX90A-TGSPLIT:       ; %bb.0: ; %entry
1649 ; GFX90A-TGSPLIT-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1650 ; GFX90A-TGSPLIT-NEXT:    s_endpgm
1652 ; GFX940-NOTTGSPLIT-LABEL: agent_release_fence:
1653 ; GFX940-NOTTGSPLIT:       ; %bb.0: ; %entry
1654 ; GFX940-NOTTGSPLIT-NEXT:    buffer_wbl2 sc1
1655 ; GFX940-NOTTGSPLIT-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1656 ; GFX940-NOTTGSPLIT-NEXT:    s_endpgm
1658 ; GFX940-TGSPLIT-LABEL: agent_release_fence:
1659 ; GFX940-TGSPLIT:       ; %bb.0: ; %entry
1660 ; GFX940-TGSPLIT-NEXT:    buffer_wbl2 sc1
1661 ; GFX940-TGSPLIT-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1662 ; GFX940-TGSPLIT-NEXT:    s_endpgm
1664 ; GFX11-WGP-LABEL: agent_release_fence:
1665 ; GFX11-WGP:       ; %bb.0: ; %entry
1666 ; GFX11-WGP-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1667 ; GFX11-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
1668 ; GFX11-WGP-NEXT:    s_endpgm
1670 ; GFX11-CU-LABEL: agent_release_fence:
1671 ; GFX11-CU:       ; %bb.0: ; %entry
1672 ; GFX11-CU-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1673 ; GFX11-CU-NEXT:    s_waitcnt_vscnt null, 0x0
1674 ; GFX11-CU-NEXT:    s_endpgm
1676 ; GFX12-WGP-LABEL: agent_release_fence:
1677 ; GFX12-WGP:       ; %bb.0: ; %entry
1678 ; GFX12-WGP-NEXT:    s_wait_bvhcnt 0x0
1679 ; GFX12-WGP-NEXT:    s_wait_samplecnt 0x0
1680 ; GFX12-WGP-NEXT:    s_wait_storecnt 0x0
1681 ; GFX12-WGP-NEXT:    s_wait_loadcnt_dscnt 0x0
1682 ; GFX12-WGP-NEXT:    s_endpgm
1684 ; GFX12-CU-LABEL: agent_release_fence:
1685 ; GFX12-CU:       ; %bb.0: ; %entry
1686 ; GFX12-CU-NEXT:    s_wait_bvhcnt 0x0
1687 ; GFX12-CU-NEXT:    s_wait_samplecnt 0x0
1688 ; GFX12-CU-NEXT:    s_wait_storecnt 0x0
1689 ; GFX12-CU-NEXT:    s_wait_loadcnt_dscnt 0x0
1690 ; GFX12-CU-NEXT:    s_endpgm
1691 entry:
1692   fence syncscope("agent") release
1693   ret void
1696 define amdgpu_kernel void @agent_acq_rel_fence() {
1697 ; GFX6-LABEL: agent_acq_rel_fence:
1698 ; GFX6:       ; %bb.0: ; %entry
1699 ; GFX6-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1700 ; GFX6-NEXT:    buffer_wbinvl1
1701 ; GFX6-NEXT:    s_endpgm
1703 ; GFX7-LABEL: agent_acq_rel_fence:
1704 ; GFX7:       ; %bb.0: ; %entry
1705 ; GFX7-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1706 ; GFX7-NEXT:    buffer_wbinvl1_vol
1707 ; GFX7-NEXT:    s_endpgm
1709 ; GFX10-WGP-LABEL: agent_acq_rel_fence:
1710 ; GFX10-WGP:       ; %bb.0: ; %entry
1711 ; GFX10-WGP-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1712 ; GFX10-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
1713 ; GFX10-WGP-NEXT:    buffer_gl1_inv
1714 ; GFX10-WGP-NEXT:    buffer_gl0_inv
1715 ; GFX10-WGP-NEXT:    s_endpgm
1717 ; GFX10-CU-LABEL: agent_acq_rel_fence:
1718 ; GFX10-CU:       ; %bb.0: ; %entry
1719 ; GFX10-CU-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1720 ; GFX10-CU-NEXT:    s_waitcnt_vscnt null, 0x0
1721 ; GFX10-CU-NEXT:    buffer_gl1_inv
1722 ; GFX10-CU-NEXT:    buffer_gl0_inv
1723 ; GFX10-CU-NEXT:    s_endpgm
1725 ; SKIP-CACHE-INV-LABEL: agent_acq_rel_fence:
1726 ; SKIP-CACHE-INV:       ; %bb.0: ; %entry
1727 ; SKIP-CACHE-INV-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1728 ; SKIP-CACHE-INV-NEXT:    s_endpgm
1730 ; GFX90A-NOTTGSPLIT-LABEL: agent_acq_rel_fence:
1731 ; GFX90A-NOTTGSPLIT:       ; %bb.0: ; %entry
1732 ; GFX90A-NOTTGSPLIT-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1733 ; GFX90A-NOTTGSPLIT-NEXT:    buffer_wbinvl1_vol
1734 ; GFX90A-NOTTGSPLIT-NEXT:    s_endpgm
1736 ; GFX90A-TGSPLIT-LABEL: agent_acq_rel_fence:
1737 ; GFX90A-TGSPLIT:       ; %bb.0: ; %entry
1738 ; GFX90A-TGSPLIT-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1739 ; GFX90A-TGSPLIT-NEXT:    buffer_wbinvl1_vol
1740 ; GFX90A-TGSPLIT-NEXT:    s_endpgm
1742 ; GFX940-NOTTGSPLIT-LABEL: agent_acq_rel_fence:
1743 ; GFX940-NOTTGSPLIT:       ; %bb.0: ; %entry
1744 ; GFX940-NOTTGSPLIT-NEXT:    buffer_wbl2 sc1
1745 ; GFX940-NOTTGSPLIT-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1746 ; GFX940-NOTTGSPLIT-NEXT:    buffer_inv sc1
1747 ; GFX940-NOTTGSPLIT-NEXT:    s_endpgm
1749 ; GFX940-TGSPLIT-LABEL: agent_acq_rel_fence:
1750 ; GFX940-TGSPLIT:       ; %bb.0: ; %entry
1751 ; GFX940-TGSPLIT-NEXT:    buffer_wbl2 sc1
1752 ; GFX940-TGSPLIT-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1753 ; GFX940-TGSPLIT-NEXT:    buffer_inv sc1
1754 ; GFX940-TGSPLIT-NEXT:    s_endpgm
1756 ; GFX11-WGP-LABEL: agent_acq_rel_fence:
1757 ; GFX11-WGP:       ; %bb.0: ; %entry
1758 ; GFX11-WGP-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1759 ; GFX11-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
1760 ; GFX11-WGP-NEXT:    buffer_gl1_inv
1761 ; GFX11-WGP-NEXT:    buffer_gl0_inv
1762 ; GFX11-WGP-NEXT:    s_endpgm
1764 ; GFX11-CU-LABEL: agent_acq_rel_fence:
1765 ; GFX11-CU:       ; %bb.0: ; %entry
1766 ; GFX11-CU-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1767 ; GFX11-CU-NEXT:    s_waitcnt_vscnt null, 0x0
1768 ; GFX11-CU-NEXT:    buffer_gl1_inv
1769 ; GFX11-CU-NEXT:    buffer_gl0_inv
1770 ; GFX11-CU-NEXT:    s_endpgm
1772 ; GFX12-WGP-LABEL: agent_acq_rel_fence:
1773 ; GFX12-WGP:       ; %bb.0: ; %entry
1774 ; GFX12-WGP-NEXT:    s_wait_bvhcnt 0x0
1775 ; GFX12-WGP-NEXT:    s_wait_samplecnt 0x0
1776 ; GFX12-WGP-NEXT:    s_wait_storecnt 0x0
1777 ; GFX12-WGP-NEXT:    s_wait_loadcnt_dscnt 0x0
1778 ; GFX12-WGP-NEXT:    global_inv scope:SCOPE_DEV
1779 ; GFX12-WGP-NEXT:    s_endpgm
1781 ; GFX12-CU-LABEL: agent_acq_rel_fence:
1782 ; GFX12-CU:       ; %bb.0: ; %entry
1783 ; GFX12-CU-NEXT:    s_wait_bvhcnt 0x0
1784 ; GFX12-CU-NEXT:    s_wait_samplecnt 0x0
1785 ; GFX12-CU-NEXT:    s_wait_storecnt 0x0
1786 ; GFX12-CU-NEXT:    s_wait_loadcnt_dscnt 0x0
1787 ; GFX12-CU-NEXT:    global_inv scope:SCOPE_DEV
1788 ; GFX12-CU-NEXT:    s_endpgm
1789 entry:
1790   fence syncscope("agent") acq_rel
1791   ret void
1794 define amdgpu_kernel void @agent_seq_cst_fence() {
1795 ; GFX6-LABEL: agent_seq_cst_fence:
1796 ; GFX6:       ; %bb.0: ; %entry
1797 ; GFX6-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1798 ; GFX6-NEXT:    buffer_wbinvl1
1799 ; GFX6-NEXT:    s_endpgm
1801 ; GFX7-LABEL: agent_seq_cst_fence:
1802 ; GFX7:       ; %bb.0: ; %entry
1803 ; GFX7-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1804 ; GFX7-NEXT:    buffer_wbinvl1_vol
1805 ; GFX7-NEXT:    s_endpgm
1807 ; GFX10-WGP-LABEL: agent_seq_cst_fence:
1808 ; GFX10-WGP:       ; %bb.0: ; %entry
1809 ; GFX10-WGP-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1810 ; GFX10-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
1811 ; GFX10-WGP-NEXT:    buffer_gl1_inv
1812 ; GFX10-WGP-NEXT:    buffer_gl0_inv
1813 ; GFX10-WGP-NEXT:    s_endpgm
1815 ; GFX10-CU-LABEL: agent_seq_cst_fence:
1816 ; GFX10-CU:       ; %bb.0: ; %entry
1817 ; GFX10-CU-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1818 ; GFX10-CU-NEXT:    s_waitcnt_vscnt null, 0x0
1819 ; GFX10-CU-NEXT:    buffer_gl1_inv
1820 ; GFX10-CU-NEXT:    buffer_gl0_inv
1821 ; GFX10-CU-NEXT:    s_endpgm
1823 ; SKIP-CACHE-INV-LABEL: agent_seq_cst_fence:
1824 ; SKIP-CACHE-INV:       ; %bb.0: ; %entry
1825 ; SKIP-CACHE-INV-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1826 ; SKIP-CACHE-INV-NEXT:    s_endpgm
1828 ; GFX90A-NOTTGSPLIT-LABEL: agent_seq_cst_fence:
1829 ; GFX90A-NOTTGSPLIT:       ; %bb.0: ; %entry
1830 ; GFX90A-NOTTGSPLIT-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1831 ; GFX90A-NOTTGSPLIT-NEXT:    buffer_wbinvl1_vol
1832 ; GFX90A-NOTTGSPLIT-NEXT:    s_endpgm
1834 ; GFX90A-TGSPLIT-LABEL: agent_seq_cst_fence:
1835 ; GFX90A-TGSPLIT:       ; %bb.0: ; %entry
1836 ; GFX90A-TGSPLIT-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1837 ; GFX90A-TGSPLIT-NEXT:    buffer_wbinvl1_vol
1838 ; GFX90A-TGSPLIT-NEXT:    s_endpgm
1840 ; GFX940-NOTTGSPLIT-LABEL: agent_seq_cst_fence:
1841 ; GFX940-NOTTGSPLIT:       ; %bb.0: ; %entry
1842 ; GFX940-NOTTGSPLIT-NEXT:    buffer_wbl2 sc1
1843 ; GFX940-NOTTGSPLIT-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1844 ; GFX940-NOTTGSPLIT-NEXT:    buffer_inv sc1
1845 ; GFX940-NOTTGSPLIT-NEXT:    s_endpgm
1847 ; GFX940-TGSPLIT-LABEL: agent_seq_cst_fence:
1848 ; GFX940-TGSPLIT:       ; %bb.0: ; %entry
1849 ; GFX940-TGSPLIT-NEXT:    buffer_wbl2 sc1
1850 ; GFX940-TGSPLIT-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1851 ; GFX940-TGSPLIT-NEXT:    buffer_inv sc1
1852 ; GFX940-TGSPLIT-NEXT:    s_endpgm
1854 ; GFX11-WGP-LABEL: agent_seq_cst_fence:
1855 ; GFX11-WGP:       ; %bb.0: ; %entry
1856 ; GFX11-WGP-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1857 ; GFX11-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
1858 ; GFX11-WGP-NEXT:    buffer_gl1_inv
1859 ; GFX11-WGP-NEXT:    buffer_gl0_inv
1860 ; GFX11-WGP-NEXT:    s_endpgm
1862 ; GFX11-CU-LABEL: agent_seq_cst_fence:
1863 ; GFX11-CU:       ; %bb.0: ; %entry
1864 ; GFX11-CU-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
1865 ; GFX11-CU-NEXT:    s_waitcnt_vscnt null, 0x0
1866 ; GFX11-CU-NEXT:    buffer_gl1_inv
1867 ; GFX11-CU-NEXT:    buffer_gl0_inv
1868 ; GFX11-CU-NEXT:    s_endpgm
1870 ; GFX12-WGP-LABEL: agent_seq_cst_fence:
1871 ; GFX12-WGP:       ; %bb.0: ; %entry
1872 ; GFX12-WGP-NEXT:    s_wait_bvhcnt 0x0
1873 ; GFX12-WGP-NEXT:    s_wait_samplecnt 0x0
1874 ; GFX12-WGP-NEXT:    s_wait_storecnt 0x0
1875 ; GFX12-WGP-NEXT:    s_wait_loadcnt_dscnt 0x0
1876 ; GFX12-WGP-NEXT:    global_inv scope:SCOPE_DEV
1877 ; GFX12-WGP-NEXT:    s_endpgm
1879 ; GFX12-CU-LABEL: agent_seq_cst_fence:
1880 ; GFX12-CU:       ; %bb.0: ; %entry
1881 ; GFX12-CU-NEXT:    s_wait_bvhcnt 0x0
1882 ; GFX12-CU-NEXT:    s_wait_samplecnt 0x0
1883 ; GFX12-CU-NEXT:    s_wait_storecnt 0x0
1884 ; GFX12-CU-NEXT:    s_wait_loadcnt_dscnt 0x0
1885 ; GFX12-CU-NEXT:    global_inv scope:SCOPE_DEV
1886 ; GFX12-CU-NEXT:    s_endpgm
1887 entry:
1888   fence syncscope("agent") seq_cst
1889   ret void
1892 define amdgpu_kernel void @agent_one_as_acquire_fence() {
1893 ; GFX6-LABEL: agent_one_as_acquire_fence:
1894 ; GFX6:       ; %bb.0: ; %entry
1895 ; GFX6-NEXT:    s_waitcnt vmcnt(0)
1896 ; GFX6-NEXT:    buffer_wbinvl1
1897 ; GFX6-NEXT:    s_endpgm
1899 ; GFX7-LABEL: agent_one_as_acquire_fence:
1900 ; GFX7:       ; %bb.0: ; %entry
1901 ; GFX7-NEXT:    s_waitcnt vmcnt(0)
1902 ; GFX7-NEXT:    buffer_wbinvl1_vol
1903 ; GFX7-NEXT:    s_endpgm
1905 ; GFX10-WGP-LABEL: agent_one_as_acquire_fence:
1906 ; GFX10-WGP:       ; %bb.0: ; %entry
1907 ; GFX10-WGP-NEXT:    s_waitcnt vmcnt(0)
1908 ; GFX10-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
1909 ; GFX10-WGP-NEXT:    buffer_gl1_inv
1910 ; GFX10-WGP-NEXT:    buffer_gl0_inv
1911 ; GFX10-WGP-NEXT:    s_endpgm
1913 ; GFX10-CU-LABEL: agent_one_as_acquire_fence:
1914 ; GFX10-CU:       ; %bb.0: ; %entry
1915 ; GFX10-CU-NEXT:    s_waitcnt vmcnt(0)
1916 ; GFX10-CU-NEXT:    s_waitcnt_vscnt null, 0x0
1917 ; GFX10-CU-NEXT:    buffer_gl1_inv
1918 ; GFX10-CU-NEXT:    buffer_gl0_inv
1919 ; GFX10-CU-NEXT:    s_endpgm
1921 ; SKIP-CACHE-INV-LABEL: agent_one_as_acquire_fence:
1922 ; SKIP-CACHE-INV:       ; %bb.0: ; %entry
1923 ; SKIP-CACHE-INV-NEXT:    s_waitcnt vmcnt(0)
1924 ; SKIP-CACHE-INV-NEXT:    s_endpgm
1926 ; GFX90A-NOTTGSPLIT-LABEL: agent_one_as_acquire_fence:
1927 ; GFX90A-NOTTGSPLIT:       ; %bb.0: ; %entry
1928 ; GFX90A-NOTTGSPLIT-NEXT:    s_waitcnt vmcnt(0)
1929 ; GFX90A-NOTTGSPLIT-NEXT:    buffer_wbinvl1_vol
1930 ; GFX90A-NOTTGSPLIT-NEXT:    s_endpgm
1932 ; GFX90A-TGSPLIT-LABEL: agent_one_as_acquire_fence:
1933 ; GFX90A-TGSPLIT:       ; %bb.0: ; %entry
1934 ; GFX90A-TGSPLIT-NEXT:    s_waitcnt vmcnt(0)
1935 ; GFX90A-TGSPLIT-NEXT:    buffer_wbinvl1_vol
1936 ; GFX90A-TGSPLIT-NEXT:    s_endpgm
1938 ; GFX940-NOTTGSPLIT-LABEL: agent_one_as_acquire_fence:
1939 ; GFX940-NOTTGSPLIT:       ; %bb.0: ; %entry
1940 ; GFX940-NOTTGSPLIT-NEXT:    s_waitcnt vmcnt(0)
1941 ; GFX940-NOTTGSPLIT-NEXT:    buffer_inv sc1
1942 ; GFX940-NOTTGSPLIT-NEXT:    s_endpgm
1944 ; GFX940-TGSPLIT-LABEL: agent_one_as_acquire_fence:
1945 ; GFX940-TGSPLIT:       ; %bb.0: ; %entry
1946 ; GFX940-TGSPLIT-NEXT:    s_waitcnt vmcnt(0)
1947 ; GFX940-TGSPLIT-NEXT:    buffer_inv sc1
1948 ; GFX940-TGSPLIT-NEXT:    s_endpgm
1950 ; GFX11-WGP-LABEL: agent_one_as_acquire_fence:
1951 ; GFX11-WGP:       ; %bb.0: ; %entry
1952 ; GFX11-WGP-NEXT:    s_waitcnt vmcnt(0)
1953 ; GFX11-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
1954 ; GFX11-WGP-NEXT:    buffer_gl1_inv
1955 ; GFX11-WGP-NEXT:    buffer_gl0_inv
1956 ; GFX11-WGP-NEXT:    s_endpgm
1958 ; GFX11-CU-LABEL: agent_one_as_acquire_fence:
1959 ; GFX11-CU:       ; %bb.0: ; %entry
1960 ; GFX11-CU-NEXT:    s_waitcnt vmcnt(0)
1961 ; GFX11-CU-NEXT:    s_waitcnt_vscnt null, 0x0
1962 ; GFX11-CU-NEXT:    buffer_gl1_inv
1963 ; GFX11-CU-NEXT:    buffer_gl0_inv
1964 ; GFX11-CU-NEXT:    s_endpgm
1966 ; GFX12-WGP-LABEL: agent_one_as_acquire_fence:
1967 ; GFX12-WGP:       ; %bb.0: ; %entry
1968 ; GFX12-WGP-NEXT:    s_wait_loadcnt 0x0
1969 ; GFX12-WGP-NEXT:    s_wait_storecnt 0x0
1970 ; GFX12-WGP-NEXT:    global_inv scope:SCOPE_DEV
1971 ; GFX12-WGP-NEXT:    s_endpgm
1973 ; GFX12-CU-LABEL: agent_one_as_acquire_fence:
1974 ; GFX12-CU:       ; %bb.0: ; %entry
1975 ; GFX12-CU-NEXT:    s_wait_loadcnt 0x0
1976 ; GFX12-CU-NEXT:    s_wait_storecnt 0x0
1977 ; GFX12-CU-NEXT:    global_inv scope:SCOPE_DEV
1978 ; GFX12-CU-NEXT:    s_endpgm
1979 entry:
1980   fence syncscope("agent-one-as") acquire
1981   ret void
1984 define amdgpu_kernel void @agent_one_as_release_fence() {
1985 ; GFX6-LABEL: agent_one_as_release_fence:
1986 ; GFX6:       ; %bb.0: ; %entry
1987 ; GFX6-NEXT:    s_waitcnt vmcnt(0)
1988 ; GFX6-NEXT:    s_endpgm
1990 ; GFX7-LABEL: agent_one_as_release_fence:
1991 ; GFX7:       ; %bb.0: ; %entry
1992 ; GFX7-NEXT:    s_waitcnt vmcnt(0)
1993 ; GFX7-NEXT:    s_endpgm
1995 ; GFX10-WGP-LABEL: agent_one_as_release_fence:
1996 ; GFX10-WGP:       ; %bb.0: ; %entry
1997 ; GFX10-WGP-NEXT:    s_waitcnt vmcnt(0)
1998 ; GFX10-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
1999 ; GFX10-WGP-NEXT:    s_endpgm
2001 ; GFX10-CU-LABEL: agent_one_as_release_fence:
2002 ; GFX10-CU:       ; %bb.0: ; %entry
2003 ; GFX10-CU-NEXT:    s_waitcnt vmcnt(0)
2004 ; GFX10-CU-NEXT:    s_waitcnt_vscnt null, 0x0
2005 ; GFX10-CU-NEXT:    s_endpgm
2007 ; SKIP-CACHE-INV-LABEL: agent_one_as_release_fence:
2008 ; SKIP-CACHE-INV:       ; %bb.0: ; %entry
2009 ; SKIP-CACHE-INV-NEXT:    s_waitcnt vmcnt(0)
2010 ; SKIP-CACHE-INV-NEXT:    s_endpgm
2012 ; GFX90A-NOTTGSPLIT-LABEL: agent_one_as_release_fence:
2013 ; GFX90A-NOTTGSPLIT:       ; %bb.0: ; %entry
2014 ; GFX90A-NOTTGSPLIT-NEXT:    s_waitcnt vmcnt(0)
2015 ; GFX90A-NOTTGSPLIT-NEXT:    s_endpgm
2017 ; GFX90A-TGSPLIT-LABEL: agent_one_as_release_fence:
2018 ; GFX90A-TGSPLIT:       ; %bb.0: ; %entry
2019 ; GFX90A-TGSPLIT-NEXT:    s_waitcnt vmcnt(0)
2020 ; GFX90A-TGSPLIT-NEXT:    s_endpgm
2022 ; GFX940-NOTTGSPLIT-LABEL: agent_one_as_release_fence:
2023 ; GFX940-NOTTGSPLIT:       ; %bb.0: ; %entry
2024 ; GFX940-NOTTGSPLIT-NEXT:    buffer_wbl2 sc1
2025 ; GFX940-NOTTGSPLIT-NEXT:    s_waitcnt vmcnt(0)
2026 ; GFX940-NOTTGSPLIT-NEXT:    s_endpgm
2028 ; GFX940-TGSPLIT-LABEL: agent_one_as_release_fence:
2029 ; GFX940-TGSPLIT:       ; %bb.0: ; %entry
2030 ; GFX940-TGSPLIT-NEXT:    buffer_wbl2 sc1
2031 ; GFX940-TGSPLIT-NEXT:    s_waitcnt vmcnt(0)
2032 ; GFX940-TGSPLIT-NEXT:    s_endpgm
2034 ; GFX11-WGP-LABEL: agent_one_as_release_fence:
2035 ; GFX11-WGP:       ; %bb.0: ; %entry
2036 ; GFX11-WGP-NEXT:    s_waitcnt vmcnt(0)
2037 ; GFX11-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
2038 ; GFX11-WGP-NEXT:    s_endpgm
2040 ; GFX11-CU-LABEL: agent_one_as_release_fence:
2041 ; GFX11-CU:       ; %bb.0: ; %entry
2042 ; GFX11-CU-NEXT:    s_waitcnt vmcnt(0)
2043 ; GFX11-CU-NEXT:    s_waitcnt_vscnt null, 0x0
2044 ; GFX11-CU-NEXT:    s_endpgm
2046 ; GFX12-WGP-LABEL: agent_one_as_release_fence:
2047 ; GFX12-WGP:       ; %bb.0: ; %entry
2048 ; GFX12-WGP-NEXT:    s_wait_bvhcnt 0x0
2049 ; GFX12-WGP-NEXT:    s_wait_samplecnt 0x0
2050 ; GFX12-WGP-NEXT:    s_wait_loadcnt 0x0
2051 ; GFX12-WGP-NEXT:    s_wait_storecnt 0x0
2052 ; GFX12-WGP-NEXT:    s_endpgm
2054 ; GFX12-CU-LABEL: agent_one_as_release_fence:
2055 ; GFX12-CU:       ; %bb.0: ; %entry
2056 ; GFX12-CU-NEXT:    s_wait_bvhcnt 0x0
2057 ; GFX12-CU-NEXT:    s_wait_samplecnt 0x0
2058 ; GFX12-CU-NEXT:    s_wait_loadcnt 0x0
2059 ; GFX12-CU-NEXT:    s_wait_storecnt 0x0
2060 ; GFX12-CU-NEXT:    s_endpgm
2061 entry:
2062   fence syncscope("agent-one-as") release
2063   ret void
2066 define amdgpu_kernel void @agent_one_as_acq_rel_fence() {
2067 ; GFX6-LABEL: agent_one_as_acq_rel_fence:
2068 ; GFX6:       ; %bb.0: ; %entry
2069 ; GFX6-NEXT:    s_waitcnt vmcnt(0)
2070 ; GFX6-NEXT:    buffer_wbinvl1
2071 ; GFX6-NEXT:    s_endpgm
2073 ; GFX7-LABEL: agent_one_as_acq_rel_fence:
2074 ; GFX7:       ; %bb.0: ; %entry
2075 ; GFX7-NEXT:    s_waitcnt vmcnt(0)
2076 ; GFX7-NEXT:    buffer_wbinvl1_vol
2077 ; GFX7-NEXT:    s_endpgm
2079 ; GFX10-WGP-LABEL: agent_one_as_acq_rel_fence:
2080 ; GFX10-WGP:       ; %bb.0: ; %entry
2081 ; GFX10-WGP-NEXT:    s_waitcnt vmcnt(0)
2082 ; GFX10-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
2083 ; GFX10-WGP-NEXT:    buffer_gl1_inv
2084 ; GFX10-WGP-NEXT:    buffer_gl0_inv
2085 ; GFX10-WGP-NEXT:    s_endpgm
2087 ; GFX10-CU-LABEL: agent_one_as_acq_rel_fence:
2088 ; GFX10-CU:       ; %bb.0: ; %entry
2089 ; GFX10-CU-NEXT:    s_waitcnt vmcnt(0)
2090 ; GFX10-CU-NEXT:    s_waitcnt_vscnt null, 0x0
2091 ; GFX10-CU-NEXT:    buffer_gl1_inv
2092 ; GFX10-CU-NEXT:    buffer_gl0_inv
2093 ; GFX10-CU-NEXT:    s_endpgm
2095 ; SKIP-CACHE-INV-LABEL: agent_one_as_acq_rel_fence:
2096 ; SKIP-CACHE-INV:       ; %bb.0: ; %entry
2097 ; SKIP-CACHE-INV-NEXT:    s_waitcnt vmcnt(0)
2098 ; SKIP-CACHE-INV-NEXT:    s_endpgm
2100 ; GFX90A-NOTTGSPLIT-LABEL: agent_one_as_acq_rel_fence:
2101 ; GFX90A-NOTTGSPLIT:       ; %bb.0: ; %entry
2102 ; GFX90A-NOTTGSPLIT-NEXT:    s_waitcnt vmcnt(0)
2103 ; GFX90A-NOTTGSPLIT-NEXT:    buffer_wbinvl1_vol
2104 ; GFX90A-NOTTGSPLIT-NEXT:    s_endpgm
2106 ; GFX90A-TGSPLIT-LABEL: agent_one_as_acq_rel_fence:
2107 ; GFX90A-TGSPLIT:       ; %bb.0: ; %entry
2108 ; GFX90A-TGSPLIT-NEXT:    s_waitcnt vmcnt(0)
2109 ; GFX90A-TGSPLIT-NEXT:    buffer_wbinvl1_vol
2110 ; GFX90A-TGSPLIT-NEXT:    s_endpgm
2112 ; GFX940-NOTTGSPLIT-LABEL: agent_one_as_acq_rel_fence:
2113 ; GFX940-NOTTGSPLIT:       ; %bb.0: ; %entry
2114 ; GFX940-NOTTGSPLIT-NEXT:    buffer_wbl2 sc1
2115 ; GFX940-NOTTGSPLIT-NEXT:    s_waitcnt vmcnt(0)
2116 ; GFX940-NOTTGSPLIT-NEXT:    buffer_inv sc1
2117 ; GFX940-NOTTGSPLIT-NEXT:    s_endpgm
2119 ; GFX940-TGSPLIT-LABEL: agent_one_as_acq_rel_fence:
2120 ; GFX940-TGSPLIT:       ; %bb.0: ; %entry
2121 ; GFX940-TGSPLIT-NEXT:    buffer_wbl2 sc1
2122 ; GFX940-TGSPLIT-NEXT:    s_waitcnt vmcnt(0)
2123 ; GFX940-TGSPLIT-NEXT:    buffer_inv sc1
2124 ; GFX940-TGSPLIT-NEXT:    s_endpgm
2126 ; GFX11-WGP-LABEL: agent_one_as_acq_rel_fence:
2127 ; GFX11-WGP:       ; %bb.0: ; %entry
2128 ; GFX11-WGP-NEXT:    s_waitcnt vmcnt(0)
2129 ; GFX11-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
2130 ; GFX11-WGP-NEXT:    buffer_gl1_inv
2131 ; GFX11-WGP-NEXT:    buffer_gl0_inv
2132 ; GFX11-WGP-NEXT:    s_endpgm
2134 ; GFX11-CU-LABEL: agent_one_as_acq_rel_fence:
2135 ; GFX11-CU:       ; %bb.0: ; %entry
2136 ; GFX11-CU-NEXT:    s_waitcnt vmcnt(0)
2137 ; GFX11-CU-NEXT:    s_waitcnt_vscnt null, 0x0
2138 ; GFX11-CU-NEXT:    buffer_gl1_inv
2139 ; GFX11-CU-NEXT:    buffer_gl0_inv
2140 ; GFX11-CU-NEXT:    s_endpgm
2142 ; GFX12-WGP-LABEL: agent_one_as_acq_rel_fence:
2143 ; GFX12-WGP:       ; %bb.0: ; %entry
2144 ; GFX12-WGP-NEXT:    s_wait_bvhcnt 0x0
2145 ; GFX12-WGP-NEXT:    s_wait_samplecnt 0x0
2146 ; GFX12-WGP-NEXT:    s_wait_loadcnt 0x0
2147 ; GFX12-WGP-NEXT:    s_wait_storecnt 0x0
2148 ; GFX12-WGP-NEXT:    global_inv scope:SCOPE_DEV
2149 ; GFX12-WGP-NEXT:    s_endpgm
2151 ; GFX12-CU-LABEL: agent_one_as_acq_rel_fence:
2152 ; GFX12-CU:       ; %bb.0: ; %entry
2153 ; GFX12-CU-NEXT:    s_wait_bvhcnt 0x0
2154 ; GFX12-CU-NEXT:    s_wait_samplecnt 0x0
2155 ; GFX12-CU-NEXT:    s_wait_loadcnt 0x0
2156 ; GFX12-CU-NEXT:    s_wait_storecnt 0x0
2157 ; GFX12-CU-NEXT:    global_inv scope:SCOPE_DEV
2158 ; GFX12-CU-NEXT:    s_endpgm
2159 entry:
2160   fence syncscope("agent-one-as") acq_rel
2161   ret void
2164 define amdgpu_kernel void @agent_one_as_seq_cst_fence() {
2165 ; GFX6-LABEL: agent_one_as_seq_cst_fence:
2166 ; GFX6:       ; %bb.0: ; %entry
2167 ; GFX6-NEXT:    s_waitcnt vmcnt(0)
2168 ; GFX6-NEXT:    buffer_wbinvl1
2169 ; GFX6-NEXT:    s_endpgm
2171 ; GFX7-LABEL: agent_one_as_seq_cst_fence:
2172 ; GFX7:       ; %bb.0: ; %entry
2173 ; GFX7-NEXT:    s_waitcnt vmcnt(0)
2174 ; GFX7-NEXT:    buffer_wbinvl1_vol
2175 ; GFX7-NEXT:    s_endpgm
2177 ; GFX10-WGP-LABEL: agent_one_as_seq_cst_fence:
2178 ; GFX10-WGP:       ; %bb.0: ; %entry
2179 ; GFX10-WGP-NEXT:    s_waitcnt vmcnt(0)
2180 ; GFX10-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
2181 ; GFX10-WGP-NEXT:    buffer_gl1_inv
2182 ; GFX10-WGP-NEXT:    buffer_gl0_inv
2183 ; GFX10-WGP-NEXT:    s_endpgm
2185 ; GFX10-CU-LABEL: agent_one_as_seq_cst_fence:
2186 ; GFX10-CU:       ; %bb.0: ; %entry
2187 ; GFX10-CU-NEXT:    s_waitcnt vmcnt(0)
2188 ; GFX10-CU-NEXT:    s_waitcnt_vscnt null, 0x0
2189 ; GFX10-CU-NEXT:    buffer_gl1_inv
2190 ; GFX10-CU-NEXT:    buffer_gl0_inv
2191 ; GFX10-CU-NEXT:    s_endpgm
2193 ; SKIP-CACHE-INV-LABEL: agent_one_as_seq_cst_fence:
2194 ; SKIP-CACHE-INV:       ; %bb.0: ; %entry
2195 ; SKIP-CACHE-INV-NEXT:    s_waitcnt vmcnt(0)
2196 ; SKIP-CACHE-INV-NEXT:    s_endpgm
2198 ; GFX90A-NOTTGSPLIT-LABEL: agent_one_as_seq_cst_fence:
2199 ; GFX90A-NOTTGSPLIT:       ; %bb.0: ; %entry
2200 ; GFX90A-NOTTGSPLIT-NEXT:    s_waitcnt vmcnt(0)
2201 ; GFX90A-NOTTGSPLIT-NEXT:    buffer_wbinvl1_vol
2202 ; GFX90A-NOTTGSPLIT-NEXT:    s_endpgm
2204 ; GFX90A-TGSPLIT-LABEL: agent_one_as_seq_cst_fence:
2205 ; GFX90A-TGSPLIT:       ; %bb.0: ; %entry
2206 ; GFX90A-TGSPLIT-NEXT:    s_waitcnt vmcnt(0)
2207 ; GFX90A-TGSPLIT-NEXT:    buffer_wbinvl1_vol
2208 ; GFX90A-TGSPLIT-NEXT:    s_endpgm
2210 ; GFX940-NOTTGSPLIT-LABEL: agent_one_as_seq_cst_fence:
2211 ; GFX940-NOTTGSPLIT:       ; %bb.0: ; %entry
2212 ; GFX940-NOTTGSPLIT-NEXT:    buffer_wbl2 sc1
2213 ; GFX940-NOTTGSPLIT-NEXT:    s_waitcnt vmcnt(0)
2214 ; GFX940-NOTTGSPLIT-NEXT:    buffer_inv sc1
2215 ; GFX940-NOTTGSPLIT-NEXT:    s_endpgm
2217 ; GFX940-TGSPLIT-LABEL: agent_one_as_seq_cst_fence:
2218 ; GFX940-TGSPLIT:       ; %bb.0: ; %entry
2219 ; GFX940-TGSPLIT-NEXT:    buffer_wbl2 sc1
2220 ; GFX940-TGSPLIT-NEXT:    s_waitcnt vmcnt(0)
2221 ; GFX940-TGSPLIT-NEXT:    buffer_inv sc1
2222 ; GFX940-TGSPLIT-NEXT:    s_endpgm
2224 ; GFX11-WGP-LABEL: agent_one_as_seq_cst_fence:
2225 ; GFX11-WGP:       ; %bb.0: ; %entry
2226 ; GFX11-WGP-NEXT:    s_waitcnt vmcnt(0)
2227 ; GFX11-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
2228 ; GFX11-WGP-NEXT:    buffer_gl1_inv
2229 ; GFX11-WGP-NEXT:    buffer_gl0_inv
2230 ; GFX11-WGP-NEXT:    s_endpgm
2232 ; GFX11-CU-LABEL: agent_one_as_seq_cst_fence:
2233 ; GFX11-CU:       ; %bb.0: ; %entry
2234 ; GFX11-CU-NEXT:    s_waitcnt vmcnt(0)
2235 ; GFX11-CU-NEXT:    s_waitcnt_vscnt null, 0x0
2236 ; GFX11-CU-NEXT:    buffer_gl1_inv
2237 ; GFX11-CU-NEXT:    buffer_gl0_inv
2238 ; GFX11-CU-NEXT:    s_endpgm
2240 ; GFX12-WGP-LABEL: agent_one_as_seq_cst_fence:
2241 ; GFX12-WGP:       ; %bb.0: ; %entry
2242 ; GFX12-WGP-NEXT:    s_wait_bvhcnt 0x0
2243 ; GFX12-WGP-NEXT:    s_wait_samplecnt 0x0
2244 ; GFX12-WGP-NEXT:    s_wait_loadcnt 0x0
2245 ; GFX12-WGP-NEXT:    s_wait_storecnt 0x0
2246 ; GFX12-WGP-NEXT:    global_inv scope:SCOPE_DEV
2247 ; GFX12-WGP-NEXT:    s_endpgm
2249 ; GFX12-CU-LABEL: agent_one_as_seq_cst_fence:
2250 ; GFX12-CU:       ; %bb.0: ; %entry
2251 ; GFX12-CU-NEXT:    s_wait_bvhcnt 0x0
2252 ; GFX12-CU-NEXT:    s_wait_samplecnt 0x0
2253 ; GFX12-CU-NEXT:    s_wait_loadcnt 0x0
2254 ; GFX12-CU-NEXT:    s_wait_storecnt 0x0
2255 ; GFX12-CU-NEXT:    global_inv scope:SCOPE_DEV
2256 ; GFX12-CU-NEXT:    s_endpgm
2257 entry:
2258   fence syncscope("agent-one-as") seq_cst
2259   ret void
2262 define amdgpu_kernel void @system_acquire_fence() {
2263 ; GFX6-LABEL: system_acquire_fence:
2264 ; GFX6:       ; %bb.0: ; %entry
2265 ; GFX6-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2266 ; GFX6-NEXT:    buffer_wbinvl1
2267 ; GFX6-NEXT:    s_endpgm
2269 ; GFX7-LABEL: system_acquire_fence:
2270 ; GFX7:       ; %bb.0: ; %entry
2271 ; GFX7-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2272 ; GFX7-NEXT:    buffer_wbinvl1_vol
2273 ; GFX7-NEXT:    s_endpgm
2275 ; GFX10-WGP-LABEL: system_acquire_fence:
2276 ; GFX10-WGP:       ; %bb.0: ; %entry
2277 ; GFX10-WGP-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2278 ; GFX10-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
2279 ; GFX10-WGP-NEXT:    buffer_gl1_inv
2280 ; GFX10-WGP-NEXT:    buffer_gl0_inv
2281 ; GFX10-WGP-NEXT:    s_endpgm
2283 ; GFX10-CU-LABEL: system_acquire_fence:
2284 ; GFX10-CU:       ; %bb.0: ; %entry
2285 ; GFX10-CU-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2286 ; GFX10-CU-NEXT:    s_waitcnt_vscnt null, 0x0
2287 ; GFX10-CU-NEXT:    buffer_gl1_inv
2288 ; GFX10-CU-NEXT:    buffer_gl0_inv
2289 ; GFX10-CU-NEXT:    s_endpgm
2291 ; SKIP-CACHE-INV-LABEL: system_acquire_fence:
2292 ; SKIP-CACHE-INV:       ; %bb.0: ; %entry
2293 ; SKIP-CACHE-INV-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2294 ; SKIP-CACHE-INV-NEXT:    s_endpgm
2296 ; GFX90A-NOTTGSPLIT-LABEL: system_acquire_fence:
2297 ; GFX90A-NOTTGSPLIT:       ; %bb.0: ; %entry
2298 ; GFX90A-NOTTGSPLIT-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2299 ; GFX90A-NOTTGSPLIT-NEXT:    buffer_invl2
2300 ; GFX90A-NOTTGSPLIT-NEXT:    buffer_wbinvl1_vol
2301 ; GFX90A-NOTTGSPLIT-NEXT:    s_endpgm
2303 ; GFX90A-TGSPLIT-LABEL: system_acquire_fence:
2304 ; GFX90A-TGSPLIT:       ; %bb.0: ; %entry
2305 ; GFX90A-TGSPLIT-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2306 ; GFX90A-TGSPLIT-NEXT:    buffer_invl2
2307 ; GFX90A-TGSPLIT-NEXT:    buffer_wbinvl1_vol
2308 ; GFX90A-TGSPLIT-NEXT:    s_endpgm
2310 ; GFX940-NOTTGSPLIT-LABEL: system_acquire_fence:
2311 ; GFX940-NOTTGSPLIT:       ; %bb.0: ; %entry
2312 ; GFX940-NOTTGSPLIT-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2313 ; GFX940-NOTTGSPLIT-NEXT:    buffer_inv sc0 sc1
2314 ; GFX940-NOTTGSPLIT-NEXT:    s_endpgm
2316 ; GFX940-TGSPLIT-LABEL: system_acquire_fence:
2317 ; GFX940-TGSPLIT:       ; %bb.0: ; %entry
2318 ; GFX940-TGSPLIT-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2319 ; GFX940-TGSPLIT-NEXT:    buffer_inv sc0 sc1
2320 ; GFX940-TGSPLIT-NEXT:    s_endpgm
2322 ; GFX11-WGP-LABEL: system_acquire_fence:
2323 ; GFX11-WGP:       ; %bb.0: ; %entry
2324 ; GFX11-WGP-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2325 ; GFX11-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
2326 ; GFX11-WGP-NEXT:    buffer_gl1_inv
2327 ; GFX11-WGP-NEXT:    buffer_gl0_inv
2328 ; GFX11-WGP-NEXT:    s_endpgm
2330 ; GFX11-CU-LABEL: system_acquire_fence:
2331 ; GFX11-CU:       ; %bb.0: ; %entry
2332 ; GFX11-CU-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2333 ; GFX11-CU-NEXT:    s_waitcnt_vscnt null, 0x0
2334 ; GFX11-CU-NEXT:    buffer_gl1_inv
2335 ; GFX11-CU-NEXT:    buffer_gl0_inv
2336 ; GFX11-CU-NEXT:    s_endpgm
2338 ; GFX12-WGP-LABEL: system_acquire_fence:
2339 ; GFX12-WGP:       ; %bb.0: ; %entry
2340 ; GFX12-WGP-NEXT:    s_wait_storecnt 0x0
2341 ; GFX12-WGP-NEXT:    s_wait_loadcnt_dscnt 0x0
2342 ; GFX12-WGP-NEXT:    global_inv scope:SCOPE_SYS
2343 ; GFX12-WGP-NEXT:    s_endpgm
2345 ; GFX12-CU-LABEL: system_acquire_fence:
2346 ; GFX12-CU:       ; %bb.0: ; %entry
2347 ; GFX12-CU-NEXT:    s_wait_storecnt 0x0
2348 ; GFX12-CU-NEXT:    s_wait_loadcnt_dscnt 0x0
2349 ; GFX12-CU-NEXT:    global_inv scope:SCOPE_SYS
2350 ; GFX12-CU-NEXT:    s_endpgm
2351 entry:
2352   fence acquire
2353   ret void
2356 define amdgpu_kernel void @system_release_fence() {
2357 ; GFX6-LABEL: system_release_fence:
2358 ; GFX6:       ; %bb.0: ; %entry
2359 ; GFX6-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2360 ; GFX6-NEXT:    s_endpgm
2362 ; GFX7-LABEL: system_release_fence:
2363 ; GFX7:       ; %bb.0: ; %entry
2364 ; GFX7-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2365 ; GFX7-NEXT:    s_endpgm
2367 ; GFX10-WGP-LABEL: system_release_fence:
2368 ; GFX10-WGP:       ; %bb.0: ; %entry
2369 ; GFX10-WGP-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2370 ; GFX10-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
2371 ; GFX10-WGP-NEXT:    s_endpgm
2373 ; GFX10-CU-LABEL: system_release_fence:
2374 ; GFX10-CU:       ; %bb.0: ; %entry
2375 ; GFX10-CU-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2376 ; GFX10-CU-NEXT:    s_waitcnt_vscnt null, 0x0
2377 ; GFX10-CU-NEXT:    s_endpgm
2379 ; SKIP-CACHE-INV-LABEL: system_release_fence:
2380 ; SKIP-CACHE-INV:       ; %bb.0: ; %entry
2381 ; SKIP-CACHE-INV-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2382 ; SKIP-CACHE-INV-NEXT:    s_endpgm
2384 ; GFX90A-NOTTGSPLIT-LABEL: system_release_fence:
2385 ; GFX90A-NOTTGSPLIT:       ; %bb.0: ; %entry
2386 ; GFX90A-NOTTGSPLIT-NEXT:    buffer_wbl2
2387 ; GFX90A-NOTTGSPLIT-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2388 ; GFX90A-NOTTGSPLIT-NEXT:    s_endpgm
2390 ; GFX90A-TGSPLIT-LABEL: system_release_fence:
2391 ; GFX90A-TGSPLIT:       ; %bb.0: ; %entry
2392 ; GFX90A-TGSPLIT-NEXT:    buffer_wbl2
2393 ; GFX90A-TGSPLIT-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2394 ; GFX90A-TGSPLIT-NEXT:    s_endpgm
2396 ; GFX940-NOTTGSPLIT-LABEL: system_release_fence:
2397 ; GFX940-NOTTGSPLIT:       ; %bb.0: ; %entry
2398 ; GFX940-NOTTGSPLIT-NEXT:    buffer_wbl2 sc0 sc1
2399 ; GFX940-NOTTGSPLIT-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2400 ; GFX940-NOTTGSPLIT-NEXT:    s_endpgm
2402 ; GFX940-TGSPLIT-LABEL: system_release_fence:
2403 ; GFX940-TGSPLIT:       ; %bb.0: ; %entry
2404 ; GFX940-TGSPLIT-NEXT:    buffer_wbl2 sc0 sc1
2405 ; GFX940-TGSPLIT-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2406 ; GFX940-TGSPLIT-NEXT:    s_endpgm
2408 ; GFX11-WGP-LABEL: system_release_fence:
2409 ; GFX11-WGP:       ; %bb.0: ; %entry
2410 ; GFX11-WGP-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2411 ; GFX11-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
2412 ; GFX11-WGP-NEXT:    s_endpgm
2414 ; GFX11-CU-LABEL: system_release_fence:
2415 ; GFX11-CU:       ; %bb.0: ; %entry
2416 ; GFX11-CU-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2417 ; GFX11-CU-NEXT:    s_waitcnt_vscnt null, 0x0
2418 ; GFX11-CU-NEXT:    s_endpgm
2420 ; GFX12-WGP-LABEL: system_release_fence:
2421 ; GFX12-WGP:       ; %bb.0: ; %entry
2422 ; GFX12-WGP-NEXT:    global_wb scope:SCOPE_SYS
2423 ; GFX12-WGP-NEXT:    s_wait_bvhcnt 0x0
2424 ; GFX12-WGP-NEXT:    s_wait_samplecnt 0x0
2425 ; GFX12-WGP-NEXT:    s_wait_storecnt 0x0
2426 ; GFX12-WGP-NEXT:    s_wait_loadcnt_dscnt 0x0
2427 ; GFX12-WGP-NEXT:    s_endpgm
2429 ; GFX12-CU-LABEL: system_release_fence:
2430 ; GFX12-CU:       ; %bb.0: ; %entry
2431 ; GFX12-CU-NEXT:    global_wb scope:SCOPE_SYS
2432 ; GFX12-CU-NEXT:    s_wait_bvhcnt 0x0
2433 ; GFX12-CU-NEXT:    s_wait_samplecnt 0x0
2434 ; GFX12-CU-NEXT:    s_wait_storecnt 0x0
2435 ; GFX12-CU-NEXT:    s_wait_loadcnt_dscnt 0x0
2436 ; GFX12-CU-NEXT:    s_endpgm
2437 entry:
2438   fence release
2439   ret void
2442 define amdgpu_kernel void @system_acq_rel_fence() {
2443 ; GFX6-LABEL: system_acq_rel_fence:
2444 ; GFX6:       ; %bb.0: ; %entry
2445 ; GFX6-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2446 ; GFX6-NEXT:    buffer_wbinvl1
2447 ; GFX6-NEXT:    s_endpgm
2449 ; GFX7-LABEL: system_acq_rel_fence:
2450 ; GFX7:       ; %bb.0: ; %entry
2451 ; GFX7-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2452 ; GFX7-NEXT:    buffer_wbinvl1_vol
2453 ; GFX7-NEXT:    s_endpgm
2455 ; GFX10-WGP-LABEL: system_acq_rel_fence:
2456 ; GFX10-WGP:       ; %bb.0: ; %entry
2457 ; GFX10-WGP-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2458 ; GFX10-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
2459 ; GFX10-WGP-NEXT:    buffer_gl1_inv
2460 ; GFX10-WGP-NEXT:    buffer_gl0_inv
2461 ; GFX10-WGP-NEXT:    s_endpgm
2463 ; GFX10-CU-LABEL: system_acq_rel_fence:
2464 ; GFX10-CU:       ; %bb.0: ; %entry
2465 ; GFX10-CU-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2466 ; GFX10-CU-NEXT:    s_waitcnt_vscnt null, 0x0
2467 ; GFX10-CU-NEXT:    buffer_gl1_inv
2468 ; GFX10-CU-NEXT:    buffer_gl0_inv
2469 ; GFX10-CU-NEXT:    s_endpgm
2471 ; SKIP-CACHE-INV-LABEL: system_acq_rel_fence:
2472 ; SKIP-CACHE-INV:       ; %bb.0: ; %entry
2473 ; SKIP-CACHE-INV-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2474 ; SKIP-CACHE-INV-NEXT:    s_endpgm
2476 ; GFX90A-NOTTGSPLIT-LABEL: system_acq_rel_fence:
2477 ; GFX90A-NOTTGSPLIT:       ; %bb.0: ; %entry
2478 ; GFX90A-NOTTGSPLIT-NEXT:    buffer_wbl2
2479 ; GFX90A-NOTTGSPLIT-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2480 ; GFX90A-NOTTGSPLIT-NEXT:    buffer_invl2
2481 ; GFX90A-NOTTGSPLIT-NEXT:    buffer_wbinvl1_vol
2482 ; GFX90A-NOTTGSPLIT-NEXT:    s_endpgm
2484 ; GFX90A-TGSPLIT-LABEL: system_acq_rel_fence:
2485 ; GFX90A-TGSPLIT:       ; %bb.0: ; %entry
2486 ; GFX90A-TGSPLIT-NEXT:    buffer_wbl2
2487 ; GFX90A-TGSPLIT-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2488 ; GFX90A-TGSPLIT-NEXT:    buffer_invl2
2489 ; GFX90A-TGSPLIT-NEXT:    buffer_wbinvl1_vol
2490 ; GFX90A-TGSPLIT-NEXT:    s_endpgm
2492 ; GFX940-NOTTGSPLIT-LABEL: system_acq_rel_fence:
2493 ; GFX940-NOTTGSPLIT:       ; %bb.0: ; %entry
2494 ; GFX940-NOTTGSPLIT-NEXT:    buffer_wbl2 sc0 sc1
2495 ; GFX940-NOTTGSPLIT-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2496 ; GFX940-NOTTGSPLIT-NEXT:    buffer_inv sc0 sc1
2497 ; GFX940-NOTTGSPLIT-NEXT:    s_endpgm
2499 ; GFX940-TGSPLIT-LABEL: system_acq_rel_fence:
2500 ; GFX940-TGSPLIT:       ; %bb.0: ; %entry
2501 ; GFX940-TGSPLIT-NEXT:    buffer_wbl2 sc0 sc1
2502 ; GFX940-TGSPLIT-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2503 ; GFX940-TGSPLIT-NEXT:    buffer_inv sc0 sc1
2504 ; GFX940-TGSPLIT-NEXT:    s_endpgm
2506 ; GFX11-WGP-LABEL: system_acq_rel_fence:
2507 ; GFX11-WGP:       ; %bb.0: ; %entry
2508 ; GFX11-WGP-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2509 ; GFX11-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
2510 ; GFX11-WGP-NEXT:    buffer_gl1_inv
2511 ; GFX11-WGP-NEXT:    buffer_gl0_inv
2512 ; GFX11-WGP-NEXT:    s_endpgm
2514 ; GFX11-CU-LABEL: system_acq_rel_fence:
2515 ; GFX11-CU:       ; %bb.0: ; %entry
2516 ; GFX11-CU-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2517 ; GFX11-CU-NEXT:    s_waitcnt_vscnt null, 0x0
2518 ; GFX11-CU-NEXT:    buffer_gl1_inv
2519 ; GFX11-CU-NEXT:    buffer_gl0_inv
2520 ; GFX11-CU-NEXT:    s_endpgm
2522 ; GFX12-WGP-LABEL: system_acq_rel_fence:
2523 ; GFX12-WGP:       ; %bb.0: ; %entry
2524 ; GFX12-WGP-NEXT:    global_wb scope:SCOPE_SYS
2525 ; GFX12-WGP-NEXT:    s_wait_bvhcnt 0x0
2526 ; GFX12-WGP-NEXT:    s_wait_samplecnt 0x0
2527 ; GFX12-WGP-NEXT:    s_wait_storecnt 0x0
2528 ; GFX12-WGP-NEXT:    s_wait_loadcnt_dscnt 0x0
2529 ; GFX12-WGP-NEXT:    global_inv scope:SCOPE_SYS
2530 ; GFX12-WGP-NEXT:    s_endpgm
2532 ; GFX12-CU-LABEL: system_acq_rel_fence:
2533 ; GFX12-CU:       ; %bb.0: ; %entry
2534 ; GFX12-CU-NEXT:    global_wb scope:SCOPE_SYS
2535 ; GFX12-CU-NEXT:    s_wait_bvhcnt 0x0
2536 ; GFX12-CU-NEXT:    s_wait_samplecnt 0x0
2537 ; GFX12-CU-NEXT:    s_wait_storecnt 0x0
2538 ; GFX12-CU-NEXT:    s_wait_loadcnt_dscnt 0x0
2539 ; GFX12-CU-NEXT:    global_inv scope:SCOPE_SYS
2540 ; GFX12-CU-NEXT:    s_endpgm
2541 entry:
2542   fence acq_rel
2543   ret void
2546 define amdgpu_kernel void @system_seq_cst_fence() {
2547 ; GFX6-LABEL: system_seq_cst_fence:
2548 ; GFX6:       ; %bb.0: ; %entry
2549 ; GFX6-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2550 ; GFX6-NEXT:    buffer_wbinvl1
2551 ; GFX6-NEXT:    s_endpgm
2553 ; GFX7-LABEL: system_seq_cst_fence:
2554 ; GFX7:       ; %bb.0: ; %entry
2555 ; GFX7-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2556 ; GFX7-NEXT:    buffer_wbinvl1_vol
2557 ; GFX7-NEXT:    s_endpgm
2559 ; GFX10-WGP-LABEL: system_seq_cst_fence:
2560 ; GFX10-WGP:       ; %bb.0: ; %entry
2561 ; GFX10-WGP-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2562 ; GFX10-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
2563 ; GFX10-WGP-NEXT:    buffer_gl1_inv
2564 ; GFX10-WGP-NEXT:    buffer_gl0_inv
2565 ; GFX10-WGP-NEXT:    s_endpgm
2567 ; GFX10-CU-LABEL: system_seq_cst_fence:
2568 ; GFX10-CU:       ; %bb.0: ; %entry
2569 ; GFX10-CU-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2570 ; GFX10-CU-NEXT:    s_waitcnt_vscnt null, 0x0
2571 ; GFX10-CU-NEXT:    buffer_gl1_inv
2572 ; GFX10-CU-NEXT:    buffer_gl0_inv
2573 ; GFX10-CU-NEXT:    s_endpgm
2575 ; SKIP-CACHE-INV-LABEL: system_seq_cst_fence:
2576 ; SKIP-CACHE-INV:       ; %bb.0: ; %entry
2577 ; SKIP-CACHE-INV-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2578 ; SKIP-CACHE-INV-NEXT:    s_endpgm
2580 ; GFX90A-NOTTGSPLIT-LABEL: system_seq_cst_fence:
2581 ; GFX90A-NOTTGSPLIT:       ; %bb.0: ; %entry
2582 ; GFX90A-NOTTGSPLIT-NEXT:    buffer_wbl2
2583 ; GFX90A-NOTTGSPLIT-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2584 ; GFX90A-NOTTGSPLIT-NEXT:    buffer_invl2
2585 ; GFX90A-NOTTGSPLIT-NEXT:    buffer_wbinvl1_vol
2586 ; GFX90A-NOTTGSPLIT-NEXT:    s_endpgm
2588 ; GFX90A-TGSPLIT-LABEL: system_seq_cst_fence:
2589 ; GFX90A-TGSPLIT:       ; %bb.0: ; %entry
2590 ; GFX90A-TGSPLIT-NEXT:    buffer_wbl2
2591 ; GFX90A-TGSPLIT-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2592 ; GFX90A-TGSPLIT-NEXT:    buffer_invl2
2593 ; GFX90A-TGSPLIT-NEXT:    buffer_wbinvl1_vol
2594 ; GFX90A-TGSPLIT-NEXT:    s_endpgm
2596 ; GFX940-NOTTGSPLIT-LABEL: system_seq_cst_fence:
2597 ; GFX940-NOTTGSPLIT:       ; %bb.0: ; %entry
2598 ; GFX940-NOTTGSPLIT-NEXT:    buffer_wbl2 sc0 sc1
2599 ; GFX940-NOTTGSPLIT-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2600 ; GFX940-NOTTGSPLIT-NEXT:    buffer_inv sc0 sc1
2601 ; GFX940-NOTTGSPLIT-NEXT:    s_endpgm
2603 ; GFX940-TGSPLIT-LABEL: system_seq_cst_fence:
2604 ; GFX940-TGSPLIT:       ; %bb.0: ; %entry
2605 ; GFX940-TGSPLIT-NEXT:    buffer_wbl2 sc0 sc1
2606 ; GFX940-TGSPLIT-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2607 ; GFX940-TGSPLIT-NEXT:    buffer_inv sc0 sc1
2608 ; GFX940-TGSPLIT-NEXT:    s_endpgm
2610 ; GFX11-WGP-LABEL: system_seq_cst_fence:
2611 ; GFX11-WGP:       ; %bb.0: ; %entry
2612 ; GFX11-WGP-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2613 ; GFX11-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
2614 ; GFX11-WGP-NEXT:    buffer_gl1_inv
2615 ; GFX11-WGP-NEXT:    buffer_gl0_inv
2616 ; GFX11-WGP-NEXT:    s_endpgm
2618 ; GFX11-CU-LABEL: system_seq_cst_fence:
2619 ; GFX11-CU:       ; %bb.0: ; %entry
2620 ; GFX11-CU-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)
2621 ; GFX11-CU-NEXT:    s_waitcnt_vscnt null, 0x0
2622 ; GFX11-CU-NEXT:    buffer_gl1_inv
2623 ; GFX11-CU-NEXT:    buffer_gl0_inv
2624 ; GFX11-CU-NEXT:    s_endpgm
2626 ; GFX12-WGP-LABEL: system_seq_cst_fence:
2627 ; GFX12-WGP:       ; %bb.0: ; %entry
2628 ; GFX12-WGP-NEXT:    global_wb scope:SCOPE_SYS
2629 ; GFX12-WGP-NEXT:    s_wait_bvhcnt 0x0
2630 ; GFX12-WGP-NEXT:    s_wait_samplecnt 0x0
2631 ; GFX12-WGP-NEXT:    s_wait_storecnt 0x0
2632 ; GFX12-WGP-NEXT:    s_wait_loadcnt_dscnt 0x0
2633 ; GFX12-WGP-NEXT:    global_inv scope:SCOPE_SYS
2634 ; GFX12-WGP-NEXT:    s_endpgm
2636 ; GFX12-CU-LABEL: system_seq_cst_fence:
2637 ; GFX12-CU:       ; %bb.0: ; %entry
2638 ; GFX12-CU-NEXT:    global_wb scope:SCOPE_SYS
2639 ; GFX12-CU-NEXT:    s_wait_bvhcnt 0x0
2640 ; GFX12-CU-NEXT:    s_wait_samplecnt 0x0
2641 ; GFX12-CU-NEXT:    s_wait_storecnt 0x0
2642 ; GFX12-CU-NEXT:    s_wait_loadcnt_dscnt 0x0
2643 ; GFX12-CU-NEXT:    global_inv scope:SCOPE_SYS
2644 ; GFX12-CU-NEXT:    s_endpgm
2645 entry:
2646   fence seq_cst
2647   ret void
2650 define amdgpu_kernel void @system_one_as_acquire_fence() {
2651 ; GFX6-LABEL: system_one_as_acquire_fence:
2652 ; GFX6:       ; %bb.0: ; %entry
2653 ; GFX6-NEXT:    s_waitcnt vmcnt(0)
2654 ; GFX6-NEXT:    buffer_wbinvl1
2655 ; GFX6-NEXT:    s_endpgm
2657 ; GFX7-LABEL: system_one_as_acquire_fence:
2658 ; GFX7:       ; %bb.0: ; %entry
2659 ; GFX7-NEXT:    s_waitcnt vmcnt(0)
2660 ; GFX7-NEXT:    buffer_wbinvl1_vol
2661 ; GFX7-NEXT:    s_endpgm
2663 ; GFX10-WGP-LABEL: system_one_as_acquire_fence:
2664 ; GFX10-WGP:       ; %bb.0: ; %entry
2665 ; GFX10-WGP-NEXT:    s_waitcnt vmcnt(0)
2666 ; GFX10-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
2667 ; GFX10-WGP-NEXT:    buffer_gl1_inv
2668 ; GFX10-WGP-NEXT:    buffer_gl0_inv
2669 ; GFX10-WGP-NEXT:    s_endpgm
2671 ; GFX10-CU-LABEL: system_one_as_acquire_fence:
2672 ; GFX10-CU:       ; %bb.0: ; %entry
2673 ; GFX10-CU-NEXT:    s_waitcnt vmcnt(0)
2674 ; GFX10-CU-NEXT:    s_waitcnt_vscnt null, 0x0
2675 ; GFX10-CU-NEXT:    buffer_gl1_inv
2676 ; GFX10-CU-NEXT:    buffer_gl0_inv
2677 ; GFX10-CU-NEXT:    s_endpgm
2679 ; SKIP-CACHE-INV-LABEL: system_one_as_acquire_fence:
2680 ; SKIP-CACHE-INV:       ; %bb.0: ; %entry
2681 ; SKIP-CACHE-INV-NEXT:    s_waitcnt vmcnt(0)
2682 ; SKIP-CACHE-INV-NEXT:    s_endpgm
2684 ; GFX90A-NOTTGSPLIT-LABEL: system_one_as_acquire_fence:
2685 ; GFX90A-NOTTGSPLIT:       ; %bb.0: ; %entry
2686 ; GFX90A-NOTTGSPLIT-NEXT:    s_waitcnt vmcnt(0)
2687 ; GFX90A-NOTTGSPLIT-NEXT:    buffer_invl2
2688 ; GFX90A-NOTTGSPLIT-NEXT:    buffer_wbinvl1_vol
2689 ; GFX90A-NOTTGSPLIT-NEXT:    s_endpgm
2691 ; GFX90A-TGSPLIT-LABEL: system_one_as_acquire_fence:
2692 ; GFX90A-TGSPLIT:       ; %bb.0: ; %entry
2693 ; GFX90A-TGSPLIT-NEXT:    s_waitcnt vmcnt(0)
2694 ; GFX90A-TGSPLIT-NEXT:    buffer_invl2
2695 ; GFX90A-TGSPLIT-NEXT:    buffer_wbinvl1_vol
2696 ; GFX90A-TGSPLIT-NEXT:    s_endpgm
2698 ; GFX940-NOTTGSPLIT-LABEL: system_one_as_acquire_fence:
2699 ; GFX940-NOTTGSPLIT:       ; %bb.0: ; %entry
2700 ; GFX940-NOTTGSPLIT-NEXT:    s_waitcnt vmcnt(0)
2701 ; GFX940-NOTTGSPLIT-NEXT:    buffer_inv sc0 sc1
2702 ; GFX940-NOTTGSPLIT-NEXT:    s_endpgm
2704 ; GFX940-TGSPLIT-LABEL: system_one_as_acquire_fence:
2705 ; GFX940-TGSPLIT:       ; %bb.0: ; %entry
2706 ; GFX940-TGSPLIT-NEXT:    s_waitcnt vmcnt(0)
2707 ; GFX940-TGSPLIT-NEXT:    buffer_inv sc0 sc1
2708 ; GFX940-TGSPLIT-NEXT:    s_endpgm
2710 ; GFX11-WGP-LABEL: system_one_as_acquire_fence:
2711 ; GFX11-WGP:       ; %bb.0: ; %entry
2712 ; GFX11-WGP-NEXT:    s_waitcnt vmcnt(0)
2713 ; GFX11-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
2714 ; GFX11-WGP-NEXT:    buffer_gl1_inv
2715 ; GFX11-WGP-NEXT:    buffer_gl0_inv
2716 ; GFX11-WGP-NEXT:    s_endpgm
2718 ; GFX11-CU-LABEL: system_one_as_acquire_fence:
2719 ; GFX11-CU:       ; %bb.0: ; %entry
2720 ; GFX11-CU-NEXT:    s_waitcnt vmcnt(0)
2721 ; GFX11-CU-NEXT:    s_waitcnt_vscnt null, 0x0
2722 ; GFX11-CU-NEXT:    buffer_gl1_inv
2723 ; GFX11-CU-NEXT:    buffer_gl0_inv
2724 ; GFX11-CU-NEXT:    s_endpgm
2726 ; GFX12-WGP-LABEL: system_one_as_acquire_fence:
2727 ; GFX12-WGP:       ; %bb.0: ; %entry
2728 ; GFX12-WGP-NEXT:    s_wait_loadcnt 0x0
2729 ; GFX12-WGP-NEXT:    s_wait_storecnt 0x0
2730 ; GFX12-WGP-NEXT:    global_inv scope:SCOPE_SYS
2731 ; GFX12-WGP-NEXT:    s_endpgm
2733 ; GFX12-CU-LABEL: system_one_as_acquire_fence:
2734 ; GFX12-CU:       ; %bb.0: ; %entry
2735 ; GFX12-CU-NEXT:    s_wait_loadcnt 0x0
2736 ; GFX12-CU-NEXT:    s_wait_storecnt 0x0
2737 ; GFX12-CU-NEXT:    global_inv scope:SCOPE_SYS
2738 ; GFX12-CU-NEXT:    s_endpgm
2739 entry:
2740   fence syncscope("one-as") acquire
2741   ret void
2744 define amdgpu_kernel void @system_one_as_release_fence() {
2745 ; GFX6-LABEL: system_one_as_release_fence:
2746 ; GFX6:       ; %bb.0: ; %entry
2747 ; GFX6-NEXT:    s_waitcnt vmcnt(0)
2748 ; GFX6-NEXT:    s_endpgm
2750 ; GFX7-LABEL: system_one_as_release_fence:
2751 ; GFX7:       ; %bb.0: ; %entry
2752 ; GFX7-NEXT:    s_waitcnt vmcnt(0)
2753 ; GFX7-NEXT:    s_endpgm
2755 ; GFX10-WGP-LABEL: system_one_as_release_fence:
2756 ; GFX10-WGP:       ; %bb.0: ; %entry
2757 ; GFX10-WGP-NEXT:    s_waitcnt vmcnt(0)
2758 ; GFX10-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
2759 ; GFX10-WGP-NEXT:    s_endpgm
2761 ; GFX10-CU-LABEL: system_one_as_release_fence:
2762 ; GFX10-CU:       ; %bb.0: ; %entry
2763 ; GFX10-CU-NEXT:    s_waitcnt vmcnt(0)
2764 ; GFX10-CU-NEXT:    s_waitcnt_vscnt null, 0x0
2765 ; GFX10-CU-NEXT:    s_endpgm
2767 ; SKIP-CACHE-INV-LABEL: system_one_as_release_fence:
2768 ; SKIP-CACHE-INV:       ; %bb.0: ; %entry
2769 ; SKIP-CACHE-INV-NEXT:    s_waitcnt vmcnt(0)
2770 ; SKIP-CACHE-INV-NEXT:    s_endpgm
2772 ; GFX90A-NOTTGSPLIT-LABEL: system_one_as_release_fence:
2773 ; GFX90A-NOTTGSPLIT:       ; %bb.0: ; %entry
2774 ; GFX90A-NOTTGSPLIT-NEXT:    buffer_wbl2
2775 ; GFX90A-NOTTGSPLIT-NEXT:    s_waitcnt vmcnt(0)
2776 ; GFX90A-NOTTGSPLIT-NEXT:    s_endpgm
2778 ; GFX90A-TGSPLIT-LABEL: system_one_as_release_fence:
2779 ; GFX90A-TGSPLIT:       ; %bb.0: ; %entry
2780 ; GFX90A-TGSPLIT-NEXT:    buffer_wbl2
2781 ; GFX90A-TGSPLIT-NEXT:    s_waitcnt vmcnt(0)
2782 ; GFX90A-TGSPLIT-NEXT:    s_endpgm
2784 ; GFX940-NOTTGSPLIT-LABEL: system_one_as_release_fence:
2785 ; GFX940-NOTTGSPLIT:       ; %bb.0: ; %entry
2786 ; GFX940-NOTTGSPLIT-NEXT:    buffer_wbl2 sc0 sc1
2787 ; GFX940-NOTTGSPLIT-NEXT:    s_waitcnt vmcnt(0)
2788 ; GFX940-NOTTGSPLIT-NEXT:    s_endpgm
2790 ; GFX940-TGSPLIT-LABEL: system_one_as_release_fence:
2791 ; GFX940-TGSPLIT:       ; %bb.0: ; %entry
2792 ; GFX940-TGSPLIT-NEXT:    buffer_wbl2 sc0 sc1
2793 ; GFX940-TGSPLIT-NEXT:    s_waitcnt vmcnt(0)
2794 ; GFX940-TGSPLIT-NEXT:    s_endpgm
2796 ; GFX11-WGP-LABEL: system_one_as_release_fence:
2797 ; GFX11-WGP:       ; %bb.0: ; %entry
2798 ; GFX11-WGP-NEXT:    s_waitcnt vmcnt(0)
2799 ; GFX11-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
2800 ; GFX11-WGP-NEXT:    s_endpgm
2802 ; GFX11-CU-LABEL: system_one_as_release_fence:
2803 ; GFX11-CU:       ; %bb.0: ; %entry
2804 ; GFX11-CU-NEXT:    s_waitcnt vmcnt(0)
2805 ; GFX11-CU-NEXT:    s_waitcnt_vscnt null, 0x0
2806 ; GFX11-CU-NEXT:    s_endpgm
2808 ; GFX12-WGP-LABEL: system_one_as_release_fence:
2809 ; GFX12-WGP:       ; %bb.0: ; %entry
2810 ; GFX12-WGP-NEXT:    global_wb scope:SCOPE_SYS
2811 ; GFX12-WGP-NEXT:    s_wait_bvhcnt 0x0
2812 ; GFX12-WGP-NEXT:    s_wait_samplecnt 0x0
2813 ; GFX12-WGP-NEXT:    s_wait_loadcnt 0x0
2814 ; GFX12-WGP-NEXT:    s_wait_storecnt 0x0
2815 ; GFX12-WGP-NEXT:    s_endpgm
2817 ; GFX12-CU-LABEL: system_one_as_release_fence:
2818 ; GFX12-CU:       ; %bb.0: ; %entry
2819 ; GFX12-CU-NEXT:    global_wb scope:SCOPE_SYS
2820 ; GFX12-CU-NEXT:    s_wait_bvhcnt 0x0
2821 ; GFX12-CU-NEXT:    s_wait_samplecnt 0x0
2822 ; GFX12-CU-NEXT:    s_wait_loadcnt 0x0
2823 ; GFX12-CU-NEXT:    s_wait_storecnt 0x0
2824 ; GFX12-CU-NEXT:    s_endpgm
2825 entry:
2826   fence syncscope("one-as") release
2827   ret void
2830 define amdgpu_kernel void @system_one_as_acq_rel_fence() {
2831 ; GFX6-LABEL: system_one_as_acq_rel_fence:
2832 ; GFX6:       ; %bb.0: ; %entry
2833 ; GFX6-NEXT:    s_waitcnt vmcnt(0)
2834 ; GFX6-NEXT:    buffer_wbinvl1
2835 ; GFX6-NEXT:    s_endpgm
2837 ; GFX7-LABEL: system_one_as_acq_rel_fence:
2838 ; GFX7:       ; %bb.0: ; %entry
2839 ; GFX7-NEXT:    s_waitcnt vmcnt(0)
2840 ; GFX7-NEXT:    buffer_wbinvl1_vol
2841 ; GFX7-NEXT:    s_endpgm
2843 ; GFX10-WGP-LABEL: system_one_as_acq_rel_fence:
2844 ; GFX10-WGP:       ; %bb.0: ; %entry
2845 ; GFX10-WGP-NEXT:    s_waitcnt vmcnt(0)
2846 ; GFX10-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
2847 ; GFX10-WGP-NEXT:    buffer_gl1_inv
2848 ; GFX10-WGP-NEXT:    buffer_gl0_inv
2849 ; GFX10-WGP-NEXT:    s_endpgm
2851 ; GFX10-CU-LABEL: system_one_as_acq_rel_fence:
2852 ; GFX10-CU:       ; %bb.0: ; %entry
2853 ; GFX10-CU-NEXT:    s_waitcnt vmcnt(0)
2854 ; GFX10-CU-NEXT:    s_waitcnt_vscnt null, 0x0
2855 ; GFX10-CU-NEXT:    buffer_gl1_inv
2856 ; GFX10-CU-NEXT:    buffer_gl0_inv
2857 ; GFX10-CU-NEXT:    s_endpgm
2859 ; SKIP-CACHE-INV-LABEL: system_one_as_acq_rel_fence:
2860 ; SKIP-CACHE-INV:       ; %bb.0: ; %entry
2861 ; SKIP-CACHE-INV-NEXT:    s_waitcnt vmcnt(0)
2862 ; SKIP-CACHE-INV-NEXT:    s_endpgm
2864 ; GFX90A-NOTTGSPLIT-LABEL: system_one_as_acq_rel_fence:
2865 ; GFX90A-NOTTGSPLIT:       ; %bb.0: ; %entry
2866 ; GFX90A-NOTTGSPLIT-NEXT:    buffer_wbl2
2867 ; GFX90A-NOTTGSPLIT-NEXT:    s_waitcnt vmcnt(0)
2868 ; GFX90A-NOTTGSPLIT-NEXT:    buffer_invl2
2869 ; GFX90A-NOTTGSPLIT-NEXT:    buffer_wbinvl1_vol
2870 ; GFX90A-NOTTGSPLIT-NEXT:    s_endpgm
2872 ; GFX90A-TGSPLIT-LABEL: system_one_as_acq_rel_fence:
2873 ; GFX90A-TGSPLIT:       ; %bb.0: ; %entry
2874 ; GFX90A-TGSPLIT-NEXT:    buffer_wbl2
2875 ; GFX90A-TGSPLIT-NEXT:    s_waitcnt vmcnt(0)
2876 ; GFX90A-TGSPLIT-NEXT:    buffer_invl2
2877 ; GFX90A-TGSPLIT-NEXT:    buffer_wbinvl1_vol
2878 ; GFX90A-TGSPLIT-NEXT:    s_endpgm
2880 ; GFX940-NOTTGSPLIT-LABEL: system_one_as_acq_rel_fence:
2881 ; GFX940-NOTTGSPLIT:       ; %bb.0: ; %entry
2882 ; GFX940-NOTTGSPLIT-NEXT:    buffer_wbl2 sc0 sc1
2883 ; GFX940-NOTTGSPLIT-NEXT:    s_waitcnt vmcnt(0)
2884 ; GFX940-NOTTGSPLIT-NEXT:    buffer_inv sc0 sc1
2885 ; GFX940-NOTTGSPLIT-NEXT:    s_endpgm
2887 ; GFX940-TGSPLIT-LABEL: system_one_as_acq_rel_fence:
2888 ; GFX940-TGSPLIT:       ; %bb.0: ; %entry
2889 ; GFX940-TGSPLIT-NEXT:    buffer_wbl2 sc0 sc1
2890 ; GFX940-TGSPLIT-NEXT:    s_waitcnt vmcnt(0)
2891 ; GFX940-TGSPLIT-NEXT:    buffer_inv sc0 sc1
2892 ; GFX940-TGSPLIT-NEXT:    s_endpgm
2894 ; GFX11-WGP-LABEL: system_one_as_acq_rel_fence:
2895 ; GFX11-WGP:       ; %bb.0: ; %entry
2896 ; GFX11-WGP-NEXT:    s_waitcnt vmcnt(0)
2897 ; GFX11-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
2898 ; GFX11-WGP-NEXT:    buffer_gl1_inv
2899 ; GFX11-WGP-NEXT:    buffer_gl0_inv
2900 ; GFX11-WGP-NEXT:    s_endpgm
2902 ; GFX11-CU-LABEL: system_one_as_acq_rel_fence:
2903 ; GFX11-CU:       ; %bb.0: ; %entry
2904 ; GFX11-CU-NEXT:    s_waitcnt vmcnt(0)
2905 ; GFX11-CU-NEXT:    s_waitcnt_vscnt null, 0x0
2906 ; GFX11-CU-NEXT:    buffer_gl1_inv
2907 ; GFX11-CU-NEXT:    buffer_gl0_inv
2908 ; GFX11-CU-NEXT:    s_endpgm
2910 ; GFX12-WGP-LABEL: system_one_as_acq_rel_fence:
2911 ; GFX12-WGP:       ; %bb.0: ; %entry
2912 ; GFX12-WGP-NEXT:    global_wb scope:SCOPE_SYS
2913 ; GFX12-WGP-NEXT:    s_wait_bvhcnt 0x0
2914 ; GFX12-WGP-NEXT:    s_wait_samplecnt 0x0
2915 ; GFX12-WGP-NEXT:    s_wait_loadcnt 0x0
2916 ; GFX12-WGP-NEXT:    s_wait_storecnt 0x0
2917 ; GFX12-WGP-NEXT:    global_inv scope:SCOPE_SYS
2918 ; GFX12-WGP-NEXT:    s_endpgm
2920 ; GFX12-CU-LABEL: system_one_as_acq_rel_fence:
2921 ; GFX12-CU:       ; %bb.0: ; %entry
2922 ; GFX12-CU-NEXT:    global_wb scope:SCOPE_SYS
2923 ; GFX12-CU-NEXT:    s_wait_bvhcnt 0x0
2924 ; GFX12-CU-NEXT:    s_wait_samplecnt 0x0
2925 ; GFX12-CU-NEXT:    s_wait_loadcnt 0x0
2926 ; GFX12-CU-NEXT:    s_wait_storecnt 0x0
2927 ; GFX12-CU-NEXT:    global_inv scope:SCOPE_SYS
2928 ; GFX12-CU-NEXT:    s_endpgm
2929 entry:
2930   fence syncscope("one-as") acq_rel
2931   ret void
2934 define amdgpu_kernel void @system_one_as_seq_cst_fence() {
2935 ; GFX6-LABEL: system_one_as_seq_cst_fence:
2936 ; GFX6:       ; %bb.0: ; %entry
2937 ; GFX6-NEXT:    s_waitcnt vmcnt(0)
2938 ; GFX6-NEXT:    buffer_wbinvl1
2939 ; GFX6-NEXT:    s_endpgm
2941 ; GFX7-LABEL: system_one_as_seq_cst_fence:
2942 ; GFX7:       ; %bb.0: ; %entry
2943 ; GFX7-NEXT:    s_waitcnt vmcnt(0)
2944 ; GFX7-NEXT:    buffer_wbinvl1_vol
2945 ; GFX7-NEXT:    s_endpgm
2947 ; GFX10-WGP-LABEL: system_one_as_seq_cst_fence:
2948 ; GFX10-WGP:       ; %bb.0: ; %entry
2949 ; GFX10-WGP-NEXT:    s_waitcnt vmcnt(0)
2950 ; GFX10-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
2951 ; GFX10-WGP-NEXT:    buffer_gl1_inv
2952 ; GFX10-WGP-NEXT:    buffer_gl0_inv
2953 ; GFX10-WGP-NEXT:    s_endpgm
2955 ; GFX10-CU-LABEL: system_one_as_seq_cst_fence:
2956 ; GFX10-CU:       ; %bb.0: ; %entry
2957 ; GFX10-CU-NEXT:    s_waitcnt vmcnt(0)
2958 ; GFX10-CU-NEXT:    s_waitcnt_vscnt null, 0x0
2959 ; GFX10-CU-NEXT:    buffer_gl1_inv
2960 ; GFX10-CU-NEXT:    buffer_gl0_inv
2961 ; GFX10-CU-NEXT:    s_endpgm
2963 ; SKIP-CACHE-INV-LABEL: system_one_as_seq_cst_fence:
2964 ; SKIP-CACHE-INV:       ; %bb.0: ; %entry
2965 ; SKIP-CACHE-INV-NEXT:    s_waitcnt vmcnt(0)
2966 ; SKIP-CACHE-INV-NEXT:    s_endpgm
2968 ; GFX90A-NOTTGSPLIT-LABEL: system_one_as_seq_cst_fence:
2969 ; GFX90A-NOTTGSPLIT:       ; %bb.0: ; %entry
2970 ; GFX90A-NOTTGSPLIT-NEXT:    buffer_wbl2
2971 ; GFX90A-NOTTGSPLIT-NEXT:    s_waitcnt vmcnt(0)
2972 ; GFX90A-NOTTGSPLIT-NEXT:    buffer_invl2
2973 ; GFX90A-NOTTGSPLIT-NEXT:    buffer_wbinvl1_vol
2974 ; GFX90A-NOTTGSPLIT-NEXT:    s_endpgm
2976 ; GFX90A-TGSPLIT-LABEL: system_one_as_seq_cst_fence:
2977 ; GFX90A-TGSPLIT:       ; %bb.0: ; %entry
2978 ; GFX90A-TGSPLIT-NEXT:    buffer_wbl2
2979 ; GFX90A-TGSPLIT-NEXT:    s_waitcnt vmcnt(0)
2980 ; GFX90A-TGSPLIT-NEXT:    buffer_invl2
2981 ; GFX90A-TGSPLIT-NEXT:    buffer_wbinvl1_vol
2982 ; GFX90A-TGSPLIT-NEXT:    s_endpgm
2984 ; GFX940-NOTTGSPLIT-LABEL: system_one_as_seq_cst_fence:
2985 ; GFX940-NOTTGSPLIT:       ; %bb.0: ; %entry
2986 ; GFX940-NOTTGSPLIT-NEXT:    buffer_wbl2 sc0 sc1
2987 ; GFX940-NOTTGSPLIT-NEXT:    s_waitcnt vmcnt(0)
2988 ; GFX940-NOTTGSPLIT-NEXT:    buffer_inv sc0 sc1
2989 ; GFX940-NOTTGSPLIT-NEXT:    s_endpgm
2991 ; GFX940-TGSPLIT-LABEL: system_one_as_seq_cst_fence:
2992 ; GFX940-TGSPLIT:       ; %bb.0: ; %entry
2993 ; GFX940-TGSPLIT-NEXT:    buffer_wbl2 sc0 sc1
2994 ; GFX940-TGSPLIT-NEXT:    s_waitcnt vmcnt(0)
2995 ; GFX940-TGSPLIT-NEXT:    buffer_inv sc0 sc1
2996 ; GFX940-TGSPLIT-NEXT:    s_endpgm
2998 ; GFX11-WGP-LABEL: system_one_as_seq_cst_fence:
2999 ; GFX11-WGP:       ; %bb.0: ; %entry
3000 ; GFX11-WGP-NEXT:    s_waitcnt vmcnt(0)
3001 ; GFX11-WGP-NEXT:    s_waitcnt_vscnt null, 0x0
3002 ; GFX11-WGP-NEXT:    buffer_gl1_inv
3003 ; GFX11-WGP-NEXT:    buffer_gl0_inv
3004 ; GFX11-WGP-NEXT:    s_endpgm
3006 ; GFX11-CU-LABEL: system_one_as_seq_cst_fence:
3007 ; GFX11-CU:       ; %bb.0: ; %entry
3008 ; GFX11-CU-NEXT:    s_waitcnt vmcnt(0)
3009 ; GFX11-CU-NEXT:    s_waitcnt_vscnt null, 0x0
3010 ; GFX11-CU-NEXT:    buffer_gl1_inv
3011 ; GFX11-CU-NEXT:    buffer_gl0_inv
3012 ; GFX11-CU-NEXT:    s_endpgm
3014 ; GFX12-WGP-LABEL: system_one_as_seq_cst_fence:
3015 ; GFX12-WGP:       ; %bb.0: ; %entry
3016 ; GFX12-WGP-NEXT:    global_wb scope:SCOPE_SYS
3017 ; GFX12-WGP-NEXT:    s_wait_bvhcnt 0x0
3018 ; GFX12-WGP-NEXT:    s_wait_samplecnt 0x0
3019 ; GFX12-WGP-NEXT:    s_wait_loadcnt 0x0
3020 ; GFX12-WGP-NEXT:    s_wait_storecnt 0x0
3021 ; GFX12-WGP-NEXT:    global_inv scope:SCOPE_SYS
3022 ; GFX12-WGP-NEXT:    s_endpgm
3024 ; GFX12-CU-LABEL: system_one_as_seq_cst_fence:
3025 ; GFX12-CU:       ; %bb.0: ; %entry
3026 ; GFX12-CU-NEXT:    global_wb scope:SCOPE_SYS
3027 ; GFX12-CU-NEXT:    s_wait_bvhcnt 0x0
3028 ; GFX12-CU-NEXT:    s_wait_samplecnt 0x0
3029 ; GFX12-CU-NEXT:    s_wait_loadcnt 0x0
3030 ; GFX12-CU-NEXT:    s_wait_storecnt 0x0
3031 ; GFX12-CU-NEXT:    global_inv scope:SCOPE_SYS
3032 ; GFX12-CU-NEXT:    s_endpgm
3033 entry:
3034   fence syncscope("one-as") seq_cst
3035   ret void