1 ; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 ; RUN: llc -global-isel -mtriple=amdgcn-amd-amdhsa -verify-machineinstrs -stop-after=irtranslator < %s | FileCheck %s
4 define amdgpu_kernel void @system_one_as_acquire() {
5 ; CHECK-LABEL: name: system_one_as_acquire
6 ; CHECK: bb.1 (%ir-block.0):
9 fence syncscope("one-as") acquire
13 define amdgpu_kernel void @system_one_as_release() {
14 ; CHECK-LABEL: name: system_one_as_release
15 ; CHECK: bb.1 (%ir-block.0):
18 fence syncscope("one-as") release
22 define amdgpu_kernel void @system_one_as_acq_rel() {
23 ; CHECK-LABEL: name: system_one_as_acq_rel
24 ; CHECK: bb.1 (%ir-block.0):
27 fence syncscope("one-as") acq_rel
31 define amdgpu_kernel void @system_one_as_seq_cst() {
32 ; CHECK-LABEL: name: system_one_as_seq_cst
33 ; CHECK: bb.1 (%ir-block.0):
36 fence syncscope("one-as") seq_cst
40 define amdgpu_kernel void @singlethread_one_as_acquire() {
41 ; CHECK-LABEL: name: singlethread_one_as_acquire
42 ; CHECK: bb.1 (%ir-block.0):
45 fence syncscope("singlethread-one-as") acquire
49 define amdgpu_kernel void @singlethread_one_as_release() {
50 ; CHECK-LABEL: name: singlethread_one_as_release
51 ; CHECK: bb.1 (%ir-block.0):
54 fence syncscope("singlethread-one-as") release
58 define amdgpu_kernel void @singlethread_one_as_acq_rel() {
59 ; CHECK-LABEL: name: singlethread_one_as_acq_rel
60 ; CHECK: bb.1 (%ir-block.0):
63 fence syncscope("singlethread-one-as") acq_rel
67 define amdgpu_kernel void @singlethread_one_as_seq_cst() {
68 ; CHECK-LABEL: name: singlethread_one_as_seq_cst
69 ; CHECK: bb.1 (%ir-block.0):
72 fence syncscope("singlethread-one-as") seq_cst
76 define amdgpu_kernel void @agent_one_as_acquire() {
77 ; CHECK-LABEL: name: agent_one_as_acquire
78 ; CHECK: bb.1 (%ir-block.0):
81 fence syncscope("agent-one-as") acquire
85 define amdgpu_kernel void @agent_one_as_release() {
86 ; CHECK-LABEL: name: agent_one_as_release
87 ; CHECK: bb.1 (%ir-block.0):
90 fence syncscope("agent-one-as") release
94 define amdgpu_kernel void @agent_one_as_acq_rel() {
95 ; CHECK-LABEL: name: agent_one_as_acq_rel
96 ; CHECK: bb.1 (%ir-block.0):
99 fence syncscope("agent-one-as") acq_rel
103 define amdgpu_kernel void @agent_one_as_seq_cst() {
104 ; CHECK-LABEL: name: agent_one_as_seq_cst
105 ; CHECK: bb.1 (%ir-block.0):
106 ; CHECK: G_FENCE 7, 4
108 fence syncscope("agent-one-as") seq_cst
112 define amdgpu_kernel void @workgroup_one_as_acquire() {
113 ; CHECK-LABEL: name: workgroup_one_as_acquire
114 ; CHECK: bb.1 (%ir-block.0):
115 ; CHECK: G_FENCE 4, 5
117 fence syncscope("workgroup-one-as") acquire
121 define amdgpu_kernel void @workgroup_one_as_release() {
122 ; CHECK-LABEL: name: workgroup_one_as_release
123 ; CHECK: bb.1 (%ir-block.0):
124 ; CHECK: G_FENCE 5, 5
126 fence syncscope("workgroup-one-as") release
130 define amdgpu_kernel void @workgroup_one_as_acq_rel() {
131 ; CHECK-LABEL: name: workgroup_one_as_acq_rel
132 ; CHECK: bb.1 (%ir-block.0):
133 ; CHECK: G_FENCE 6, 5
135 fence syncscope("workgroup-one-as") acq_rel
139 define amdgpu_kernel void @workgroup_one_as_seq_cst() {
140 ; CHECK-LABEL: name: workgroup_one_as_seq_cst
141 ; CHECK: bb.1 (%ir-block.0):
142 ; CHECK: G_FENCE 7, 5
144 fence syncscope("workgroup-one-as") seq_cst
148 define amdgpu_kernel void @wavefront_one_as_acquire() {
149 ; CHECK-LABEL: name: wavefront_one_as_acquire
150 ; CHECK: bb.1 (%ir-block.0):
151 ; CHECK: G_FENCE 4, 6
153 fence syncscope("wavefront-one-as") acquire
157 define amdgpu_kernel void @wavefront_one_as_release() {
158 ; CHECK-LABEL: name: wavefront_one_as_release
159 ; CHECK: bb.1 (%ir-block.0):
160 ; CHECK: G_FENCE 5, 6
162 fence syncscope("wavefront-one-as") release
166 define amdgpu_kernel void @wavefront_one_as_acq_rel() {
167 ; CHECK-LABEL: name: wavefront_one_as_acq_rel
168 ; CHECK: bb.1 (%ir-block.0):
169 ; CHECK: G_FENCE 6, 6
171 fence syncscope("wavefront-one-as") acq_rel
175 define amdgpu_kernel void @wavefront_one_as_seq_cst() {
176 ; CHECK-LABEL: name: wavefront_one_as_seq_cst
177 ; CHECK: bb.1 (%ir-block.0):
178 ; CHECK: G_FENCE 7, 6
180 fence syncscope("wavefront-one-as") seq_cst
184 define amdgpu_kernel void @system_acquire() {
185 ; CHECK-LABEL: name: system_acquire
192 define amdgpu_kernel void @system_release() {
193 ; CHECK-LABEL: name: system_release
194 ; CHECK: bb.1 (%ir-block.0):
195 ; CHECK: G_FENCE 5, 1
201 define amdgpu_kernel void @system_acq_rel() {
202 ; CHECK-LABEL: name: system_acq_rel
203 ; CHECK: bb.1 (%ir-block.0):
204 ; CHECK: G_FENCE 6, 1
210 define amdgpu_kernel void @system_seq_cst() {
211 ; CHECK-LABEL: name: system_seq_cst
212 ; CHECK: bb.1 (%ir-block.0):
213 ; CHECK: G_FENCE 7, 1
219 define amdgpu_kernel void @singlethread_acquire() {
220 ; CHECK-LABEL: name: singlethread_acquire
221 ; CHECK: bb.1 (%ir-block.0):
222 ; CHECK: G_FENCE 4, 0
224 fence syncscope("singlethread") acquire
228 define amdgpu_kernel void @singlethread_release() {
229 ; CHECK-LABEL: name: singlethread_release
230 ; CHECK: bb.1 (%ir-block.0):
231 ; CHECK: G_FENCE 5, 0
233 fence syncscope("singlethread") release
237 define amdgpu_kernel void @singlethread_acq_rel() {
238 ; CHECK-LABEL: name: singlethread_acq_rel
239 ; CHECK: bb.1 (%ir-block.0):
240 ; CHECK: G_FENCE 6, 0
242 fence syncscope("singlethread") acq_rel
246 define amdgpu_kernel void @singlethread_seq_cst() {
247 ; CHECK-LABEL: name: singlethread_seq_cst
248 ; CHECK: bb.1 (%ir-block.0):
249 ; CHECK: G_FENCE 7, 0
251 fence syncscope("singlethread") seq_cst
255 define amdgpu_kernel void @agent_acquire() {
256 ; CHECK-LABEL: name: agent_acquire
257 ; CHECK: bb.1 (%ir-block.0):
258 ; CHECK: G_FENCE 4, 7
260 fence syncscope("agent") acquire
264 define amdgpu_kernel void @agent_release() {
265 ; CHECK-LABEL: name: agent_release
266 ; CHECK: bb.1 (%ir-block.0):
267 ; CHECK: G_FENCE 5, 7
269 fence syncscope("agent") release
273 define amdgpu_kernel void @agent_acq_rel() {
274 ; CHECK-LABEL: name: agent_acq_rel
275 ; CHECK: bb.1 (%ir-block.0):
276 ; CHECK: G_FENCE 6, 7
278 fence syncscope("agent") acq_rel
282 define amdgpu_kernel void @agent_seq_cst() {
283 ; CHECK-LABEL: name: agent_seq_cst
284 ; CHECK: bb.1 (%ir-block.0):
285 ; CHECK: G_FENCE 7, 7
287 fence syncscope("agent") seq_cst
291 define amdgpu_kernel void @workgroup_acquire() {
292 ; CHECK-LABEL: name: workgroup_acquire
293 ; CHECK: bb.1 (%ir-block.0):
294 ; CHECK: G_FENCE 4, 8
296 fence syncscope("workgroup") acquire
300 define amdgpu_kernel void @workgroup_release() {
301 ; CHECK-LABEL: name: workgroup_release
302 ; CHECK: bb.1 (%ir-block.0):
303 ; CHECK: G_FENCE 5, 8
305 fence syncscope("workgroup") release
309 define amdgpu_kernel void @workgroup_acq_rel() {
310 ; CHECK-LABEL: name: workgroup_acq_rel
311 ; CHECK: bb.1 (%ir-block.0):
312 ; CHECK: G_FENCE 6, 8
314 fence syncscope("workgroup") acq_rel
318 define amdgpu_kernel void @workgroup_seq_cst() {
319 ; CHECK-LABEL: name: workgroup_seq_cst
320 ; CHECK: bb.1 (%ir-block.0):
321 ; CHECK: G_FENCE 7, 8
323 fence syncscope("workgroup") seq_cst
327 define amdgpu_kernel void @wavefront_acquire() {
328 ; CHECK-LABEL: name: wavefront_acquire
329 ; CHECK: bb.1 (%ir-block.0):
330 ; CHECK: G_FENCE 4, 9
332 fence syncscope("wavefront") acquire
336 define amdgpu_kernel void @wavefront_release() {
337 ; CHECK-LABEL: name: wavefront_release
338 ; CHECK: bb.1 (%ir-block.0):
339 ; CHECK: G_FENCE 5, 9
341 fence syncscope("wavefront") release
345 define amdgpu_kernel void @wavefront_acq_rel() {
346 ; CHECK-LABEL: name: wavefront_acq_rel
347 ; CHECK: bb.1 (%ir-block.0):
348 ; CHECK: G_FENCE 6, 9
350 fence syncscope("wavefront") acq_rel
354 define amdgpu_kernel void @wavefront_seq_cst() {
355 ; CHECK-LABEL: name: wavefront_seq_cst
356 ; CHECK: bb.1 (%ir-block.0):
357 ; CHECK: G_FENCE 7, 9
359 fence syncscope("wavefront") seq_cst