1 ; RUN: llc -mtriple=amdgcn-amd- -mcpu=gfx600 -verify-machineinstrs < %s | FileCheck -check-prefixes=FUNC,GCN,GFX6,GFX68 %s
2 ; RUN: llc -mtriple=amdgcn-amd- -mcpu=gfx803 -verify-machineinstrs < %s | FileCheck -check-prefixes=FUNC,GCN,GFX8,GFX68 %s
3 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx803 -verify-machineinstrs < %s | FileCheck -check-prefixes=FUNC,GCN,GFX8,GFX68 %s
4 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1010 -mattr=+code-object-v3 -verify-machineinstrs < %s | FileCheck -check-prefixes=FUNC,GCN,GFX10,GFX10WGP %s
5 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1010 -mattr=+code-object-v3,+cumode -verify-machineinstrs < %s | FileCheck -check-prefixes=FUNC,GCN,GFX10,GFX10CU %s
7 ; FUNC-LABEL: {{^}}system_one_as_acquire:
9 ; GCN-NOT: ATOMIC_FENCE
10 ; GFX6: s_waitcnt vmcnt(0){{$}}
11 ; GFX6-NEXT: buffer_wbinvl1{{$}}
12 ; GFX8: s_waitcnt vmcnt(0){{$}}
13 ; GFX8-NEXT: buffer_wbinvl1_vol{{$}}
14 ; GFX10: s_waitcnt vmcnt(0){{$}}
15 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0{{$}}
16 ; GFX10-NEXT: buffer_gl0_inv{{$}}
17 ; GFX10-NEXT: buffer_gl1_inv{{$}}
19 ; GFX10: .amdhsa_kernel system_one_as_acquire
20 ; GFX10WGP-NOT: .amdhsa_workgroup_processor_mode 0
21 ; GFX10CU: .amdhsa_workgroup_processor_mode 0
22 ; GFX10-NOT: .amdhsa_memory_ordered 0
23 define amdgpu_kernel void @system_one_as_acquire() {
25 fence syncscope("one-as") acquire
29 ; FUNC-LABEL: {{^}}system_one_as_release:
31 ; GCN-NOT: ATOMIC_FENCE
32 ; GCN: s_waitcnt vmcnt(0){{$}}
33 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0{{$}}
35 ; GFX10: .amdhsa_kernel system_one_as_release
36 ; GFX10WGP-NOT: .amdhsa_workgroup_processor_mode 0
37 ; GFX10CU: .amdhsa_workgroup_processor_mode 0
38 ; GFX10-NOT: .amdhsa_memory_ordered 0
39 define amdgpu_kernel void @system_one_as_release() {
41 fence syncscope("one-as") release
45 ; FUNC-LABEL: {{^}}system_one_as_acq_rel:
47 ; GCN-NOT: ATOMIC_FENCE
48 ; GCN: s_waitcnt vmcnt(0){{$}}
49 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0{{$}}
50 ; GFX6: buffer_wbinvl1{{$}}
51 ; GFX8: buffer_wbinvl1_vol{{$}}
52 ; GFX10-NEXT: buffer_gl0_inv{{$}}
53 ; GFX10-NEXT: buffer_gl1_inv{{$}}
55 ; GFX10: .amdhsa_kernel system_one_as_acq_rel
56 ; GFX10WGP-NOT: .amdhsa_workgroup_processor_mode 0
57 ; GFX10CU: .amdhsa_workgroup_processor_mode 0
58 ; GFX10-NOT: .amdhsa_memory_ordered 0
59 define amdgpu_kernel void @system_one_as_acq_rel() {
61 fence syncscope("one-as") acq_rel
65 ; FUNC-LABEL: {{^}}system_one_as_seq_cst:
67 ; GCN-NOT: ATOMIC_FENCE
68 ; GCN: s_waitcnt vmcnt(0){{$}}
69 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0{{$}}
70 ; GFX6: buffer_wbinvl1{{$}}
71 ; GFX8: buffer_wbinvl1_vol{{$}}
72 ; GFX10-NEXT: buffer_gl0_inv{{$}}
73 ; GFX10-NEXT: buffer_gl1_inv{{$}}
75 ; GFX10: .amdhsa_kernel system_one_as_seq_cst
76 ; GFX10WGP-NOT: .amdhsa_workgroup_processor_mode 0
77 ; GFX10CU: .amdhsa_workgroup_processor_mode 0
78 ; GFX10-NOT: .amdhsa_memory_ordered 0
79 define amdgpu_kernel void @system_one_as_seq_cst() {
81 fence syncscope("one-as") seq_cst
85 ; FUNC-LABEL: {{^}}singlethread_one_as_acquire:
87 ; GCN-NOT: ATOMIC_FENCE
89 ; GFX10: .amdhsa_kernel singlethread_one_as_acquire
90 ; GFX10WGP-NOT: .amdhsa_workgroup_processor_mode 0
91 ; GFX10CU: .amdhsa_workgroup_processor_mode 0
92 ; GFX10-NOT: .amdhsa_memory_ordered 0
93 define amdgpu_kernel void @singlethread_one_as_acquire() {
95 fence syncscope("singlethread-one-as") acquire
99 ; FUNC-LABEL: {{^}}singlethread_one_as_release:
101 ; GCN-NOT: ATOMIC_FENCE
103 ; GFX10: .amdhsa_kernel singlethread_one_as_release
104 ; GFX10WGP-NOT: .amdhsa_workgroup_processor_mode 0
105 ; GFX10CU: .amdhsa_workgroup_processor_mode 0
106 ; GFX10-NOT: .amdhsa_memory_ordered 0
107 define amdgpu_kernel void @singlethread_one_as_release() {
109 fence syncscope("singlethread-one-as") release
113 ; FUNC-LABEL: {{^}}singlethread_one_as_acq_rel:
115 ; GCN-NOT: ATOMIC_FENCE
117 ; GFX10: .amdhsa_kernel singlethread_one_as_acq_rel
118 ; GFX10WGP-NOT: .amdhsa_workgroup_processor_mode 0
119 ; GFX10CU: .amdhsa_workgroup_processor_mode 0
120 ; GFX10-NOT: .amdhsa_memory_ordered 0
121 define amdgpu_kernel void @singlethread_one_as_acq_rel() {
123 fence syncscope("singlethread-one-as") acq_rel
127 ; FUNC-LABEL: {{^}}singlethread_one_as_seq_cst:
129 ; GCN-NOT: ATOMIC_FENCE
131 ; GFX10: .amdhsa_kernel singlethread_one_as_seq_cst
132 ; GFX10WGP-NOT: .amdhsa_workgroup_processor_mode 0
133 ; GFX10CU: .amdhsa_workgroup_processor_mode 0
134 ; GFX10-NOT: .amdhsa_memory_ordered 0
135 define amdgpu_kernel void @singlethread_one_as_seq_cst() {
137 fence syncscope("singlethread-one-as") seq_cst
141 ; FUNC-LABEL: {{^}}agent_one_as_acquire:
143 ; GCN-NOT: ATOMIC_FENCE
144 ; GFX6: s_waitcnt vmcnt(0){{$}}
145 ; GFX6-NEXT: buffer_wbinvl1{{$}}
146 ; GFX8: s_waitcnt vmcnt(0){{$}}
147 ; GFX8-NEXT: buffer_wbinvl1_vol{{$}}
148 ; GFX10: s_waitcnt vmcnt(0){{$}}
149 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0{{$}}
150 ; GFX10-NEXT: buffer_gl0_inv{{$}}
151 ; GFX10-NEXT: buffer_gl1_inv{{$}}
153 ; GFX10: .amdhsa_kernel agent_one_as_acquire
154 ; GFX10WGP-NOT: .amdhsa_workgroup_processor_mode 0
155 ; GFX10CU: .amdhsa_workgroup_processor_mode 0
156 ; GFX10-NOT: .amdhsa_memory_ordered 0
157 define amdgpu_kernel void @agent_one_as_acquire() {
159 fence syncscope("agent-one-as") acquire
163 ; FUNC-LABEL: {{^}}agent_one_as_release:
165 ; GCN-NOT: ATOMIC_FENCE
166 ; GCN: s_waitcnt vmcnt(0){{$}}
167 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0{{$}}
169 ; GFX10: .amdhsa_kernel agent_one_as_release
170 ; GFX10WGP-NOT: .amdhsa_workgroup_processor_mode 0
171 ; GFX10CU: .amdhsa_workgroup_processor_mode 0
172 ; GFX10-NOT: .amdhsa_memory_ordered 0
173 define amdgpu_kernel void @agent_one_as_release() {
175 fence syncscope("agent-one-as") release
179 ; FUNC-LABEL: {{^}}agent_one_as_acq_rel:
181 ; GCN-NOT: ATOMIC_FENCE
182 ; GCN: s_waitcnt vmcnt(0){{$}}
183 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0{{$}}
184 ; GFX6: buffer_wbinvl1{{$}}
185 ; GFX8: buffer_wbinvl1_vol{{$}}
186 ; GFX10-NEXT: buffer_gl0_inv{{$}}
187 ; GFX10-NEXT: buffer_gl1_inv{{$}}
189 ; GFX10: .amdhsa_kernel agent_one_as_acq_rel
190 ; GFX10WGP-NOT: .amdhsa_workgroup_processor_mode 0
191 ; GFX10CU: .amdhsa_workgroup_processor_mode 0
192 ; GFX10-NOT: .amdhsa_memory_ordered 0
193 define amdgpu_kernel void @agent_one_as_acq_rel() {
195 fence syncscope("agent-one-as") acq_rel
199 ; FUNC-LABEL: {{^}}agent_one_as_seq_cst:
201 ; GCN-NOT: ATOMIC_FENCE
202 ; GCN: s_waitcnt vmcnt(0){{$}}
203 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0{{$}}
204 ; GFX6: buffer_wbinvl1{{$}}
205 ; GFX8: buffer_wbinvl1_vol{{$}}
206 ; GFX10-NEXT: buffer_gl0_inv{{$}}
207 ; GFX10-NEXT: buffer_gl1_inv{{$}}
209 ; GFX10: .amdhsa_kernel agent_one_as_seq_cst
210 ; GFX10WGP-NOT: .amdhsa_workgroup_processor_mode 0
211 ; GFX10CU: .amdhsa_workgroup_processor_mode 0
212 ; GFX10-NOT: .amdhsa_memory_ordered 0
213 define amdgpu_kernel void @agent_one_as_seq_cst() {
215 fence syncscope("agent-one-as") seq_cst
219 ; FUNC-LABEL: {{^}}workgroup_one_as_acquire:
221 ; GFX68-NOT: s_waitcnt vmcnt(0){{$}}
222 ; GFX10WGP: s_waitcnt vmcnt(0){{$}}
223 ; GFX10WGP-NEXT: s_waitcnt_vscnt null, 0x0{{$}}
224 ; GFX10CU-NOT: s_waitcnt vmcnt(0){{$}}
225 ; GFX10CU-NOT: s_waitcnt_vscnt null, 0x0{{$}}
226 ; GFX10WGP-NEXT: buffer_gl0_inv{{$}}
227 ; GFX10CU-NOT: buffer_gl0_inv{{$}}
228 ; GCN-NOT: ATOMIC_FENCE
230 ; GFX10: .amdhsa_kernel workgroup_one_as_acquire
231 ; GFX10WGP-NOT: .amdhsa_workgroup_processor_mode 0
232 ; GFX10CU: .amdhsa_workgroup_processor_mode 0
233 ; GFX10-NOT: .amdhsa_memory_ordered 0
234 define amdgpu_kernel void @workgroup_one_as_acquire() {
236 fence syncscope("workgroup-one-as") acquire
240 ; FUNC-LABEL: {{^}}workgroup_one_as_release:
242 ; GFX68-NOT: s_waitcnt vmcnt(0){{$}}
243 ; GFX10WGP: s_waitcnt vmcnt(0){{$}}
244 ; GFX10WGP-NEXT: s_waitcnt_vscnt null, 0x0{{$}}
245 ; GFX10CU-NOT: s_waitcnt vmcnt(0){{$}}
246 ; GFX10CU-NOT: s_waitcnt_vscnt null, 0x0{{$}}
247 ; GFX10-NOT: buffer_gl0_inv
248 ; GCN-NOT: ATOMIC_FENCE
250 ; GFX10: .amdhsa_kernel workgroup_one_as_release
251 ; GFX10WGP-NOT: .amdhsa_workgroup_processor_mode 0
252 ; GFX10CU: .amdhsa_workgroup_processor_mode 0
253 ; GFX10-NOT: .amdhsa_memory_ordered 0
254 define amdgpu_kernel void @workgroup_one_as_release() {
256 fence syncscope("workgroup-one-as") release
260 ; FUNC-LABEL: {{^}}workgroup_one_as_acq_rel:
262 ; GFX68-NOT: s_waitcnt vmcnt(0){{$}}
263 ; GFX10WGP: s_waitcnt vmcnt(0){{$}}
264 ; GFX10WGP-NEXT: s_waitcnt_vscnt null, 0x0{{$}}
265 ; GFX10WGP-NEXT: buffer_gl0_inv{{$}}
266 ; GFX10CU-NOT: s_waitcnt vmcnt(0){{$}}
267 ; GFX10CU-NOT: s_waitcnt_vscnt null, 0x0{{$}}
268 ; GFX10CU-NOT: buffer_gl0_inv{{$}}
269 ; GCN-NOT: ATOMIC_FENCE
271 ; GFX10: .amdhsa_kernel workgroup_one_as_acq_rel
272 ; GFX10WGP-NOT: .amdhsa_workgroup_processor_mode 0
273 ; GFX10CU: .amdhsa_workgroup_processor_mode 0
274 ; GFX10-NOT: .amdhsa_memory_ordered 0
275 define amdgpu_kernel void @workgroup_one_as_acq_rel() {
277 fence syncscope("workgroup-one-as") acq_rel
281 ; FUNC-LABEL: {{^}}workgroup_one_as_seq_cst:
283 ; GFX68-NOT: s_waitcnt vmcnt(0){{$}}
284 ; GFX10WGP: s_waitcnt vmcnt(0){{$}}
285 ; GFX10WGP-NEXT: s_waitcnt_vscnt null, 0x0{{$}}
286 ; GFX10WGP-NEXT: buffer_gl0_inv{{$}}
287 ; GFX10CU-NOT: s_waitcnt vmcnt(0){{$}}
288 ; GFX10CU-NOT: s_waitcnt_vscnt null, 0x0{{$}}
289 ; GFX10CU-NOT: buffer_gl0_inv{{$}}
290 ; GCN-NOT: ATOMIC_FENCE
292 ; GFX10: .amdhsa_kernel workgroup_one_as_seq_cst
293 ; GFX10WGP-NOT: .amdhsa_workgroup_processor_mode 0
294 ; GFX10CU: .amdhsa_workgroup_processor_mode 0
295 ; GFX10-NOT: .amdhsa_memory_ordered 0
296 define amdgpu_kernel void @workgroup_one_as_seq_cst() {
298 fence syncscope("workgroup-one-as") seq_cst
302 ; FUNC-LABEL: {{^}}wavefront_one_as_acquire:
304 ; GCN-NOT: ATOMIC_FENCE
306 ; GFX10: .amdhsa_kernel wavefront_one_as_acquire
307 ; GFX10WGP-NOT: .amdhsa_workgroup_processor_mode 0
308 ; GFX10CU: .amdhsa_workgroup_processor_mode 0
309 ; GFX10-NOT: .amdhsa_memory_ordered 0
310 define amdgpu_kernel void @wavefront_one_as_acquire() {
312 fence syncscope("wavefront-one-as") acquire
316 ; FUNC-LABEL: {{^}}wavefront_one_as_release:
318 ; GCN-NOT: ATOMIC_FENCE
320 ; GFX10: .amdhsa_kernel wavefront_one_as_release
321 ; GFX10WGP-NOT: .amdhsa_workgroup_processor_mode 0
322 ; GFX10CU: .amdhsa_workgroup_processor_mode 0
323 ; GFX10-NOT: .amdhsa_memory_ordered 0
324 define amdgpu_kernel void @wavefront_one_as_release() {
326 fence syncscope("wavefront-one-as") release
330 ; FUNC-LABEL: {{^}}wavefront_one_as_acq_rel:
332 ; GCN-NOT: ATOMIC_FENCE
334 ; GFX10: .amdhsa_kernel wavefront_one_as_acq_rel
335 ; GFX10WGP-NOT: .amdhsa_workgroup_processor_mode 0
336 ; GFX10CU: .amdhsa_workgroup_processor_mode 0
337 ; GFX10-NOT: .amdhsa_memory_ordered 0
338 define amdgpu_kernel void @wavefront_one_as_acq_rel() {
340 fence syncscope("wavefront-one-as") acq_rel
344 ; FUNC-LABEL: {{^}}wavefront_one_as_seq_cst:
346 ; GCN-NOT: ATOMIC_FENCE
348 ; GFX10: .amdhsa_kernel wavefront_one_as_seq_cst
349 ; GFX10WGP-NOT: .amdhsa_workgroup_processor_mode 0
350 ; GFX10CU: .amdhsa_workgroup_processor_mode 0
351 ; GFX10-NOT: .amdhsa_memory_ordered 0
352 define amdgpu_kernel void @wavefront_one_as_seq_cst() {
354 fence syncscope("wavefront-one-as") seq_cst
358 ; FUNC-LABEL: {{^}}system_acquire:
360 ; GCN-NOT: ATOMIC_FENCE
361 ; GFX6: s_waitcnt vmcnt(0) lgkmcnt(0){{$}}
362 ; GFX6-NEXT: buffer_wbinvl1{{$}}
363 ; GFX8: s_waitcnt vmcnt(0) lgkmcnt(0){{$}}
364 ; GFX8-NEXT: buffer_wbinvl1_vol{{$}}
365 ; GFX10: s_waitcnt vmcnt(0) lgkmcnt(0){{$}}
366 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0{{$}}
367 ; GFX10-NEXT: buffer_gl0_inv{{$}}
368 ; GFX10-NEXT: buffer_gl1_inv{{$}}
370 ; GFX10: .amdhsa_kernel system_acquire
371 ; GFX10WGP-NOT: .amdhsa_workgroup_processor_mode 0
372 ; GFX10CU: .amdhsa_workgroup_processor_mode 0
373 ; GFX10-NOT: .amdhsa_memory_ordered 0
374 define amdgpu_kernel void @system_acquire() {
380 ; FUNC-LABEL: {{^}}system_release:
382 ; GCN-NOT: ATOMIC_FENCE
383 ; GFX6: s_waitcnt vmcnt(0) lgkmcnt(0){{$}}
384 ; GFX8: s_waitcnt vmcnt(0) lgkmcnt(0){{$}}
385 ; GFX10: s_waitcnt vmcnt(0) lgkmcnt(0){{$}}
386 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0{{$}}
388 ; GFX10: .amdhsa_kernel system_release
389 ; GFX10WGP-NOT: .amdhsa_workgroup_processor_mode 0
390 ; GFX10CU: .amdhsa_workgroup_processor_mode 0
391 ; GFX10-NOT: .amdhsa_memory_ordered 0
392 define amdgpu_kernel void @system_release() {
398 ; FUNC-LABEL: {{^}}system_acq_rel:
400 ; GCN-NOT: ATOMIC_FENCE
401 ; GFX6: s_waitcnt vmcnt(0) lgkmcnt(0){{$}}
402 ; GFX8: s_waitcnt vmcnt(0) lgkmcnt(0){{$}}
403 ; GFX10: s_waitcnt vmcnt(0) lgkmcnt(0){{$}}
404 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0{{$}}
405 ; GFX6: buffer_wbinvl1{{$}}
406 ; GFX8: buffer_wbinvl1_vol{{$}}
407 ; GFX10-NEXT: buffer_gl0_inv{{$}}
408 ; GFX10-NEXT: buffer_gl1_inv{{$}}
410 ; GFX10: .amdhsa_kernel system_acq_rel
411 ; GFX10WGP-NOT: .amdhsa_workgroup_processor_mode 0
412 ; GFX10CU: .amdhsa_workgroup_processor_mode 0
413 ; GFX10-NOT: .amdhsa_memory_ordered 0
414 define amdgpu_kernel void @system_acq_rel() {
420 ; FUNC-LABEL: {{^}}system_seq_cst:
422 ; GCN-NOT: ATOMIC_FENCE
423 ; GFX6: s_waitcnt vmcnt(0) lgkmcnt(0){{$}}
424 ; GFX8: s_waitcnt vmcnt(0) lgkmcnt(0){{$}}
425 ; GFX10: s_waitcnt vmcnt(0) lgkmcnt(0){{$}}
426 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0{{$}}
427 ; GFX6: buffer_wbinvl1{{$}}
428 ; GFX8: buffer_wbinvl1_vol{{$}}
429 ; GFX10-NEXT: buffer_gl0_inv{{$}}
430 ; GFX10-NEXT: buffer_gl1_inv{{$}}
432 ; GFX10: .amdhsa_kernel system_seq_cst
433 ; GFX10WGP-NOT: .amdhsa_workgroup_processor_mode 0
434 ; GFX10CU: .amdhsa_workgroup_processor_mode 0
435 ; GFX10-NOT: .amdhsa_memory_ordered 0
436 define amdgpu_kernel void @system_seq_cst() {
442 ; FUNC-LABEL: {{^}}singlethread_acquire:
444 ; GCN-NOT: ATOMIC_FENCE
446 ; GFX10: .amdhsa_kernel singlethread_acquire
447 ; GFX10WGP-NOT: .amdhsa_workgroup_processor_mode 0
448 ; GFX10CU: .amdhsa_workgroup_processor_mode 0
449 ; GFX10-NOT: .amdhsa_memory_ordered 0
450 define amdgpu_kernel void @singlethread_acquire() {
452 fence syncscope("singlethread") acquire
456 ; FUNC-LABEL: {{^}}singlethread_release:
458 ; GCN-NOT: ATOMIC_FENCE
460 ; GFX10: .amdhsa_kernel singlethread_release
461 ; GFX10WGP-NOT: .amdhsa_workgroup_processor_mode 0
462 ; GFX10CU: .amdhsa_workgroup_processor_mode 0
463 ; GFX10-NOT: .amdhsa_memory_ordered 0
464 define amdgpu_kernel void @singlethread_release() {
466 fence syncscope("singlethread") release
470 ; FUNC-LABEL: {{^}}singlethread_acq_rel:
472 ; GCN-NOT: ATOMIC_FENCE
474 ; GFX10: .amdhsa_kernel singlethread_acq_rel
475 ; GFX10WGP-NOT: .amdhsa_workgroup_processor_mode 0
476 ; GFX10CU: .amdhsa_workgroup_processor_mode 0
477 ; GFX10-NOT: .amdhsa_memory_ordered 0
478 define amdgpu_kernel void @singlethread_acq_rel() {
480 fence syncscope("singlethread") acq_rel
484 ; FUNC-LABEL: {{^}}singlethread_seq_cst:
486 ; GCN-NOT: ATOMIC_FENCE
488 ; GFX10: .amdhsa_kernel singlethread_seq_cst
489 ; GFX10WGP-NOT: .amdhsa_workgroup_processor_mode 0
490 ; GFX10CU: .amdhsa_workgroup_processor_mode 0
491 ; GFX10-NOT: .amdhsa_memory_ordered 0
492 define amdgpu_kernel void @singlethread_seq_cst() {
494 fence syncscope("singlethread") seq_cst
498 ; FUNC-LABEL: {{^}}agent_acquire:
500 ; GCN-NOT: ATOMIC_FENCE
501 ; GFX6: s_waitcnt vmcnt(0) lgkmcnt(0){{$}}
502 ; GFX6-NEXT: buffer_wbinvl1{{$}}
503 ; GFX8: s_waitcnt vmcnt(0) lgkmcnt(0){{$}}
504 ; GFX8-NEXT: buffer_wbinvl1_vol{{$}}
505 ; GFX10: s_waitcnt vmcnt(0) lgkmcnt(0){{$}}
506 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0{{$}}
507 ; GFX10-NEXT: buffer_gl0_inv{{$}}
508 ; GFX10-NEXT: buffer_gl1_inv{{$}}
510 ; GFX10: .amdhsa_kernel agent_acquire
511 ; GFX10WGP-NOT: .amdhsa_workgroup_processor_mode 0
512 ; GFX10CU: .amdhsa_workgroup_processor_mode 0
513 ; GFX10-NOT: .amdhsa_memory_ordered 0
514 define amdgpu_kernel void @agent_acquire() {
516 fence syncscope("agent") acquire
520 ; FUNC-LABEL: {{^}}agent_release:
522 ; GCN-NOT: ATOMIC_FENCE
523 ; GFX6: s_waitcnt vmcnt(0) lgkmcnt(0){{$}}
524 ; GFX8: s_waitcnt vmcnt(0) lgkmcnt(0){{$}}
525 ; GFX10: s_waitcnt vmcnt(0) lgkmcnt(0){{$}}
526 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0{{$}}
528 ; GFX10: .amdhsa_kernel agent_release
529 ; GFX10WGP-NOT: .amdhsa_workgroup_processor_mode 0
530 ; GFX10CU: .amdhsa_workgroup_processor_mode 0
531 ; GFX10-NOT: .amdhsa_memory_ordered 0
532 define amdgpu_kernel void @agent_release() {
534 fence syncscope("agent") release
538 ; FUNC-LABEL: {{^}}agent_acq_rel:
540 ; GCN-NOT: ATOMIC_FENCE
541 ; GFX6: s_waitcnt vmcnt(0) lgkmcnt(0){{$}}
542 ; GFX8: s_waitcnt vmcnt(0) lgkmcnt(0){{$}}
543 ; GFX10: s_waitcnt vmcnt(0) lgkmcnt(0){{$}}
544 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0{{$}}
545 ; GFX6: buffer_wbinvl1{{$}}
546 ; GFX8: buffer_wbinvl1_vol{{$}}
547 ; GFX10-NEXT: buffer_gl0_inv{{$}}
548 ; GFX10-NEXT: buffer_gl1_inv{{$}}
550 ; GFX10: .amdhsa_kernel agent_acq_rel
551 ; GFX10WGP-NOT: .amdhsa_workgroup_processor_mode 0
552 ; GFX10CU: .amdhsa_workgroup_processor_mode 0
553 ; GFX10-NOT: .amdhsa_memory_ordered 0
554 define amdgpu_kernel void @agent_acq_rel() {
556 fence syncscope("agent") acq_rel
560 ; FUNC-LABEL: {{^}}agent_seq_cst:
562 ; GCN-NOT: ATOMIC_FENCE
563 ; GFX6: s_waitcnt vmcnt(0) lgkmcnt(0){{$}}
564 ; GFX8: s_waitcnt vmcnt(0) lgkmcnt(0){{$}}
565 ; GFX10: s_waitcnt vmcnt(0) lgkmcnt(0){{$}}
566 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0{{$}}
567 ; GFX6: buffer_wbinvl1{{$}}
568 ; GFX8: buffer_wbinvl1_vol{{$}}
569 ; GFX10-NEXT: buffer_gl0_inv{{$}}
570 ; GFX10-NEXT: buffer_gl1_inv{{$}}
572 ; GFX10: .amdhsa_kernel agent_seq_cst
573 ; GFX10WGP-NOT: .amdhsa_workgroup_processor_mode 0
574 ; GFX10CU: .amdhsa_workgroup_processor_mode 0
575 ; GFX10-NOT: .amdhsa_memory_ordered 0
576 define amdgpu_kernel void @agent_seq_cst() {
578 fence syncscope("agent") seq_cst
582 ; FUNC-LABEL: {{^}}workgroup_acquire:
584 ; GFX68-NOT: s_waitcnt vmcnt(0){{$}}
585 ; GFX10WGP: s_waitcnt vmcnt(0) lgkmcnt(0){{$}}
586 ; GFX10WGP-NEXT: s_waitcnt_vscnt null, 0x0{{$}}
587 ; GFX10CU-NOT: s_waitcnt vmcnt(0){{$}}
588 ; GFX10CU-NOT: s_waitcnt_vscnt null, 0x0{{$}}
589 ; GFX10WGP-NEXT: buffer_gl0_inv{{$}}
590 ; GFX10CU-NOT: buffer_gl0_inv{{$}}
591 ; GCN-NOT: ATOMIC_FENCE
593 ; GFX10: .amdhsa_kernel workgroup_acquire
594 ; GFX10WGP-NOT: .amdhsa_workgroup_processor_mode 0
595 ; GFX10CU: .amdhsa_workgroup_processor_mode 0
596 ; GFX10-NOT: .amdhsa_memory_ordered 0
597 define amdgpu_kernel void @workgroup_acquire() {
599 fence syncscope("workgroup") acquire
603 ; FUNC-LABEL: {{^}}workgroup_release:
605 ; GFX68-NOT: s_waitcnt vmcnt(0){{$}}
606 ; GFX10WGP: s_waitcnt vmcnt(0) lgkmcnt(0){{$}}
607 ; GFX10WGP-NEXT: s_waitcnt_vscnt null, 0x0{{$}}
608 ; GFX10CU-NOT: s_waitcnt vmcnt(0){{$}}
609 ; GFX10CU-NOT: s_waitcnt_vscnt null, 0x0{{$}}
610 ; GFX10-NOT: buffer_gl0_inv
611 ; GCN-NOT: ATOMIC_FENCE
613 ; GFX10: .amdhsa_kernel workgroup_release
614 ; GFX10WGP-NOT: .amdhsa_workgroup_processor_mode 0
615 ; GFX10CU: .amdhsa_workgroup_processor_mode 0
616 ; GFX10-NOT: .amdhsa_memory_ordered 0
617 define amdgpu_kernel void @workgroup_release() {
619 fence syncscope("workgroup") release
623 ; FUNC-LABEL: {{^}}workgroup_acq_rel:
625 ; GFX68-NOT: s_waitcnt vmcnt(0){{$}}
626 ; GFX10WGP: s_waitcnt vmcnt(0) lgkmcnt(0){{$}}
627 ; GFX10WGP-NEXT: s_waitcnt_vscnt null, 0x0{{$}}
628 ; GFX10WGP-NEXT: buffer_gl0_inv{{$}}
629 ; GFX10CU-NOT: s_waitcnt vmcnt(0){{$}}
630 ; GFX10CU-NOT: s_waitcnt_vscnt null, 0x0{{$}}
631 ; GFX10CU-NOT: buffer_gl0_inv{{$}}
632 ; GCN-NOT: ATOMIC_FENCE
634 ; GFX10: .amdhsa_kernel workgroup_acq_rel
635 ; GFX10WGP-NOT: .amdhsa_workgroup_processor_mode 0
636 ; GFX10CU: .amdhsa_workgroup_processor_mode 0
637 ; GFX10-NOT: .amdhsa_memory_ordered 0
638 define amdgpu_kernel void @workgroup_acq_rel() {
640 fence syncscope("workgroup") acq_rel
644 ; FUNC-LABEL: {{^}}workgroup_seq_cst:
646 ; GFX68-NOT: s_waitcnt vmcnt(0){{$}}
647 ; GFX10WGP: s_waitcnt vmcnt(0) lgkmcnt(0){{$}}
648 ; GFX10WGP-NEXT: s_waitcnt_vscnt null, 0x0{{$}}
649 ; GFX10WGP-NEXT: buffer_gl0_inv{{$}}
650 ; GFX10CU-NOT: s_waitcnt vmcnt(0){{$}}
651 ; GFX10CU-NOT: s_waitcnt_vscnt null, 0x0{{$}}
652 ; GFX10CU-NOT: buffer_gl0_inv{{$}}
653 ; GCN-NOT: ATOMIC_FENCE
655 ; GFX10: .amdhsa_kernel workgroup_seq_cst
656 ; GFX10WGP-NOT: .amdhsa_workgroup_processor_mode 0
657 ; GFX10CU: .amdhsa_workgroup_processor_mode 0
658 ; GFX10-NOT: .amdhsa_memory_ordered 0
659 define amdgpu_kernel void @workgroup_seq_cst() {
661 fence syncscope("workgroup") seq_cst
665 ; FUNC-LABEL: {{^}}wavefront_acquire:
667 ; GCN-NOT: ATOMIC_FENCE
669 ; GFX10: .amdhsa_kernel wavefront_acquire
670 ; GFX10WGP-NOT: .amdhsa_workgroup_processor_mode 0
671 ; GFX10CU: .amdhsa_workgroup_processor_mode 0
672 ; GFX10-NOT: .amdhsa_memory_ordered 0
673 define amdgpu_kernel void @wavefront_acquire() {
675 fence syncscope("wavefront") acquire
679 ; FUNC-LABEL: {{^}}wavefront_release:
681 ; GCN-NOT: ATOMIC_FENCE
683 ; GFX10: .amdhsa_kernel wavefront_release
684 ; GFX10WGP-NOT: .amdhsa_workgroup_processor_mode 0
685 ; GFX10CU: .amdhsa_workgroup_processor_mode 0
686 ; GFX10-NOT: .amdhsa_memory_ordered 0
687 define amdgpu_kernel void @wavefront_release() {
689 fence syncscope("wavefront") release
693 ; FUNC-LABEL: {{^}}wavefront_acq_rel:
695 ; GCN-NOT: ATOMIC_FENCE
697 ; GFX10: .amdhsa_kernel wavefront_acq_rel
698 ; GFX10WGP-NOT: .amdhsa_workgroup_processor_mode 0
699 ; GFX10CU: .amdhsa_workgroup_processor_mode 0
700 ; GFX10-NOT: .amdhsa_memory_ordered 0
701 define amdgpu_kernel void @wavefront_acq_rel() {
703 fence syncscope("wavefront") acq_rel
707 ; FUNC-LABEL: {{^}}wavefront_seq_cst:
709 ; GCN-NOT: ATOMIC_FENCE
711 ; GFX10: .amdhsa_kernel wavefront_seq_cst
712 ; GFX10WGP-NOT: .amdhsa_workgroup_processor_mode 0
713 ; GFX10CU: .amdhsa_workgroup_processor_mode 0
714 ; GFX10-NOT: .amdhsa_memory_ordered 0
715 define amdgpu_kernel void @wavefront_seq_cst() {
717 fence syncscope("wavefront") seq_cst