Bump version to 19.1.0-rc3
[llvm-project.git] / llvm / test / CodeGen / AMDGPU / GlobalISel / memory-legalizer-atomic-fence.ll
blob66037615f0ba037547e4b790ddf8f956507df43c
1 ; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 4
2 ; RUN: llc -global-isel -stop-after=si-memory-legalizer -mtriple=amdgcn-amd- -mcpu=gfx600 < %s | FileCheck -check-prefix=GFX6 %s
3 ; RUN: llc -global-isel -stop-after=si-memory-legalizer -mtriple=amdgcn-amd- -mcpu=gfx803 < %s | FileCheck -check-prefix=GFX8 %s
4 ; RUN: llc -global-isel -stop-after=si-memory-legalizer -mtriple=amdgcn-amd-amdhsa -mcpu=gfx803 < %s | FileCheck -check-prefix=GFX8 %s
5 ; RUN: llc -global-isel -stop-after=si-memory-legalizer -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1010 < %s | FileCheck -check-prefix=GFX10WGP %s
6 ; RUN: llc -global-isel -stop-after=si-memory-legalizer -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1010 -mattr=+cumode < %s | FileCheck -check-prefix=GFX10CU %s
7 ; RUN: llc -global-isel -stop-after=si-memory-legalizer -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1100 < %s | FileCheck -check-prefix=GFX11WGP %s
8 ; RUN: llc -global-isel -stop-after=si-memory-legalizer -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1100 -mattr=+cumode < %s | FileCheck -check-prefix=GFX11CU %s
10 ; Note: we use MIR test checks + stop after legalizer to prevent
11 ; tests from being optimized out.
13 define amdgpu_kernel void @system_one_as_acquire() #0 {
14   ; GFX6-LABEL: name: system_one_as_acquire
15   ; GFX6: bb.0.entry:
16   ; GFX6-NEXT:   S_WAITCNT_soft 3952
17   ; GFX6-NEXT:   BUFFER_WBINVL1 implicit $exec
18   ; GFX6-NEXT:   S_ENDPGM 0
19   ;
20   ; GFX8-LABEL: name: system_one_as_acquire
21   ; GFX8: bb.0.entry:
22   ; GFX8-NEXT:   S_WAITCNT_soft 3952
23   ; GFX8-NEXT:   BUFFER_WBINVL1_VOL implicit $exec
24   ; GFX8-NEXT:   S_ENDPGM 0
25   ;
26   ; GFX10WGP-LABEL: name: system_one_as_acquire
27   ; GFX10WGP: bb.0.entry:
28   ; GFX10WGP-NEXT:   S_WAITCNT_soft 16240
29   ; GFX10WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
30   ; GFX10WGP-NEXT:   BUFFER_GL1_INV implicit $exec
31   ; GFX10WGP-NEXT:   BUFFER_GL0_INV implicit $exec
32   ; GFX10WGP-NEXT:   S_ENDPGM 0
33   ;
34   ; GFX10CU-LABEL: name: system_one_as_acquire
35   ; GFX10CU: bb.0.entry:
36   ; GFX10CU-NEXT:   S_WAITCNT_soft 16240
37   ; GFX10CU-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
38   ; GFX10CU-NEXT:   BUFFER_GL1_INV implicit $exec
39   ; GFX10CU-NEXT:   BUFFER_GL0_INV implicit $exec
40   ; GFX10CU-NEXT:   S_ENDPGM 0
41   ;
42   ; GFX11WGP-LABEL: name: system_one_as_acquire
43   ; GFX11WGP: bb.0.entry:
44   ; GFX11WGP-NEXT:   S_WAITCNT_soft 1015
45   ; GFX11WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
46   ; GFX11WGP-NEXT:   BUFFER_GL1_INV implicit $exec
47   ; GFX11WGP-NEXT:   BUFFER_GL0_INV implicit $exec
48   ; GFX11WGP-NEXT:   S_ENDPGM 0
49   ;
50   ; GFX11CU-LABEL: name: system_one_as_acquire
51   ; GFX11CU: bb.0.entry:
52   ; GFX11CU-NEXT:   S_WAITCNT_soft 1015
53   ; GFX11CU-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
54   ; GFX11CU-NEXT:   BUFFER_GL1_INV implicit $exec
55   ; GFX11CU-NEXT:   BUFFER_GL0_INV implicit $exec
56   ; GFX11CU-NEXT:   S_ENDPGM 0
57 entry:
58   fence syncscope("one-as") acquire
59   ret void
62 define amdgpu_kernel void @system_one_as_release() #0 {
63   ; GFX6-LABEL: name: system_one_as_release
64   ; GFX6: bb.0.entry:
65   ; GFX6-NEXT:   S_WAITCNT_soft 3952
66   ; GFX6-NEXT:   S_ENDPGM 0
67   ;
68   ; GFX8-LABEL: name: system_one_as_release
69   ; GFX8: bb.0.entry:
70   ; GFX8-NEXT:   S_WAITCNT_soft 3952
71   ; GFX8-NEXT:   S_ENDPGM 0
72   ;
73   ; GFX10WGP-LABEL: name: system_one_as_release
74   ; GFX10WGP: bb.0.entry:
75   ; GFX10WGP-NEXT:   S_WAITCNT_soft 16240
76   ; GFX10WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
77   ; GFX10WGP-NEXT:   S_ENDPGM 0
78   ;
79   ; GFX10CU-LABEL: name: system_one_as_release
80   ; GFX10CU: bb.0.entry:
81   ; GFX10CU-NEXT:   S_WAITCNT_soft 16240
82   ; GFX10CU-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
83   ; GFX10CU-NEXT:   S_ENDPGM 0
84   ;
85   ; GFX11WGP-LABEL: name: system_one_as_release
86   ; GFX11WGP: bb.0.entry:
87   ; GFX11WGP-NEXT:   S_WAITCNT_soft 1015
88   ; GFX11WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
89   ; GFX11WGP-NEXT:   S_ENDPGM 0
90   ;
91   ; GFX11CU-LABEL: name: system_one_as_release
92   ; GFX11CU: bb.0.entry:
93   ; GFX11CU-NEXT:   S_WAITCNT_soft 1015
94   ; GFX11CU-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
95   ; GFX11CU-NEXT:   S_ENDPGM 0
96 entry:
97   fence syncscope("one-as") release
98   ret void
101 define amdgpu_kernel void @system_one_as_acq_rel() #0 {
102   ; GFX6-LABEL: name: system_one_as_acq_rel
103   ; GFX6: bb.0.entry:
104   ; GFX6-NEXT:   S_WAITCNT_soft 3952
105   ; GFX6-NEXT:   BUFFER_WBINVL1 implicit $exec
106   ; GFX6-NEXT:   S_ENDPGM 0
107   ;
108   ; GFX8-LABEL: name: system_one_as_acq_rel
109   ; GFX8: bb.0.entry:
110   ; GFX8-NEXT:   S_WAITCNT_soft 3952
111   ; GFX8-NEXT:   BUFFER_WBINVL1_VOL implicit $exec
112   ; GFX8-NEXT:   S_ENDPGM 0
113   ;
114   ; GFX10WGP-LABEL: name: system_one_as_acq_rel
115   ; GFX10WGP: bb.0.entry:
116   ; GFX10WGP-NEXT:   S_WAITCNT_soft 16240
117   ; GFX10WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
118   ; GFX10WGP-NEXT:   BUFFER_GL1_INV implicit $exec
119   ; GFX10WGP-NEXT:   BUFFER_GL0_INV implicit $exec
120   ; GFX10WGP-NEXT:   S_ENDPGM 0
121   ;
122   ; GFX10CU-LABEL: name: system_one_as_acq_rel
123   ; GFX10CU: bb.0.entry:
124   ; GFX10CU-NEXT:   S_WAITCNT_soft 16240
125   ; GFX10CU-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
126   ; GFX10CU-NEXT:   BUFFER_GL1_INV implicit $exec
127   ; GFX10CU-NEXT:   BUFFER_GL0_INV implicit $exec
128   ; GFX10CU-NEXT:   S_ENDPGM 0
129   ;
130   ; GFX11WGP-LABEL: name: system_one_as_acq_rel
131   ; GFX11WGP: bb.0.entry:
132   ; GFX11WGP-NEXT:   S_WAITCNT_soft 1015
133   ; GFX11WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
134   ; GFX11WGP-NEXT:   BUFFER_GL1_INV implicit $exec
135   ; GFX11WGP-NEXT:   BUFFER_GL0_INV implicit $exec
136   ; GFX11WGP-NEXT:   S_ENDPGM 0
137   ;
138   ; GFX11CU-LABEL: name: system_one_as_acq_rel
139   ; GFX11CU: bb.0.entry:
140   ; GFX11CU-NEXT:   S_WAITCNT_soft 1015
141   ; GFX11CU-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
142   ; GFX11CU-NEXT:   BUFFER_GL1_INV implicit $exec
143   ; GFX11CU-NEXT:   BUFFER_GL0_INV implicit $exec
144   ; GFX11CU-NEXT:   S_ENDPGM 0
145 entry:
146   fence syncscope("one-as") acq_rel
147   ret void
150 define amdgpu_kernel void @system_one_as_seq_cst() #0 {
151   ; GFX6-LABEL: name: system_one_as_seq_cst
152   ; GFX6: bb.0.entry:
153   ; GFX6-NEXT:   S_WAITCNT_soft 3952
154   ; GFX6-NEXT:   BUFFER_WBINVL1 implicit $exec
155   ; GFX6-NEXT:   S_ENDPGM 0
156   ;
157   ; GFX8-LABEL: name: system_one_as_seq_cst
158   ; GFX8: bb.0.entry:
159   ; GFX8-NEXT:   S_WAITCNT_soft 3952
160   ; GFX8-NEXT:   BUFFER_WBINVL1_VOL implicit $exec
161   ; GFX8-NEXT:   S_ENDPGM 0
162   ;
163   ; GFX10WGP-LABEL: name: system_one_as_seq_cst
164   ; GFX10WGP: bb.0.entry:
165   ; GFX10WGP-NEXT:   S_WAITCNT_soft 16240
166   ; GFX10WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
167   ; GFX10WGP-NEXT:   BUFFER_GL1_INV implicit $exec
168   ; GFX10WGP-NEXT:   BUFFER_GL0_INV implicit $exec
169   ; GFX10WGP-NEXT:   S_ENDPGM 0
170   ;
171   ; GFX10CU-LABEL: name: system_one_as_seq_cst
172   ; GFX10CU: bb.0.entry:
173   ; GFX10CU-NEXT:   S_WAITCNT_soft 16240
174   ; GFX10CU-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
175   ; GFX10CU-NEXT:   BUFFER_GL1_INV implicit $exec
176   ; GFX10CU-NEXT:   BUFFER_GL0_INV implicit $exec
177   ; GFX10CU-NEXT:   S_ENDPGM 0
178   ;
179   ; GFX11WGP-LABEL: name: system_one_as_seq_cst
180   ; GFX11WGP: bb.0.entry:
181   ; GFX11WGP-NEXT:   S_WAITCNT_soft 1015
182   ; GFX11WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
183   ; GFX11WGP-NEXT:   BUFFER_GL1_INV implicit $exec
184   ; GFX11WGP-NEXT:   BUFFER_GL0_INV implicit $exec
185   ; GFX11WGP-NEXT:   S_ENDPGM 0
186   ;
187   ; GFX11CU-LABEL: name: system_one_as_seq_cst
188   ; GFX11CU: bb.0.entry:
189   ; GFX11CU-NEXT:   S_WAITCNT_soft 1015
190   ; GFX11CU-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
191   ; GFX11CU-NEXT:   BUFFER_GL1_INV implicit $exec
192   ; GFX11CU-NEXT:   BUFFER_GL0_INV implicit $exec
193   ; GFX11CU-NEXT:   S_ENDPGM 0
194 entry:
195   fence syncscope("one-as") seq_cst
196   ret void
199 define amdgpu_kernel void @singlethread_one_as_acquire() #0 {
200   ; GFX6-LABEL: name: singlethread_one_as_acquire
201   ; GFX6: bb.0.entry:
202   ; GFX6-NEXT:   S_ENDPGM 0
203   ;
204   ; GFX8-LABEL: name: singlethread_one_as_acquire
205   ; GFX8: bb.0.entry:
206   ; GFX8-NEXT:   S_ENDPGM 0
207   ;
208   ; GFX10WGP-LABEL: name: singlethread_one_as_acquire
209   ; GFX10WGP: bb.0.entry:
210   ; GFX10WGP-NEXT:   S_ENDPGM 0
211   ;
212   ; GFX10CU-LABEL: name: singlethread_one_as_acquire
213   ; GFX10CU: bb.0.entry:
214   ; GFX10CU-NEXT:   S_ENDPGM 0
215   ;
216   ; GFX11WGP-LABEL: name: singlethread_one_as_acquire
217   ; GFX11WGP: bb.0.entry:
218   ; GFX11WGP-NEXT:   S_ENDPGM 0
219   ;
220   ; GFX11CU-LABEL: name: singlethread_one_as_acquire
221   ; GFX11CU: bb.0.entry:
222   ; GFX11CU-NEXT:   S_ENDPGM 0
223 entry:
224   fence syncscope("singlethread-one-as") acquire
225   ret void
228 define amdgpu_kernel void @singlethread_one_as_release() #0 {
229   ; GFX6-LABEL: name: singlethread_one_as_release
230   ; GFX6: bb.0.entry:
231   ; GFX6-NEXT:   S_ENDPGM 0
232   ;
233   ; GFX8-LABEL: name: singlethread_one_as_release
234   ; GFX8: bb.0.entry:
235   ; GFX8-NEXT:   S_ENDPGM 0
236   ;
237   ; GFX10WGP-LABEL: name: singlethread_one_as_release
238   ; GFX10WGP: bb.0.entry:
239   ; GFX10WGP-NEXT:   S_ENDPGM 0
240   ;
241   ; GFX10CU-LABEL: name: singlethread_one_as_release
242   ; GFX10CU: bb.0.entry:
243   ; GFX10CU-NEXT:   S_ENDPGM 0
244   ;
245   ; GFX11WGP-LABEL: name: singlethread_one_as_release
246   ; GFX11WGP: bb.0.entry:
247   ; GFX11WGP-NEXT:   S_ENDPGM 0
248   ;
249   ; GFX11CU-LABEL: name: singlethread_one_as_release
250   ; GFX11CU: bb.0.entry:
251   ; GFX11CU-NEXT:   S_ENDPGM 0
252 entry:
253   fence syncscope("singlethread-one-as") release
254   ret void
257 define amdgpu_kernel void @singlethread_one_as_acq_rel() #0 {
258   ; GFX6-LABEL: name: singlethread_one_as_acq_rel
259   ; GFX6: bb.0.entry:
260   ; GFX6-NEXT:   S_ENDPGM 0
261   ;
262   ; GFX8-LABEL: name: singlethread_one_as_acq_rel
263   ; GFX8: bb.0.entry:
264   ; GFX8-NEXT:   S_ENDPGM 0
265   ;
266   ; GFX10WGP-LABEL: name: singlethread_one_as_acq_rel
267   ; GFX10WGP: bb.0.entry:
268   ; GFX10WGP-NEXT:   S_ENDPGM 0
269   ;
270   ; GFX10CU-LABEL: name: singlethread_one_as_acq_rel
271   ; GFX10CU: bb.0.entry:
272   ; GFX10CU-NEXT:   S_ENDPGM 0
273   ;
274   ; GFX11WGP-LABEL: name: singlethread_one_as_acq_rel
275   ; GFX11WGP: bb.0.entry:
276   ; GFX11WGP-NEXT:   S_ENDPGM 0
277   ;
278   ; GFX11CU-LABEL: name: singlethread_one_as_acq_rel
279   ; GFX11CU: bb.0.entry:
280   ; GFX11CU-NEXT:   S_ENDPGM 0
281 entry:
282   fence syncscope("singlethread-one-as") acq_rel
283   ret void
286 define amdgpu_kernel void @singlethread_one_as_seq_cst() #0 {
287   ; GFX6-LABEL: name: singlethread_one_as_seq_cst
288   ; GFX6: bb.0.entry:
289   ; GFX6-NEXT:   S_ENDPGM 0
290   ;
291   ; GFX8-LABEL: name: singlethread_one_as_seq_cst
292   ; GFX8: bb.0.entry:
293   ; GFX8-NEXT:   S_ENDPGM 0
294   ;
295   ; GFX10WGP-LABEL: name: singlethread_one_as_seq_cst
296   ; GFX10WGP: bb.0.entry:
297   ; GFX10WGP-NEXT:   S_ENDPGM 0
298   ;
299   ; GFX10CU-LABEL: name: singlethread_one_as_seq_cst
300   ; GFX10CU: bb.0.entry:
301   ; GFX10CU-NEXT:   S_ENDPGM 0
302   ;
303   ; GFX11WGP-LABEL: name: singlethread_one_as_seq_cst
304   ; GFX11WGP: bb.0.entry:
305   ; GFX11WGP-NEXT:   S_ENDPGM 0
306   ;
307   ; GFX11CU-LABEL: name: singlethread_one_as_seq_cst
308   ; GFX11CU: bb.0.entry:
309   ; GFX11CU-NEXT:   S_ENDPGM 0
310 entry:
311   fence syncscope("singlethread-one-as") seq_cst
312   ret void
315 define amdgpu_kernel void @agent_one_as_acquire() #0 {
316   ; GFX6-LABEL: name: agent_one_as_acquire
317   ; GFX6: bb.0.entry:
318   ; GFX6-NEXT:   S_WAITCNT_soft 3952
319   ; GFX6-NEXT:   BUFFER_WBINVL1 implicit $exec
320   ; GFX6-NEXT:   S_ENDPGM 0
321   ;
322   ; GFX8-LABEL: name: agent_one_as_acquire
323   ; GFX8: bb.0.entry:
324   ; GFX8-NEXT:   S_WAITCNT_soft 3952
325   ; GFX8-NEXT:   BUFFER_WBINVL1_VOL implicit $exec
326   ; GFX8-NEXT:   S_ENDPGM 0
327   ;
328   ; GFX10WGP-LABEL: name: agent_one_as_acquire
329   ; GFX10WGP: bb.0.entry:
330   ; GFX10WGP-NEXT:   S_WAITCNT_soft 16240
331   ; GFX10WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
332   ; GFX10WGP-NEXT:   BUFFER_GL1_INV implicit $exec
333   ; GFX10WGP-NEXT:   BUFFER_GL0_INV implicit $exec
334   ; GFX10WGP-NEXT:   S_ENDPGM 0
335   ;
336   ; GFX10CU-LABEL: name: agent_one_as_acquire
337   ; GFX10CU: bb.0.entry:
338   ; GFX10CU-NEXT:   S_WAITCNT_soft 16240
339   ; GFX10CU-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
340   ; GFX10CU-NEXT:   BUFFER_GL1_INV implicit $exec
341   ; GFX10CU-NEXT:   BUFFER_GL0_INV implicit $exec
342   ; GFX10CU-NEXT:   S_ENDPGM 0
343   ;
344   ; GFX11WGP-LABEL: name: agent_one_as_acquire
345   ; GFX11WGP: bb.0.entry:
346   ; GFX11WGP-NEXT:   S_WAITCNT_soft 1015
347   ; GFX11WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
348   ; GFX11WGP-NEXT:   BUFFER_GL1_INV implicit $exec
349   ; GFX11WGP-NEXT:   BUFFER_GL0_INV implicit $exec
350   ; GFX11WGP-NEXT:   S_ENDPGM 0
351   ;
352   ; GFX11CU-LABEL: name: agent_one_as_acquire
353   ; GFX11CU: bb.0.entry:
354   ; GFX11CU-NEXT:   S_WAITCNT_soft 1015
355   ; GFX11CU-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
356   ; GFX11CU-NEXT:   BUFFER_GL1_INV implicit $exec
357   ; GFX11CU-NEXT:   BUFFER_GL0_INV implicit $exec
358   ; GFX11CU-NEXT:   S_ENDPGM 0
359 entry:
360   fence syncscope("agent-one-as") acquire
361   ret void
364 define amdgpu_kernel void @agent_one_as_release() #0 {
365   ; GFX6-LABEL: name: agent_one_as_release
366   ; GFX6: bb.0.entry:
367   ; GFX6-NEXT:   S_WAITCNT_soft 3952
368   ; GFX6-NEXT:   S_ENDPGM 0
369   ;
370   ; GFX8-LABEL: name: agent_one_as_release
371   ; GFX8: bb.0.entry:
372   ; GFX8-NEXT:   S_WAITCNT_soft 3952
373   ; GFX8-NEXT:   S_ENDPGM 0
374   ;
375   ; GFX10WGP-LABEL: name: agent_one_as_release
376   ; GFX10WGP: bb.0.entry:
377   ; GFX10WGP-NEXT:   S_WAITCNT_soft 16240
378   ; GFX10WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
379   ; GFX10WGP-NEXT:   S_ENDPGM 0
380   ;
381   ; GFX10CU-LABEL: name: agent_one_as_release
382   ; GFX10CU: bb.0.entry:
383   ; GFX10CU-NEXT:   S_WAITCNT_soft 16240
384   ; GFX10CU-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
385   ; GFX10CU-NEXT:   S_ENDPGM 0
386   ;
387   ; GFX11WGP-LABEL: name: agent_one_as_release
388   ; GFX11WGP: bb.0.entry:
389   ; GFX11WGP-NEXT:   S_WAITCNT_soft 1015
390   ; GFX11WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
391   ; GFX11WGP-NEXT:   S_ENDPGM 0
392   ;
393   ; GFX11CU-LABEL: name: agent_one_as_release
394   ; GFX11CU: bb.0.entry:
395   ; GFX11CU-NEXT:   S_WAITCNT_soft 1015
396   ; GFX11CU-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
397   ; GFX11CU-NEXT:   S_ENDPGM 0
398 entry:
399   fence syncscope("agent-one-as") release
400   ret void
403 define amdgpu_kernel void @agent_one_as_acq_rel() #0 {
404   ; GFX6-LABEL: name: agent_one_as_acq_rel
405   ; GFX6: bb.0.entry:
406   ; GFX6-NEXT:   S_WAITCNT_soft 3952
407   ; GFX6-NEXT:   BUFFER_WBINVL1 implicit $exec
408   ; GFX6-NEXT:   S_ENDPGM 0
409   ;
410   ; GFX8-LABEL: name: agent_one_as_acq_rel
411   ; GFX8: bb.0.entry:
412   ; GFX8-NEXT:   S_WAITCNT_soft 3952
413   ; GFX8-NEXT:   BUFFER_WBINVL1_VOL implicit $exec
414   ; GFX8-NEXT:   S_ENDPGM 0
415   ;
416   ; GFX10WGP-LABEL: name: agent_one_as_acq_rel
417   ; GFX10WGP: bb.0.entry:
418   ; GFX10WGP-NEXT:   S_WAITCNT_soft 16240
419   ; GFX10WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
420   ; GFX10WGP-NEXT:   BUFFER_GL1_INV implicit $exec
421   ; GFX10WGP-NEXT:   BUFFER_GL0_INV implicit $exec
422   ; GFX10WGP-NEXT:   S_ENDPGM 0
423   ;
424   ; GFX10CU-LABEL: name: agent_one_as_acq_rel
425   ; GFX10CU: bb.0.entry:
426   ; GFX10CU-NEXT:   S_WAITCNT_soft 16240
427   ; GFX10CU-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
428   ; GFX10CU-NEXT:   BUFFER_GL1_INV implicit $exec
429   ; GFX10CU-NEXT:   BUFFER_GL0_INV implicit $exec
430   ; GFX10CU-NEXT:   S_ENDPGM 0
431   ;
432   ; GFX11WGP-LABEL: name: agent_one_as_acq_rel
433   ; GFX11WGP: bb.0.entry:
434   ; GFX11WGP-NEXT:   S_WAITCNT_soft 1015
435   ; GFX11WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
436   ; GFX11WGP-NEXT:   BUFFER_GL1_INV implicit $exec
437   ; GFX11WGP-NEXT:   BUFFER_GL0_INV implicit $exec
438   ; GFX11WGP-NEXT:   S_ENDPGM 0
439   ;
440   ; GFX11CU-LABEL: name: agent_one_as_acq_rel
441   ; GFX11CU: bb.0.entry:
442   ; GFX11CU-NEXT:   S_WAITCNT_soft 1015
443   ; GFX11CU-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
444   ; GFX11CU-NEXT:   BUFFER_GL1_INV implicit $exec
445   ; GFX11CU-NEXT:   BUFFER_GL0_INV implicit $exec
446   ; GFX11CU-NEXT:   S_ENDPGM 0
447 entry:
448   fence syncscope("agent-one-as") acq_rel
449   ret void
452 define amdgpu_kernel void @agent_one_as_seq_cst() #0 {
453   ; GFX6-LABEL: name: agent_one_as_seq_cst
454   ; GFX6: bb.0.entry:
455   ; GFX6-NEXT:   S_WAITCNT_soft 3952
456   ; GFX6-NEXT:   BUFFER_WBINVL1 implicit $exec
457   ; GFX6-NEXT:   S_ENDPGM 0
458   ;
459   ; GFX8-LABEL: name: agent_one_as_seq_cst
460   ; GFX8: bb.0.entry:
461   ; GFX8-NEXT:   S_WAITCNT_soft 3952
462   ; GFX8-NEXT:   BUFFER_WBINVL1_VOL implicit $exec
463   ; GFX8-NEXT:   S_ENDPGM 0
464   ;
465   ; GFX10WGP-LABEL: name: agent_one_as_seq_cst
466   ; GFX10WGP: bb.0.entry:
467   ; GFX10WGP-NEXT:   S_WAITCNT_soft 16240
468   ; GFX10WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
469   ; GFX10WGP-NEXT:   BUFFER_GL1_INV implicit $exec
470   ; GFX10WGP-NEXT:   BUFFER_GL0_INV implicit $exec
471   ; GFX10WGP-NEXT:   S_ENDPGM 0
472   ;
473   ; GFX10CU-LABEL: name: agent_one_as_seq_cst
474   ; GFX10CU: bb.0.entry:
475   ; GFX10CU-NEXT:   S_WAITCNT_soft 16240
476   ; GFX10CU-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
477   ; GFX10CU-NEXT:   BUFFER_GL1_INV implicit $exec
478   ; GFX10CU-NEXT:   BUFFER_GL0_INV implicit $exec
479   ; GFX10CU-NEXT:   S_ENDPGM 0
480   ;
481   ; GFX11WGP-LABEL: name: agent_one_as_seq_cst
482   ; GFX11WGP: bb.0.entry:
483   ; GFX11WGP-NEXT:   S_WAITCNT_soft 1015
484   ; GFX11WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
485   ; GFX11WGP-NEXT:   BUFFER_GL1_INV implicit $exec
486   ; GFX11WGP-NEXT:   BUFFER_GL0_INV implicit $exec
487   ; GFX11WGP-NEXT:   S_ENDPGM 0
488   ;
489   ; GFX11CU-LABEL: name: agent_one_as_seq_cst
490   ; GFX11CU: bb.0.entry:
491   ; GFX11CU-NEXT:   S_WAITCNT_soft 1015
492   ; GFX11CU-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
493   ; GFX11CU-NEXT:   BUFFER_GL1_INV implicit $exec
494   ; GFX11CU-NEXT:   BUFFER_GL0_INV implicit $exec
495   ; GFX11CU-NEXT:   S_ENDPGM 0
496 entry:
497   fence syncscope("agent-one-as") seq_cst
498   ret void
501 define amdgpu_kernel void @workgroup_one_as_acquire() #0 {
502   ; GFX6-LABEL: name: workgroup_one_as_acquire
503   ; GFX6: bb.0.entry:
504   ; GFX6-NEXT:   S_ENDPGM 0
505   ;
506   ; GFX8-LABEL: name: workgroup_one_as_acquire
507   ; GFX8: bb.0.entry:
508   ; GFX8-NEXT:   S_ENDPGM 0
509   ;
510   ; GFX10WGP-LABEL: name: workgroup_one_as_acquire
511   ; GFX10WGP: bb.0.entry:
512   ; GFX10WGP-NEXT:   S_WAITCNT_soft 16240
513   ; GFX10WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
514   ; GFX10WGP-NEXT:   BUFFER_GL0_INV implicit $exec
515   ; GFX10WGP-NEXT:   S_ENDPGM 0
516   ;
517   ; GFX10CU-LABEL: name: workgroup_one_as_acquire
518   ; GFX10CU: bb.0.entry:
519   ; GFX10CU-NEXT:   S_ENDPGM 0
520   ;
521   ; GFX11WGP-LABEL: name: workgroup_one_as_acquire
522   ; GFX11WGP: bb.0.entry:
523   ; GFX11WGP-NEXT:   S_WAITCNT_soft 1015
524   ; GFX11WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
525   ; GFX11WGP-NEXT:   BUFFER_GL0_INV implicit $exec
526   ; GFX11WGP-NEXT:   S_ENDPGM 0
527   ;
528   ; GFX11CU-LABEL: name: workgroup_one_as_acquire
529   ; GFX11CU: bb.0.entry:
530   ; GFX11CU-NEXT:   S_ENDPGM 0
531 entry:
532   fence syncscope("workgroup-one-as") acquire
533   ret void
536 define amdgpu_kernel void @workgroup_one_as_release() #0 {
537   ; GFX6-LABEL: name: workgroup_one_as_release
538   ; GFX6: bb.0.entry:
539   ; GFX6-NEXT:   S_ENDPGM 0
540   ;
541   ; GFX8-LABEL: name: workgroup_one_as_release
542   ; GFX8: bb.0.entry:
543   ; GFX8-NEXT:   S_ENDPGM 0
544   ;
545   ; GFX10WGP-LABEL: name: workgroup_one_as_release
546   ; GFX10WGP: bb.0.entry:
547   ; GFX10WGP-NEXT:   S_WAITCNT_soft 16240
548   ; GFX10WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
549   ; GFX10WGP-NEXT:   S_ENDPGM 0
550   ;
551   ; GFX10CU-LABEL: name: workgroup_one_as_release
552   ; GFX10CU: bb.0.entry:
553   ; GFX10CU-NEXT:   S_ENDPGM 0
554   ;
555   ; GFX11WGP-LABEL: name: workgroup_one_as_release
556   ; GFX11WGP: bb.0.entry:
557   ; GFX11WGP-NEXT:   S_WAITCNT_soft 1015
558   ; GFX11WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
559   ; GFX11WGP-NEXT:   S_ENDPGM 0
560   ;
561   ; GFX11CU-LABEL: name: workgroup_one_as_release
562   ; GFX11CU: bb.0.entry:
563   ; GFX11CU-NEXT:   S_ENDPGM 0
564 entry:
565   fence syncscope("workgroup-one-as") release
566   ret void
569 define amdgpu_kernel void @workgroup_one_as_acq_rel() #0 {
570   ; GFX6-LABEL: name: workgroup_one_as_acq_rel
571   ; GFX6: bb.0.entry:
572   ; GFX6-NEXT:   S_ENDPGM 0
573   ;
574   ; GFX8-LABEL: name: workgroup_one_as_acq_rel
575   ; GFX8: bb.0.entry:
576   ; GFX8-NEXT:   S_ENDPGM 0
577   ;
578   ; GFX10WGP-LABEL: name: workgroup_one_as_acq_rel
579   ; GFX10WGP: bb.0.entry:
580   ; GFX10WGP-NEXT:   S_WAITCNT_soft 16240
581   ; GFX10WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
582   ; GFX10WGP-NEXT:   BUFFER_GL0_INV implicit $exec
583   ; GFX10WGP-NEXT:   S_ENDPGM 0
584   ;
585   ; GFX10CU-LABEL: name: workgroup_one_as_acq_rel
586   ; GFX10CU: bb.0.entry:
587   ; GFX10CU-NEXT:   S_ENDPGM 0
588   ;
589   ; GFX11WGP-LABEL: name: workgroup_one_as_acq_rel
590   ; GFX11WGP: bb.0.entry:
591   ; GFX11WGP-NEXT:   S_WAITCNT_soft 1015
592   ; GFX11WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
593   ; GFX11WGP-NEXT:   BUFFER_GL0_INV implicit $exec
594   ; GFX11WGP-NEXT:   S_ENDPGM 0
595   ;
596   ; GFX11CU-LABEL: name: workgroup_one_as_acq_rel
597   ; GFX11CU: bb.0.entry:
598   ; GFX11CU-NEXT:   S_ENDPGM 0
599 entry:
600   fence syncscope("workgroup-one-as") acq_rel
601   ret void
604 define amdgpu_kernel void @workgroup_one_as_seq_cst() #0 {
605   ; GFX6-LABEL: name: workgroup_one_as_seq_cst
606   ; GFX6: bb.0.entry:
607   ; GFX6-NEXT:   S_ENDPGM 0
608   ;
609   ; GFX8-LABEL: name: workgroup_one_as_seq_cst
610   ; GFX8: bb.0.entry:
611   ; GFX8-NEXT:   S_ENDPGM 0
612   ;
613   ; GFX10WGP-LABEL: name: workgroup_one_as_seq_cst
614   ; GFX10WGP: bb.0.entry:
615   ; GFX10WGP-NEXT:   S_WAITCNT_soft 16240
616   ; GFX10WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
617   ; GFX10WGP-NEXT:   BUFFER_GL0_INV implicit $exec
618   ; GFX10WGP-NEXT:   S_ENDPGM 0
619   ;
620   ; GFX10CU-LABEL: name: workgroup_one_as_seq_cst
621   ; GFX10CU: bb.0.entry:
622   ; GFX10CU-NEXT:   S_ENDPGM 0
623   ;
624   ; GFX11WGP-LABEL: name: workgroup_one_as_seq_cst
625   ; GFX11WGP: bb.0.entry:
626   ; GFX11WGP-NEXT:   S_WAITCNT_soft 1015
627   ; GFX11WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
628   ; GFX11WGP-NEXT:   BUFFER_GL0_INV implicit $exec
629   ; GFX11WGP-NEXT:   S_ENDPGM 0
630   ;
631   ; GFX11CU-LABEL: name: workgroup_one_as_seq_cst
632   ; GFX11CU: bb.0.entry:
633   ; GFX11CU-NEXT:   S_ENDPGM 0
634 entry:
635   fence syncscope("workgroup-one-as") seq_cst
636   ret void
639 define amdgpu_kernel void @wavefront_one_as_acquire() #0 {
640   ; GFX6-LABEL: name: wavefront_one_as_acquire
641   ; GFX6: bb.0.entry:
642   ; GFX6-NEXT:   S_ENDPGM 0
643   ;
644   ; GFX8-LABEL: name: wavefront_one_as_acquire
645   ; GFX8: bb.0.entry:
646   ; GFX8-NEXT:   S_ENDPGM 0
647   ;
648   ; GFX10WGP-LABEL: name: wavefront_one_as_acquire
649   ; GFX10WGP: bb.0.entry:
650   ; GFX10WGP-NEXT:   S_ENDPGM 0
651   ;
652   ; GFX10CU-LABEL: name: wavefront_one_as_acquire
653   ; GFX10CU: bb.0.entry:
654   ; GFX10CU-NEXT:   S_ENDPGM 0
655   ;
656   ; GFX11WGP-LABEL: name: wavefront_one_as_acquire
657   ; GFX11WGP: bb.0.entry:
658   ; GFX11WGP-NEXT:   S_ENDPGM 0
659   ;
660   ; GFX11CU-LABEL: name: wavefront_one_as_acquire
661   ; GFX11CU: bb.0.entry:
662   ; GFX11CU-NEXT:   S_ENDPGM 0
663 entry:
664   fence syncscope("wavefront-one-as") acquire
665   ret void
668 define amdgpu_kernel void @wavefront_one_as_release() #0 {
669   ; GFX6-LABEL: name: wavefront_one_as_release
670   ; GFX6: bb.0.entry:
671   ; GFX6-NEXT:   S_ENDPGM 0
672   ;
673   ; GFX8-LABEL: name: wavefront_one_as_release
674   ; GFX8: bb.0.entry:
675   ; GFX8-NEXT:   S_ENDPGM 0
676   ;
677   ; GFX10WGP-LABEL: name: wavefront_one_as_release
678   ; GFX10WGP: bb.0.entry:
679   ; GFX10WGP-NEXT:   S_ENDPGM 0
680   ;
681   ; GFX10CU-LABEL: name: wavefront_one_as_release
682   ; GFX10CU: bb.0.entry:
683   ; GFX10CU-NEXT:   S_ENDPGM 0
684   ;
685   ; GFX11WGP-LABEL: name: wavefront_one_as_release
686   ; GFX11WGP: bb.0.entry:
687   ; GFX11WGP-NEXT:   S_ENDPGM 0
688   ;
689   ; GFX11CU-LABEL: name: wavefront_one_as_release
690   ; GFX11CU: bb.0.entry:
691   ; GFX11CU-NEXT:   S_ENDPGM 0
692 entry:
693   fence syncscope("wavefront-one-as") release
694   ret void
697 define amdgpu_kernel void @wavefront_one_as_acq_rel() #0 {
698   ; GFX6-LABEL: name: wavefront_one_as_acq_rel
699   ; GFX6: bb.0.entry:
700   ; GFX6-NEXT:   S_ENDPGM 0
701   ;
702   ; GFX8-LABEL: name: wavefront_one_as_acq_rel
703   ; GFX8: bb.0.entry:
704   ; GFX8-NEXT:   S_ENDPGM 0
705   ;
706   ; GFX10WGP-LABEL: name: wavefront_one_as_acq_rel
707   ; GFX10WGP: bb.0.entry:
708   ; GFX10WGP-NEXT:   S_ENDPGM 0
709   ;
710   ; GFX10CU-LABEL: name: wavefront_one_as_acq_rel
711   ; GFX10CU: bb.0.entry:
712   ; GFX10CU-NEXT:   S_ENDPGM 0
713   ;
714   ; GFX11WGP-LABEL: name: wavefront_one_as_acq_rel
715   ; GFX11WGP: bb.0.entry:
716   ; GFX11WGP-NEXT:   S_ENDPGM 0
717   ;
718   ; GFX11CU-LABEL: name: wavefront_one_as_acq_rel
719   ; GFX11CU: bb.0.entry:
720   ; GFX11CU-NEXT:   S_ENDPGM 0
721 entry:
722   fence syncscope("wavefront-one-as") acq_rel
723   ret void
726 define amdgpu_kernel void @wavefront_one_as_seq_cst() #0 {
727   ; GFX6-LABEL: name: wavefront_one_as_seq_cst
728   ; GFX6: bb.0.entry:
729   ; GFX6-NEXT:   S_ENDPGM 0
730   ;
731   ; GFX8-LABEL: name: wavefront_one_as_seq_cst
732   ; GFX8: bb.0.entry:
733   ; GFX8-NEXT:   S_ENDPGM 0
734   ;
735   ; GFX10WGP-LABEL: name: wavefront_one_as_seq_cst
736   ; GFX10WGP: bb.0.entry:
737   ; GFX10WGP-NEXT:   S_ENDPGM 0
738   ;
739   ; GFX10CU-LABEL: name: wavefront_one_as_seq_cst
740   ; GFX10CU: bb.0.entry:
741   ; GFX10CU-NEXT:   S_ENDPGM 0
742   ;
743   ; GFX11WGP-LABEL: name: wavefront_one_as_seq_cst
744   ; GFX11WGP: bb.0.entry:
745   ; GFX11WGP-NEXT:   S_ENDPGM 0
746   ;
747   ; GFX11CU-LABEL: name: wavefront_one_as_seq_cst
748   ; GFX11CU: bb.0.entry:
749   ; GFX11CU-NEXT:   S_ENDPGM 0
750 entry:
751   fence syncscope("wavefront-one-as") seq_cst
752   ret void
755 define amdgpu_kernel void @system_acquire() #0 {
756   ; GFX6-LABEL: name: system_acquire
757   ; GFX6: bb.0.entry:
758   ; GFX6-NEXT:   S_WAITCNT_soft 112
759   ; GFX6-NEXT:   BUFFER_WBINVL1 implicit $exec
760   ; GFX6-NEXT:   S_ENDPGM 0
761   ;
762   ; GFX8-LABEL: name: system_acquire
763   ; GFX8: bb.0.entry:
764   ; GFX8-NEXT:   S_WAITCNT_soft 112
765   ; GFX8-NEXT:   BUFFER_WBINVL1_VOL implicit $exec
766   ; GFX8-NEXT:   S_ENDPGM 0
767   ;
768   ; GFX10WGP-LABEL: name: system_acquire
769   ; GFX10WGP: bb.0.entry:
770   ; GFX10WGP-NEXT:   S_WAITCNT_soft 112
771   ; GFX10WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
772   ; GFX10WGP-NEXT:   BUFFER_GL1_INV implicit $exec
773   ; GFX10WGP-NEXT:   BUFFER_GL0_INV implicit $exec
774   ; GFX10WGP-NEXT:   S_ENDPGM 0
775   ;
776   ; GFX10CU-LABEL: name: system_acquire
777   ; GFX10CU: bb.0.entry:
778   ; GFX10CU-NEXT:   S_WAITCNT_soft 112
779   ; GFX10CU-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
780   ; GFX10CU-NEXT:   BUFFER_GL1_INV implicit $exec
781   ; GFX10CU-NEXT:   BUFFER_GL0_INV implicit $exec
782   ; GFX10CU-NEXT:   S_ENDPGM 0
783   ;
784   ; GFX11WGP-LABEL: name: system_acquire
785   ; GFX11WGP: bb.0.entry:
786   ; GFX11WGP-NEXT:   S_WAITCNT_soft 7
787   ; GFX11WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
788   ; GFX11WGP-NEXT:   BUFFER_GL1_INV implicit $exec
789   ; GFX11WGP-NEXT:   BUFFER_GL0_INV implicit $exec
790   ; GFX11WGP-NEXT:   S_ENDPGM 0
791   ;
792   ; GFX11CU-LABEL: name: system_acquire
793   ; GFX11CU: bb.0.entry:
794   ; GFX11CU-NEXT:   S_WAITCNT_soft 7
795   ; GFX11CU-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
796   ; GFX11CU-NEXT:   BUFFER_GL1_INV implicit $exec
797   ; GFX11CU-NEXT:   BUFFER_GL0_INV implicit $exec
798   ; GFX11CU-NEXT:   S_ENDPGM 0
799 entry:
800   fence acquire
801   ret void
804 define amdgpu_kernel void @system_release() #0 {
805   ; GFX6-LABEL: name: system_release
806   ; GFX6: bb.0.entry:
807   ; GFX6-NEXT:   S_WAITCNT_soft 112
808   ; GFX6-NEXT:   S_ENDPGM 0
809   ;
810   ; GFX8-LABEL: name: system_release
811   ; GFX8: bb.0.entry:
812   ; GFX8-NEXT:   S_WAITCNT_soft 112
813   ; GFX8-NEXT:   S_ENDPGM 0
814   ;
815   ; GFX10WGP-LABEL: name: system_release
816   ; GFX10WGP: bb.0.entry:
817   ; GFX10WGP-NEXT:   S_WAITCNT_soft 112
818   ; GFX10WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
819   ; GFX10WGP-NEXT:   S_ENDPGM 0
820   ;
821   ; GFX10CU-LABEL: name: system_release
822   ; GFX10CU: bb.0.entry:
823   ; GFX10CU-NEXT:   S_WAITCNT_soft 112
824   ; GFX10CU-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
825   ; GFX10CU-NEXT:   S_ENDPGM 0
826   ;
827   ; GFX11WGP-LABEL: name: system_release
828   ; GFX11WGP: bb.0.entry:
829   ; GFX11WGP-NEXT:   S_WAITCNT_soft 7
830   ; GFX11WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
831   ; GFX11WGP-NEXT:   S_ENDPGM 0
832   ;
833   ; GFX11CU-LABEL: name: system_release
834   ; GFX11CU: bb.0.entry:
835   ; GFX11CU-NEXT:   S_WAITCNT_soft 7
836   ; GFX11CU-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
837   ; GFX11CU-NEXT:   S_ENDPGM 0
838 entry:
839   fence release
840   ret void
843 define amdgpu_kernel void @system_acq_rel() #0 {
844   ; GFX6-LABEL: name: system_acq_rel
845   ; GFX6: bb.0.entry:
846   ; GFX6-NEXT:   S_WAITCNT_soft 112
847   ; GFX6-NEXT:   BUFFER_WBINVL1 implicit $exec
848   ; GFX6-NEXT:   S_ENDPGM 0
849   ;
850   ; GFX8-LABEL: name: system_acq_rel
851   ; GFX8: bb.0.entry:
852   ; GFX8-NEXT:   S_WAITCNT_soft 112
853   ; GFX8-NEXT:   BUFFER_WBINVL1_VOL implicit $exec
854   ; GFX8-NEXT:   S_ENDPGM 0
855   ;
856   ; GFX10WGP-LABEL: name: system_acq_rel
857   ; GFX10WGP: bb.0.entry:
858   ; GFX10WGP-NEXT:   S_WAITCNT_soft 112
859   ; GFX10WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
860   ; GFX10WGP-NEXT:   BUFFER_GL1_INV implicit $exec
861   ; GFX10WGP-NEXT:   BUFFER_GL0_INV implicit $exec
862   ; GFX10WGP-NEXT:   S_ENDPGM 0
863   ;
864   ; GFX10CU-LABEL: name: system_acq_rel
865   ; GFX10CU: bb.0.entry:
866   ; GFX10CU-NEXT:   S_WAITCNT_soft 112
867   ; GFX10CU-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
868   ; GFX10CU-NEXT:   BUFFER_GL1_INV implicit $exec
869   ; GFX10CU-NEXT:   BUFFER_GL0_INV implicit $exec
870   ; GFX10CU-NEXT:   S_ENDPGM 0
871   ;
872   ; GFX11WGP-LABEL: name: system_acq_rel
873   ; GFX11WGP: bb.0.entry:
874   ; GFX11WGP-NEXT:   S_WAITCNT_soft 7
875   ; GFX11WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
876   ; GFX11WGP-NEXT:   BUFFER_GL1_INV implicit $exec
877   ; GFX11WGP-NEXT:   BUFFER_GL0_INV implicit $exec
878   ; GFX11WGP-NEXT:   S_ENDPGM 0
879   ;
880   ; GFX11CU-LABEL: name: system_acq_rel
881   ; GFX11CU: bb.0.entry:
882   ; GFX11CU-NEXT:   S_WAITCNT_soft 7
883   ; GFX11CU-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
884   ; GFX11CU-NEXT:   BUFFER_GL1_INV implicit $exec
885   ; GFX11CU-NEXT:   BUFFER_GL0_INV implicit $exec
886   ; GFX11CU-NEXT:   S_ENDPGM 0
887 entry:
888   fence acq_rel
889   ret void
892 define amdgpu_kernel void @system_seq_cst() #0 {
893   ; GFX6-LABEL: name: system_seq_cst
894   ; GFX6: bb.0.entry:
895   ; GFX6-NEXT:   S_WAITCNT_soft 112
896   ; GFX6-NEXT:   BUFFER_WBINVL1 implicit $exec
897   ; GFX6-NEXT:   S_ENDPGM 0
898   ;
899   ; GFX8-LABEL: name: system_seq_cst
900   ; GFX8: bb.0.entry:
901   ; GFX8-NEXT:   S_WAITCNT_soft 112
902   ; GFX8-NEXT:   BUFFER_WBINVL1_VOL implicit $exec
903   ; GFX8-NEXT:   S_ENDPGM 0
904   ;
905   ; GFX10WGP-LABEL: name: system_seq_cst
906   ; GFX10WGP: bb.0.entry:
907   ; GFX10WGP-NEXT:   S_WAITCNT_soft 112
908   ; GFX10WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
909   ; GFX10WGP-NEXT:   BUFFER_GL1_INV implicit $exec
910   ; GFX10WGP-NEXT:   BUFFER_GL0_INV implicit $exec
911   ; GFX10WGP-NEXT:   S_ENDPGM 0
912   ;
913   ; GFX10CU-LABEL: name: system_seq_cst
914   ; GFX10CU: bb.0.entry:
915   ; GFX10CU-NEXT:   S_WAITCNT_soft 112
916   ; GFX10CU-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
917   ; GFX10CU-NEXT:   BUFFER_GL1_INV implicit $exec
918   ; GFX10CU-NEXT:   BUFFER_GL0_INV implicit $exec
919   ; GFX10CU-NEXT:   S_ENDPGM 0
920   ;
921   ; GFX11WGP-LABEL: name: system_seq_cst
922   ; GFX11WGP: bb.0.entry:
923   ; GFX11WGP-NEXT:   S_WAITCNT_soft 7
924   ; GFX11WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
925   ; GFX11WGP-NEXT:   BUFFER_GL1_INV implicit $exec
926   ; GFX11WGP-NEXT:   BUFFER_GL0_INV implicit $exec
927   ; GFX11WGP-NEXT:   S_ENDPGM 0
928   ;
929   ; GFX11CU-LABEL: name: system_seq_cst
930   ; GFX11CU: bb.0.entry:
931   ; GFX11CU-NEXT:   S_WAITCNT_soft 7
932   ; GFX11CU-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
933   ; GFX11CU-NEXT:   BUFFER_GL1_INV implicit $exec
934   ; GFX11CU-NEXT:   BUFFER_GL0_INV implicit $exec
935   ; GFX11CU-NEXT:   S_ENDPGM 0
936 entry:
937   fence seq_cst
938   ret void
941 define amdgpu_kernel void @singlethread_acquire() #0 {
942   ; GFX6-LABEL: name: singlethread_acquire
943   ; GFX6: bb.0.entry:
944   ; GFX6-NEXT:   S_ENDPGM 0
945   ;
946   ; GFX8-LABEL: name: singlethread_acquire
947   ; GFX8: bb.0.entry:
948   ; GFX8-NEXT:   S_ENDPGM 0
949   ;
950   ; GFX10WGP-LABEL: name: singlethread_acquire
951   ; GFX10WGP: bb.0.entry:
952   ; GFX10WGP-NEXT:   S_ENDPGM 0
953   ;
954   ; GFX10CU-LABEL: name: singlethread_acquire
955   ; GFX10CU: bb.0.entry:
956   ; GFX10CU-NEXT:   S_ENDPGM 0
957   ;
958   ; GFX11WGP-LABEL: name: singlethread_acquire
959   ; GFX11WGP: bb.0.entry:
960   ; GFX11WGP-NEXT:   S_ENDPGM 0
961   ;
962   ; GFX11CU-LABEL: name: singlethread_acquire
963   ; GFX11CU: bb.0.entry:
964   ; GFX11CU-NEXT:   S_ENDPGM 0
965 entry:
966   fence syncscope("singlethread") acquire
967   ret void
970 define amdgpu_kernel void @singlethread_release() #0 {
971   ; GFX6-LABEL: name: singlethread_release
972   ; GFX6: bb.0.entry:
973   ; GFX6-NEXT:   S_ENDPGM 0
974   ;
975   ; GFX8-LABEL: name: singlethread_release
976   ; GFX8: bb.0.entry:
977   ; GFX8-NEXT:   S_ENDPGM 0
978   ;
979   ; GFX10WGP-LABEL: name: singlethread_release
980   ; GFX10WGP: bb.0.entry:
981   ; GFX10WGP-NEXT:   S_ENDPGM 0
982   ;
983   ; GFX10CU-LABEL: name: singlethread_release
984   ; GFX10CU: bb.0.entry:
985   ; GFX10CU-NEXT:   S_ENDPGM 0
986   ;
987   ; GFX11WGP-LABEL: name: singlethread_release
988   ; GFX11WGP: bb.0.entry:
989   ; GFX11WGP-NEXT:   S_ENDPGM 0
990   ;
991   ; GFX11CU-LABEL: name: singlethread_release
992   ; GFX11CU: bb.0.entry:
993   ; GFX11CU-NEXT:   S_ENDPGM 0
994 entry:
995   fence syncscope("singlethread") release
996   ret void
999 define amdgpu_kernel void @singlethread_acq_rel() #0 {
1000   ; GFX6-LABEL: name: singlethread_acq_rel
1001   ; GFX6: bb.0.entry:
1002   ; GFX6-NEXT:   S_ENDPGM 0
1003   ;
1004   ; GFX8-LABEL: name: singlethread_acq_rel
1005   ; GFX8: bb.0.entry:
1006   ; GFX8-NEXT:   S_ENDPGM 0
1007   ;
1008   ; GFX10WGP-LABEL: name: singlethread_acq_rel
1009   ; GFX10WGP: bb.0.entry:
1010   ; GFX10WGP-NEXT:   S_ENDPGM 0
1011   ;
1012   ; GFX10CU-LABEL: name: singlethread_acq_rel
1013   ; GFX10CU: bb.0.entry:
1014   ; GFX10CU-NEXT:   S_ENDPGM 0
1015   ;
1016   ; GFX11WGP-LABEL: name: singlethread_acq_rel
1017   ; GFX11WGP: bb.0.entry:
1018   ; GFX11WGP-NEXT:   S_ENDPGM 0
1019   ;
1020   ; GFX11CU-LABEL: name: singlethread_acq_rel
1021   ; GFX11CU: bb.0.entry:
1022   ; GFX11CU-NEXT:   S_ENDPGM 0
1023 entry:
1024   fence syncscope("singlethread") acq_rel
1025   ret void
1028 define amdgpu_kernel void @singlethread_seq_cst() #0 {
1029   ; GFX6-LABEL: name: singlethread_seq_cst
1030   ; GFX6: bb.0.entry:
1031   ; GFX6-NEXT:   S_ENDPGM 0
1032   ;
1033   ; GFX8-LABEL: name: singlethread_seq_cst
1034   ; GFX8: bb.0.entry:
1035   ; GFX8-NEXT:   S_ENDPGM 0
1036   ;
1037   ; GFX10WGP-LABEL: name: singlethread_seq_cst
1038   ; GFX10WGP: bb.0.entry:
1039   ; GFX10WGP-NEXT:   S_ENDPGM 0
1040   ;
1041   ; GFX10CU-LABEL: name: singlethread_seq_cst
1042   ; GFX10CU: bb.0.entry:
1043   ; GFX10CU-NEXT:   S_ENDPGM 0
1044   ;
1045   ; GFX11WGP-LABEL: name: singlethread_seq_cst
1046   ; GFX11WGP: bb.0.entry:
1047   ; GFX11WGP-NEXT:   S_ENDPGM 0
1048   ;
1049   ; GFX11CU-LABEL: name: singlethread_seq_cst
1050   ; GFX11CU: bb.0.entry:
1051   ; GFX11CU-NEXT:   S_ENDPGM 0
1052 entry:
1053   fence syncscope("singlethread") seq_cst
1054   ret void
1057 define amdgpu_kernel void @agent_acquire() #0 {
1058   ; GFX6-LABEL: name: agent_acquire
1059   ; GFX6: bb.0.entry:
1060   ; GFX6-NEXT:   S_WAITCNT_soft 112
1061   ; GFX6-NEXT:   BUFFER_WBINVL1 implicit $exec
1062   ; GFX6-NEXT:   S_ENDPGM 0
1063   ;
1064   ; GFX8-LABEL: name: agent_acquire
1065   ; GFX8: bb.0.entry:
1066   ; GFX8-NEXT:   S_WAITCNT_soft 112
1067   ; GFX8-NEXT:   BUFFER_WBINVL1_VOL implicit $exec
1068   ; GFX8-NEXT:   S_ENDPGM 0
1069   ;
1070   ; GFX10WGP-LABEL: name: agent_acquire
1071   ; GFX10WGP: bb.0.entry:
1072   ; GFX10WGP-NEXT:   S_WAITCNT_soft 112
1073   ; GFX10WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
1074   ; GFX10WGP-NEXT:   BUFFER_GL1_INV implicit $exec
1075   ; GFX10WGP-NEXT:   BUFFER_GL0_INV implicit $exec
1076   ; GFX10WGP-NEXT:   S_ENDPGM 0
1077   ;
1078   ; GFX10CU-LABEL: name: agent_acquire
1079   ; GFX10CU: bb.0.entry:
1080   ; GFX10CU-NEXT:   S_WAITCNT_soft 112
1081   ; GFX10CU-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
1082   ; GFX10CU-NEXT:   BUFFER_GL1_INV implicit $exec
1083   ; GFX10CU-NEXT:   BUFFER_GL0_INV implicit $exec
1084   ; GFX10CU-NEXT:   S_ENDPGM 0
1085   ;
1086   ; GFX11WGP-LABEL: name: agent_acquire
1087   ; GFX11WGP: bb.0.entry:
1088   ; GFX11WGP-NEXT:   S_WAITCNT_soft 7
1089   ; GFX11WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
1090   ; GFX11WGP-NEXT:   BUFFER_GL1_INV implicit $exec
1091   ; GFX11WGP-NEXT:   BUFFER_GL0_INV implicit $exec
1092   ; GFX11WGP-NEXT:   S_ENDPGM 0
1093   ;
1094   ; GFX11CU-LABEL: name: agent_acquire
1095   ; GFX11CU: bb.0.entry:
1096   ; GFX11CU-NEXT:   S_WAITCNT_soft 7
1097   ; GFX11CU-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
1098   ; GFX11CU-NEXT:   BUFFER_GL1_INV implicit $exec
1099   ; GFX11CU-NEXT:   BUFFER_GL0_INV implicit $exec
1100   ; GFX11CU-NEXT:   S_ENDPGM 0
1101 entry:
1102   fence syncscope("agent") acquire
1103   ret void
1106 define amdgpu_kernel void @agent_release() #0 {
1107   ; GFX6-LABEL: name: agent_release
1108   ; GFX6: bb.0.entry:
1109   ; GFX6-NEXT:   S_WAITCNT_soft 112
1110   ; GFX6-NEXT:   S_ENDPGM 0
1111   ;
1112   ; GFX8-LABEL: name: agent_release
1113   ; GFX8: bb.0.entry:
1114   ; GFX8-NEXT:   S_WAITCNT_soft 112
1115   ; GFX8-NEXT:   S_ENDPGM 0
1116   ;
1117   ; GFX10WGP-LABEL: name: agent_release
1118   ; GFX10WGP: bb.0.entry:
1119   ; GFX10WGP-NEXT:   S_WAITCNT_soft 112
1120   ; GFX10WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
1121   ; GFX10WGP-NEXT:   S_ENDPGM 0
1122   ;
1123   ; GFX10CU-LABEL: name: agent_release
1124   ; GFX10CU: bb.0.entry:
1125   ; GFX10CU-NEXT:   S_WAITCNT_soft 112
1126   ; GFX10CU-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
1127   ; GFX10CU-NEXT:   S_ENDPGM 0
1128   ;
1129   ; GFX11WGP-LABEL: name: agent_release
1130   ; GFX11WGP: bb.0.entry:
1131   ; GFX11WGP-NEXT:   S_WAITCNT_soft 7
1132   ; GFX11WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
1133   ; GFX11WGP-NEXT:   S_ENDPGM 0
1134   ;
1135   ; GFX11CU-LABEL: name: agent_release
1136   ; GFX11CU: bb.0.entry:
1137   ; GFX11CU-NEXT:   S_WAITCNT_soft 7
1138   ; GFX11CU-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
1139   ; GFX11CU-NEXT:   S_ENDPGM 0
1140 entry:
1141   fence syncscope("agent") release
1142   ret void
1145 define amdgpu_kernel void @agent_acq_rel() #0 {
1146   ; GFX6-LABEL: name: agent_acq_rel
1147   ; GFX6: bb.0.entry:
1148   ; GFX6-NEXT:   S_WAITCNT_soft 112
1149   ; GFX6-NEXT:   BUFFER_WBINVL1 implicit $exec
1150   ; GFX6-NEXT:   S_ENDPGM 0
1151   ;
1152   ; GFX8-LABEL: name: agent_acq_rel
1153   ; GFX8: bb.0.entry:
1154   ; GFX8-NEXT:   S_WAITCNT_soft 112
1155   ; GFX8-NEXT:   BUFFER_WBINVL1_VOL implicit $exec
1156   ; GFX8-NEXT:   S_ENDPGM 0
1157   ;
1158   ; GFX10WGP-LABEL: name: agent_acq_rel
1159   ; GFX10WGP: bb.0.entry:
1160   ; GFX10WGP-NEXT:   S_WAITCNT_soft 112
1161   ; GFX10WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
1162   ; GFX10WGP-NEXT:   BUFFER_GL1_INV implicit $exec
1163   ; GFX10WGP-NEXT:   BUFFER_GL0_INV implicit $exec
1164   ; GFX10WGP-NEXT:   S_ENDPGM 0
1165   ;
1166   ; GFX10CU-LABEL: name: agent_acq_rel
1167   ; GFX10CU: bb.0.entry:
1168   ; GFX10CU-NEXT:   S_WAITCNT_soft 112
1169   ; GFX10CU-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
1170   ; GFX10CU-NEXT:   BUFFER_GL1_INV implicit $exec
1171   ; GFX10CU-NEXT:   BUFFER_GL0_INV implicit $exec
1172   ; GFX10CU-NEXT:   S_ENDPGM 0
1173   ;
1174   ; GFX11WGP-LABEL: name: agent_acq_rel
1175   ; GFX11WGP: bb.0.entry:
1176   ; GFX11WGP-NEXT:   S_WAITCNT_soft 7
1177   ; GFX11WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
1178   ; GFX11WGP-NEXT:   BUFFER_GL1_INV implicit $exec
1179   ; GFX11WGP-NEXT:   BUFFER_GL0_INV implicit $exec
1180   ; GFX11WGP-NEXT:   S_ENDPGM 0
1181   ;
1182   ; GFX11CU-LABEL: name: agent_acq_rel
1183   ; GFX11CU: bb.0.entry:
1184   ; GFX11CU-NEXT:   S_WAITCNT_soft 7
1185   ; GFX11CU-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
1186   ; GFX11CU-NEXT:   BUFFER_GL1_INV implicit $exec
1187   ; GFX11CU-NEXT:   BUFFER_GL0_INV implicit $exec
1188   ; GFX11CU-NEXT:   S_ENDPGM 0
1189 entry:
1190   fence syncscope("agent") acq_rel
1191   ret void
1194 define amdgpu_kernel void @agent_seq_cst() #0 {
1195   ; GFX6-LABEL: name: agent_seq_cst
1196   ; GFX6: bb.0.entry:
1197   ; GFX6-NEXT:   S_WAITCNT_soft 112
1198   ; GFX6-NEXT:   BUFFER_WBINVL1 implicit $exec
1199   ; GFX6-NEXT:   S_ENDPGM 0
1200   ;
1201   ; GFX8-LABEL: name: agent_seq_cst
1202   ; GFX8: bb.0.entry:
1203   ; GFX8-NEXT:   S_WAITCNT_soft 112
1204   ; GFX8-NEXT:   BUFFER_WBINVL1_VOL implicit $exec
1205   ; GFX8-NEXT:   S_ENDPGM 0
1206   ;
1207   ; GFX10WGP-LABEL: name: agent_seq_cst
1208   ; GFX10WGP: bb.0.entry:
1209   ; GFX10WGP-NEXT:   S_WAITCNT_soft 112
1210   ; GFX10WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
1211   ; GFX10WGP-NEXT:   BUFFER_GL1_INV implicit $exec
1212   ; GFX10WGP-NEXT:   BUFFER_GL0_INV implicit $exec
1213   ; GFX10WGP-NEXT:   S_ENDPGM 0
1214   ;
1215   ; GFX10CU-LABEL: name: agent_seq_cst
1216   ; GFX10CU: bb.0.entry:
1217   ; GFX10CU-NEXT:   S_WAITCNT_soft 112
1218   ; GFX10CU-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
1219   ; GFX10CU-NEXT:   BUFFER_GL1_INV implicit $exec
1220   ; GFX10CU-NEXT:   BUFFER_GL0_INV implicit $exec
1221   ; GFX10CU-NEXT:   S_ENDPGM 0
1222   ;
1223   ; GFX11WGP-LABEL: name: agent_seq_cst
1224   ; GFX11WGP: bb.0.entry:
1225   ; GFX11WGP-NEXT:   S_WAITCNT_soft 7
1226   ; GFX11WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
1227   ; GFX11WGP-NEXT:   BUFFER_GL1_INV implicit $exec
1228   ; GFX11WGP-NEXT:   BUFFER_GL0_INV implicit $exec
1229   ; GFX11WGP-NEXT:   S_ENDPGM 0
1230   ;
1231   ; GFX11CU-LABEL: name: agent_seq_cst
1232   ; GFX11CU: bb.0.entry:
1233   ; GFX11CU-NEXT:   S_WAITCNT_soft 7
1234   ; GFX11CU-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
1235   ; GFX11CU-NEXT:   BUFFER_GL1_INV implicit $exec
1236   ; GFX11CU-NEXT:   BUFFER_GL0_INV implicit $exec
1237   ; GFX11CU-NEXT:   S_ENDPGM 0
1238 entry:
1239   fence syncscope("agent") seq_cst
1240   ret void
1243 define amdgpu_kernel void @workgroup_acquire() #0 {
1244   ; GFX6-LABEL: name: workgroup_acquire
1245   ; GFX6: bb.0.entry:
1246   ; GFX6-NEXT:   S_WAITCNT_soft 127
1247   ; GFX6-NEXT:   S_ENDPGM 0
1248   ;
1249   ; GFX8-LABEL: name: workgroup_acquire
1250   ; GFX8: bb.0.entry:
1251   ; GFX8-NEXT:   S_WAITCNT_soft 127
1252   ; GFX8-NEXT:   S_ENDPGM 0
1253   ;
1254   ; GFX10WGP-LABEL: name: workgroup_acquire
1255   ; GFX10WGP: bb.0.entry:
1256   ; GFX10WGP-NEXT:   S_WAITCNT_soft 112
1257   ; GFX10WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
1258   ; GFX10WGP-NEXT:   BUFFER_GL0_INV implicit $exec
1259   ; GFX10WGP-NEXT:   S_ENDPGM 0
1260   ;
1261   ; GFX10CU-LABEL: name: workgroup_acquire
1262   ; GFX10CU: bb.0.entry:
1263   ; GFX10CU-NEXT:   S_WAITCNT_soft 49279
1264   ; GFX10CU-NEXT:   S_ENDPGM 0
1265   ;
1266   ; GFX11WGP-LABEL: name: workgroup_acquire
1267   ; GFX11WGP: bb.0.entry:
1268   ; GFX11WGP-NEXT:   S_WAITCNT_soft 7
1269   ; GFX11WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
1270   ; GFX11WGP-NEXT:   BUFFER_GL0_INV implicit $exec
1271   ; GFX11WGP-NEXT:   S_ENDPGM 0
1272   ;
1273   ; GFX11CU-LABEL: name: workgroup_acquire
1274   ; GFX11CU: bb.0.entry:
1275   ; GFX11CU-NEXT:   S_WAITCNT_soft 64519
1276   ; GFX11CU-NEXT:   S_ENDPGM 0
1277 entry:
1278   fence syncscope("workgroup") acquire
1279   ret void
1282 define amdgpu_kernel void @workgroup_release() #0 {
1283   ; GFX6-LABEL: name: workgroup_release
1284   ; GFX6: bb.0.entry:
1285   ; GFX6-NEXT:   S_WAITCNT_soft 127
1286   ; GFX6-NEXT:   S_ENDPGM 0
1287   ;
1288   ; GFX8-LABEL: name: workgroup_release
1289   ; GFX8: bb.0.entry:
1290   ; GFX8-NEXT:   S_WAITCNT_soft 127
1291   ; GFX8-NEXT:   S_ENDPGM 0
1292   ;
1293   ; GFX10WGP-LABEL: name: workgroup_release
1294   ; GFX10WGP: bb.0.entry:
1295   ; GFX10WGP-NEXT:   S_WAITCNT_soft 112
1296   ; GFX10WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
1297   ; GFX10WGP-NEXT:   S_ENDPGM 0
1298   ;
1299   ; GFX10CU-LABEL: name: workgroup_release
1300   ; GFX10CU: bb.0.entry:
1301   ; GFX10CU-NEXT:   S_WAITCNT_soft 49279
1302   ; GFX10CU-NEXT:   S_ENDPGM 0
1303   ;
1304   ; GFX11WGP-LABEL: name: workgroup_release
1305   ; GFX11WGP: bb.0.entry:
1306   ; GFX11WGP-NEXT:   S_WAITCNT_soft 7
1307   ; GFX11WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
1308   ; GFX11WGP-NEXT:   S_ENDPGM 0
1309   ;
1310   ; GFX11CU-LABEL: name: workgroup_release
1311   ; GFX11CU: bb.0.entry:
1312   ; GFX11CU-NEXT:   S_WAITCNT_soft 64519
1313   ; GFX11CU-NEXT:   S_ENDPGM 0
1314 entry:
1315   fence syncscope("workgroup") release
1316   ret void
1319 define amdgpu_kernel void @workgroup_acq_rel() #0 {
1320   ; GFX6-LABEL: name: workgroup_acq_rel
1321   ; GFX6: bb.0.entry:
1322   ; GFX6-NEXT:   S_WAITCNT_soft 127
1323   ; GFX6-NEXT:   S_ENDPGM 0
1324   ;
1325   ; GFX8-LABEL: name: workgroup_acq_rel
1326   ; GFX8: bb.0.entry:
1327   ; GFX8-NEXT:   S_WAITCNT_soft 127
1328   ; GFX8-NEXT:   S_ENDPGM 0
1329   ;
1330   ; GFX10WGP-LABEL: name: workgroup_acq_rel
1331   ; GFX10WGP: bb.0.entry:
1332   ; GFX10WGP-NEXT:   S_WAITCNT_soft 112
1333   ; GFX10WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
1334   ; GFX10WGP-NEXT:   BUFFER_GL0_INV implicit $exec
1335   ; GFX10WGP-NEXT:   S_ENDPGM 0
1336   ;
1337   ; GFX10CU-LABEL: name: workgroup_acq_rel
1338   ; GFX10CU: bb.0.entry:
1339   ; GFX10CU-NEXT:   S_WAITCNT_soft 49279
1340   ; GFX10CU-NEXT:   S_ENDPGM 0
1341   ;
1342   ; GFX11WGP-LABEL: name: workgroup_acq_rel
1343   ; GFX11WGP: bb.0.entry:
1344   ; GFX11WGP-NEXT:   S_WAITCNT_soft 7
1345   ; GFX11WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
1346   ; GFX11WGP-NEXT:   BUFFER_GL0_INV implicit $exec
1347   ; GFX11WGP-NEXT:   S_ENDPGM 0
1348   ;
1349   ; GFX11CU-LABEL: name: workgroup_acq_rel
1350   ; GFX11CU: bb.0.entry:
1351   ; GFX11CU-NEXT:   S_WAITCNT_soft 64519
1352   ; GFX11CU-NEXT:   S_ENDPGM 0
1353 entry:
1354   fence syncscope("workgroup") acq_rel
1355   ret void
1358 define amdgpu_kernel void @workgroup_seq_cst() #0 {
1359   ; GFX6-LABEL: name: workgroup_seq_cst
1360   ; GFX6: bb.0.entry:
1361   ; GFX6-NEXT:   S_WAITCNT_soft 127
1362   ; GFX6-NEXT:   S_ENDPGM 0
1363   ;
1364   ; GFX8-LABEL: name: workgroup_seq_cst
1365   ; GFX8: bb.0.entry:
1366   ; GFX8-NEXT:   S_WAITCNT_soft 127
1367   ; GFX8-NEXT:   S_ENDPGM 0
1368   ;
1369   ; GFX10WGP-LABEL: name: workgroup_seq_cst
1370   ; GFX10WGP: bb.0.entry:
1371   ; GFX10WGP-NEXT:   S_WAITCNT_soft 112
1372   ; GFX10WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
1373   ; GFX10WGP-NEXT:   BUFFER_GL0_INV implicit $exec
1374   ; GFX10WGP-NEXT:   S_ENDPGM 0
1375   ;
1376   ; GFX10CU-LABEL: name: workgroup_seq_cst
1377   ; GFX10CU: bb.0.entry:
1378   ; GFX10CU-NEXT:   S_WAITCNT_soft 49279
1379   ; GFX10CU-NEXT:   S_ENDPGM 0
1380   ;
1381   ; GFX11WGP-LABEL: name: workgroup_seq_cst
1382   ; GFX11WGP: bb.0.entry:
1383   ; GFX11WGP-NEXT:   S_WAITCNT_soft 7
1384   ; GFX11WGP-NEXT:   S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
1385   ; GFX11WGP-NEXT:   BUFFER_GL0_INV implicit $exec
1386   ; GFX11WGP-NEXT:   S_ENDPGM 0
1387   ;
1388   ; GFX11CU-LABEL: name: workgroup_seq_cst
1389   ; GFX11CU: bb.0.entry:
1390   ; GFX11CU-NEXT:   S_WAITCNT_soft 64519
1391   ; GFX11CU-NEXT:   S_ENDPGM 0
1392 entry:
1393   fence syncscope("workgroup") seq_cst
1394   ret void
1397 define amdgpu_kernel void @wavefront_acquire() #0 {
1398   ; GFX6-LABEL: name: wavefront_acquire
1399   ; GFX6: bb.0.entry:
1400   ; GFX6-NEXT:   S_ENDPGM 0
1401   ;
1402   ; GFX8-LABEL: name: wavefront_acquire
1403   ; GFX8: bb.0.entry:
1404   ; GFX8-NEXT:   S_ENDPGM 0
1405   ;
1406   ; GFX10WGP-LABEL: name: wavefront_acquire
1407   ; GFX10WGP: bb.0.entry:
1408   ; GFX10WGP-NEXT:   S_ENDPGM 0
1409   ;
1410   ; GFX10CU-LABEL: name: wavefront_acquire
1411   ; GFX10CU: bb.0.entry:
1412   ; GFX10CU-NEXT:   S_ENDPGM 0
1413   ;
1414   ; GFX11WGP-LABEL: name: wavefront_acquire
1415   ; GFX11WGP: bb.0.entry:
1416   ; GFX11WGP-NEXT:   S_ENDPGM 0
1417   ;
1418   ; GFX11CU-LABEL: name: wavefront_acquire
1419   ; GFX11CU: bb.0.entry:
1420   ; GFX11CU-NEXT:   S_ENDPGM 0
1421 entry:
1422   fence syncscope("wavefront") acquire
1423   ret void
1426 define amdgpu_kernel void @wavefront_release() #0 {
1427   ; GFX6-LABEL: name: wavefront_release
1428   ; GFX6: bb.0.entry:
1429   ; GFX6-NEXT:   S_ENDPGM 0
1430   ;
1431   ; GFX8-LABEL: name: wavefront_release
1432   ; GFX8: bb.0.entry:
1433   ; GFX8-NEXT:   S_ENDPGM 0
1434   ;
1435   ; GFX10WGP-LABEL: name: wavefront_release
1436   ; GFX10WGP: bb.0.entry:
1437   ; GFX10WGP-NEXT:   S_ENDPGM 0
1438   ;
1439   ; GFX10CU-LABEL: name: wavefront_release
1440   ; GFX10CU: bb.0.entry:
1441   ; GFX10CU-NEXT:   S_ENDPGM 0
1442   ;
1443   ; GFX11WGP-LABEL: name: wavefront_release
1444   ; GFX11WGP: bb.0.entry:
1445   ; GFX11WGP-NEXT:   S_ENDPGM 0
1446   ;
1447   ; GFX11CU-LABEL: name: wavefront_release
1448   ; GFX11CU: bb.0.entry:
1449   ; GFX11CU-NEXT:   S_ENDPGM 0
1450 entry:
1451   fence syncscope("wavefront") release
1452   ret void
1455 define amdgpu_kernel void @wavefront_acq_rel() #0 {
1456   ; GFX6-LABEL: name: wavefront_acq_rel
1457   ; GFX6: bb.0.entry:
1458   ; GFX6-NEXT:   S_ENDPGM 0
1459   ;
1460   ; GFX8-LABEL: name: wavefront_acq_rel
1461   ; GFX8: bb.0.entry:
1462   ; GFX8-NEXT:   S_ENDPGM 0
1463   ;
1464   ; GFX10WGP-LABEL: name: wavefront_acq_rel
1465   ; GFX10WGP: bb.0.entry:
1466   ; GFX10WGP-NEXT:   S_ENDPGM 0
1467   ;
1468   ; GFX10CU-LABEL: name: wavefront_acq_rel
1469   ; GFX10CU: bb.0.entry:
1470   ; GFX10CU-NEXT:   S_ENDPGM 0
1471   ;
1472   ; GFX11WGP-LABEL: name: wavefront_acq_rel
1473   ; GFX11WGP: bb.0.entry:
1474   ; GFX11WGP-NEXT:   S_ENDPGM 0
1475   ;
1476   ; GFX11CU-LABEL: name: wavefront_acq_rel
1477   ; GFX11CU: bb.0.entry:
1478   ; GFX11CU-NEXT:   S_ENDPGM 0
1479 entry:
1480   fence syncscope("wavefront") acq_rel
1481   ret void
1484 define amdgpu_kernel void @wavefront_seq_cst() #0 {
1485   ; GFX6-LABEL: name: wavefront_seq_cst
1486   ; GFX6: bb.0.entry:
1487   ; GFX6-NEXT:   S_ENDPGM 0
1488   ;
1489   ; GFX8-LABEL: name: wavefront_seq_cst
1490   ; GFX8: bb.0.entry:
1491   ; GFX8-NEXT:   S_ENDPGM 0
1492   ;
1493   ; GFX10WGP-LABEL: name: wavefront_seq_cst
1494   ; GFX10WGP: bb.0.entry:
1495   ; GFX10WGP-NEXT:   S_ENDPGM 0
1496   ;
1497   ; GFX10CU-LABEL: name: wavefront_seq_cst
1498   ; GFX10CU: bb.0.entry:
1499   ; GFX10CU-NEXT:   S_ENDPGM 0
1500   ;
1501   ; GFX11WGP-LABEL: name: wavefront_seq_cst
1502   ; GFX11WGP: bb.0.entry:
1503   ; GFX11WGP-NEXT:   S_ENDPGM 0
1504   ;
1505   ; GFX11CU-LABEL: name: wavefront_seq_cst
1506   ; GFX11CU: bb.0.entry:
1507   ; GFX11CU-NEXT:   S_ENDPGM 0
1508 entry:
1509   fence syncscope("wavefront") seq_cst
1510   ret void
1513 attributes #0 = { "amdgpu-no-dispatch-id" "amdgpu-no-dispatch-ptr" "amdgpu-no-implicitarg-ptr" "amdgpu-no-lds-kernel-id" "amdgpu-no-queue-ptr" "amdgpu-no-workgroup-id-x" "amdgpu-no-workgroup-id-y" "amdgpu-no-workgroup-id-z" "amdgpu-no-workitem-id-y" "amdgpu-no-workitem-id-z" }