1 ; RUN: llc -mtriple=amdgcn--amdpal -mcpu=gfx600 -verify-machineinstrs < %s | FileCheck -check-prefixes=FUNC,GCN %s
2 ; RUN: llc -mtriple=amdgcn--amdpal -mcpu=gfx700 -verify-machineinstrs < %s | FileCheck -check-prefixes=FUNC,GCN %s
3 ; RUN: llc -mtriple=amdgcn--amdpal -mcpu=gfx800 -verify-machineinstrs < %s | FileCheck -check-prefixes=FUNC,GCN %s
4 ; RUN: llc -mtriple=amdgcn--amdpal -mcpu=gfx900 -verify-machineinstrs < %s | FileCheck -check-prefixes=FUNC,GCN %s
6 ; FUNC-LABEL: {{^}}system_acquire:
8 ; GCN-NOT: ATOMIC_FENCE
9 ; GCN: s_waitcnt vmcnt(0) lgkmcnt(0){{$}}
10 ; GCN-NEXT: buffer_wbinvl1{{$}}
12 define amdgpu_kernel void @system_acquire() {
18 ; FUNC-LABEL: {{^}}system_release:
20 ; GCN-NOT: ATOMIC_FENCE
21 ; GCN: s_waitcnt vmcnt(0) lgkmcnt(0){{$}}
23 define amdgpu_kernel void @system_release() {
29 ; FUNC-LABEL: {{^}}system_acq_rel:
31 ; GCN-NOT: ATOMIC_FENCE
32 ; GCN: s_waitcnt vmcnt(0) lgkmcnt(0){{$}}
33 ; GCN: buffer_wbinvl1{{$}}
35 define amdgpu_kernel void @system_acq_rel() {
41 ; FUNC-LABEL: {{^}}system_seq_cst:
43 ; GCN-NOT: ATOMIC_FENCE
44 ; GCN: s_waitcnt vmcnt(0) lgkmcnt(0){{$}}
45 ; GCN: buffer_wbinvl1{{$}}
47 define amdgpu_kernel void @system_seq_cst() {
53 ; FUNC-LABEL: {{^}}system_one_as_acquire:
55 ; GCN-NOT: ATOMIC_FENCE
56 ; GCN: s_waitcnt vmcnt(0){{$}}
57 ; GCN-NEXT: buffer_wbinvl1{{$}}
59 define amdgpu_kernel void @system_one_as_acquire() {
61 fence syncscope("one-as") acquire
65 ; FUNC-LABEL: {{^}}system_one_as_release:
67 ; GCN-NOT: ATOMIC_FENCE
68 ; GCN: s_waitcnt vmcnt(0){{$}}
70 define amdgpu_kernel void @system_one_as_release() {
72 fence syncscope("one-as") release
76 ; FUNC-LABEL: {{^}}system_one_as_acq_rel:
78 ; GCN-NOT: ATOMIC_FENCE
79 ; GCN: s_waitcnt vmcnt(0){{$}}
80 ; GCN: buffer_wbinvl1{{$}}
82 define amdgpu_kernel void @system_one_as_acq_rel() {
84 fence syncscope("one-as") acq_rel
88 ; FUNC-LABEL: {{^}}system_one_as_seq_cst:
90 ; GCN-NOT: ATOMIC_FENCE
91 ; GCN: s_waitcnt vmcnt(0){{$}}
92 ; GCN: buffer_wbinvl1{{$}}
94 define amdgpu_kernel void @system_one_as_seq_cst() {
96 fence syncscope("one-as") seq_cst
100 ; FUNC-LABEL: {{^}}singlethread_acquire:
102 ; GCN-NOT: ATOMIC_FENCE
104 define amdgpu_kernel void @singlethread_acquire() {
106 fence syncscope("singlethread") acquire
110 ; FUNC-LABEL: {{^}}singlethread_release:
112 ; GCN-NOT: ATOMIC_FENCE
114 define amdgpu_kernel void @singlethread_release() {
116 fence syncscope("singlethread") release
120 ; FUNC-LABEL: {{^}}singlethread_acq_rel:
122 ; GCN-NOT: ATOMIC_FENCE
124 define amdgpu_kernel void @singlethread_acq_rel() {
126 fence syncscope("singlethread") acq_rel
130 ; FUNC-LABEL: {{^}}singlethread_seq_cst:
132 ; GCN-NOT: ATOMIC_FENCE
134 define amdgpu_kernel void @singlethread_seq_cst() {
136 fence syncscope("singlethread") seq_cst
140 ; FUNC-LABEL: {{^}}singlethread_one_as_acquire:
142 ; GCN-NOT: ATOMIC_FENCE
144 define amdgpu_kernel void @singlethread_one_as_acquire() {
146 fence syncscope("singlethread-one-as") acquire
150 ; FUNC-LABEL: {{^}}singlethread_one_as_release:
152 ; GCN-NOT: ATOMIC_FENCE
154 define amdgpu_kernel void @singlethread_one_as_release() {
156 fence syncscope("singlethread-one-as") release
160 ; FUNC-LABEL: {{^}}singlethread_one_as_acq_rel:
162 ; GCN-NOT: ATOMIC_FENCE
164 define amdgpu_kernel void @singlethread_one_as_acq_rel() {
166 fence syncscope("singlethread-one-as") acq_rel
170 ; FUNC-LABEL: {{^}}singlethread_one_as_seq_cst:
172 ; GCN-NOT: ATOMIC_FENCE
174 define amdgpu_kernel void @singlethread_one_as_seq_cst() {
176 fence syncscope("singlethread-one-as") seq_cst
180 ; FUNC-LABEL: {{^}}agent_acquire:
182 ; GCN-NOT: ATOMIC_FENCE
183 ; GCN: s_waitcnt vmcnt(0) lgkmcnt(0){{$}}
184 ; GCN-NEXT: buffer_wbinvl1{{$}}
186 define amdgpu_kernel void @agent_acquire() {
188 fence syncscope("agent") acquire
192 ; FUNC-LABEL: {{^}}agent_release:
194 ; GCN-NOT: ATOMIC_FENCE
195 ; GCN: s_waitcnt vmcnt(0) lgkmcnt(0){{$}}
197 define amdgpu_kernel void @agent_release() {
199 fence syncscope("agent") release
203 ; FUNC-LABEL: {{^}}agent_acq_rel:
205 ; GCN-NOT: ATOMIC_FENCE
206 ; GCN: s_waitcnt vmcnt(0) lgkmcnt(0){{$}}
207 ; GCN: buffer_wbinvl1{{$}}
209 define amdgpu_kernel void @agent_acq_rel() {
211 fence syncscope("agent") acq_rel
215 ; FUNC-LABEL: {{^}}agent_seq_cst:
217 ; GCN-NOT: ATOMIC_FENCE
218 ; GCN: s_waitcnt vmcnt(0) lgkmcnt(0){{$}}
219 ; GCN: buffer_wbinvl1{{$}}
221 define amdgpu_kernel void @agent_seq_cst() {
223 fence syncscope("agent") seq_cst
227 ; FUNC-LABEL: {{^}}agent_one_as_acquire:
229 ; GCN-NOT: ATOMIC_FENCE
230 ; GCN: s_waitcnt vmcnt(0){{$}}
231 ; GCN-NEXT: buffer_wbinvl1{{$}}
233 define amdgpu_kernel void @agent_one_as_acquire() {
235 fence syncscope("agent-one-as") acquire
239 ; FUNC-LABEL: {{^}}agent_one_as_release:
241 ; GCN-NOT: ATOMIC_FENCE
242 ; GCN: s_waitcnt vmcnt(0){{$}}
244 define amdgpu_kernel void @agent_one_as_release() {
246 fence syncscope("agent-one-as") release
250 ; FUNC-LABEL: {{^}}agent_one_as_acq_rel:
252 ; GCN-NOT: ATOMIC_FENCE
253 ; GCN: s_waitcnt vmcnt(0){{$}}
254 ; GCN: buffer_wbinvl1{{$}}
256 define amdgpu_kernel void @agent_one_as_acq_rel() {
258 fence syncscope("agent-one-as") acq_rel
262 ; FUNC-LABEL: {{^}}agent_one_as_seq_cst:
264 ; GCN-NOT: ATOMIC_FENCE
265 ; GCN: s_waitcnt vmcnt(0){{$}}
266 ; GCN: buffer_wbinvl1{{$}}
268 define amdgpu_kernel void @agent_one_as_seq_cst() {
270 fence syncscope("agent-one-as") seq_cst
274 ; FUNC-LABEL: {{^}}workgroup_acquire:
276 ; GCN-NOT: s_waitcnt vmcnt(0) lgkmcnt(0){{$}}
277 ; GCN-NOT: ATOMIC_FENCE
279 define amdgpu_kernel void @workgroup_acquire() {
281 fence syncscope("workgroup") acquire
285 ; FUNC-LABEL: {{^}}workgroup_release:
287 ; GCN-NOT: s_waitcnt vmcnt(0) lgkmcnt(0){{$}}
288 ; GCN-NOT: ATOMIC_FENCE
290 define amdgpu_kernel void @workgroup_release() {
292 fence syncscope("workgroup") release
296 ; FUNC-LABEL: {{^}}workgroup_acq_rel:
298 ; GCN-NOT: s_waitcnt vmcnt(0) lgkmcnt(0){{$}}
299 ; GCN-NOT: ATOMIC_FENCE
301 define amdgpu_kernel void @workgroup_acq_rel() {
303 fence syncscope("workgroup") acq_rel
307 ; FUNC-LABEL: {{^}}workgroup_seq_cst:
309 ; GCN-NOT: s_waitcnt vmcnt(0) lgkmcnt(0){{$}}
310 ; GCN-NOT: ATOMIC_FENCE
312 define amdgpu_kernel void @workgroup_seq_cst() {
314 fence syncscope("workgroup") seq_cst
318 ; FUNC-LABEL: {{^}}workgroup_one_as_acquire:
320 ; GCN-NOT: s_waitcnt vmcnt(0){{$}}
321 ; GCN-NOT: ATOMIC_FENCE
323 define amdgpu_kernel void @workgroup_one_as_acquire() {
325 fence syncscope("workgroup-one-as") acquire
329 ; FUNC-LABEL: {{^}}workgroup_one_as_release:
331 ; GCN-NOT: s_waitcnt vmcnt(0){{$}}
332 ; GCN-NOT: ATOMIC_FENCE
334 define amdgpu_kernel void @workgroup_one_as_release() {
336 fence syncscope("workgroup-one-as") release
340 ; FUNC-LABEL: {{^}}workgroup_one_as_acq_rel:
342 ; GCN-NOT: s_waitcnt vmcnt(0){{$}}
343 ; GCN-NOT: ATOMIC_FENCE
345 define amdgpu_kernel void @workgroup_one_as_acq_rel() {
347 fence syncscope("workgroup-one-as") acq_rel
351 ; FUNC-LABEL: {{^}}workgroup_one_as_seq_cst:
353 ; GCN-NOT: s_waitcnt vmcnt(0){{$}}
354 ; GCN-NOT: ATOMIC_FENCE
356 define amdgpu_kernel void @workgroup_one_as_seq_cst() {
358 fence syncscope("workgroup-one-as") seq_cst
362 ; FUNC-LABEL: {{^}}wavefront_acquire:
364 ; GCN-NOT: ATOMIC_FENCE
366 define amdgpu_kernel void @wavefront_acquire() {
368 fence syncscope("wavefront") acquire
372 ; FUNC-LABEL: {{^}}wavefront_release:
374 ; GCN-NOT: ATOMIC_FENCE
376 define amdgpu_kernel void @wavefront_release() {
378 fence syncscope("wavefront") release
382 ; FUNC-LABEL: {{^}}wavefront_acq_rel:
384 ; GCN-NOT: ATOMIC_FENCE
386 define amdgpu_kernel void @wavefront_acq_rel() {
388 fence syncscope("wavefront") acq_rel
392 ; FUNC-LABEL: {{^}}wavefront_seq_cst:
394 ; GCN-NOT: ATOMIC_FENCE
396 define amdgpu_kernel void @wavefront_seq_cst() {
398 fence syncscope("wavefront") seq_cst
402 ; FUNC-LABEL: {{^}}wavefront_one_as_acquire:
404 ; GCN-NOT: ATOMIC_FENCE
406 define amdgpu_kernel void @wavefront_one_as_acquire() {
408 fence syncscope("wavefront-one-as") acquire
412 ; FUNC-LABEL: {{^}}wavefront_one_as_release:
414 ; GCN-NOT: ATOMIC_FENCE
416 define amdgpu_kernel void @wavefront_one_as_release() {
418 fence syncscope("wavefront-one-as") release
422 ; FUNC-LABEL: {{^}}wavefront_one_as_acq_rel:
424 ; GCN-NOT: ATOMIC_FENCE
426 define amdgpu_kernel void @wavefront_one_as_acq_rel() {
428 fence syncscope("wavefront-one-as") acq_rel
432 ; FUNC-LABEL: {{^}}wavefront_one_as_seq_cst:
434 ; GCN-NOT: ATOMIC_FENCE
436 define amdgpu_kernel void @wavefront_one_as_seq_cst() {
438 fence syncscope("wavefront-one-as") seq_cst