blob: 02104826e6a10cd1447952e881dbd532f2ef3416 [file] [log] [blame]
Stanislav Mekhanoshin127dbdb2018-02-13 20:03:32 +00001; 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
Konstantin Zhuravlyove9a5a772017-07-21 21:19:23 +00004
Stanislav Mekhanoshin127dbdb2018-02-13 20:03:32 +00005; FUNC-LABEL: {{^}}system_acquire:
Francis Visoiu Mistrih25528d62017-12-04 17:18:51 +00006; GCN: %bb.0
Konstantin Zhuravlyove9a5a772017-07-21 21:19:23 +00007; GCN-NOT: ATOMIC_FENCE
8; GFX6: s_waitcnt vmcnt(0){{$}}
9; GFX6-NEXT: buffer_wbinvl1{{$}}
10; GFX8: s_waitcnt vmcnt(0){{$}}
11; GFX8-NEXT: buffer_wbinvl1_vol{{$}}
12; GCN: s_endpgm
13define amdgpu_kernel void @system_acquire() {
14entry:
15 fence acquire
16 ret void
17}
18
Stanislav Mekhanoshin127dbdb2018-02-13 20:03:32 +000019; FUNC-LABEL: {{^}}system_release:
Francis Visoiu Mistrih25528d62017-12-04 17:18:51 +000020; GCN: %bb.0
Konstantin Zhuravlyove9a5a772017-07-21 21:19:23 +000021; GCN-NOT: ATOMIC_FENCE
22; GCN: s_waitcnt vmcnt(0){{$}}
23; GCN: s_endpgm
24define amdgpu_kernel void @system_release() {
25entry:
26 fence release
27 ret void
28}
29
Stanislav Mekhanoshin127dbdb2018-02-13 20:03:32 +000030; FUNC-LABEL: {{^}}system_acq_rel:
Francis Visoiu Mistrih25528d62017-12-04 17:18:51 +000031; GCN: %bb.0
Konstantin Zhuravlyove9a5a772017-07-21 21:19:23 +000032; GCN-NOT: ATOMIC_FENCE
33; GCN: s_waitcnt vmcnt(0){{$}}
34; GFX6: buffer_wbinvl1{{$}}
35; GFX8: buffer_wbinvl1_vol{{$}}
36; GCN: s_endpgm
37define amdgpu_kernel void @system_acq_rel() {
38entry:
39 fence acq_rel
40 ret void
41}
42
Stanislav Mekhanoshin127dbdb2018-02-13 20:03:32 +000043; FUNC-LABEL: {{^}}system_seq_cst:
Francis Visoiu Mistrih25528d62017-12-04 17:18:51 +000044; GCN: %bb.0
Konstantin Zhuravlyove9a5a772017-07-21 21:19:23 +000045; GCN-NOT: ATOMIC_FENCE
46; GCN: s_waitcnt vmcnt(0){{$}}
47; GFX6: buffer_wbinvl1{{$}}
48; GFX8: buffer_wbinvl1_vol{{$}}
49; GCN: s_endpgm
50define amdgpu_kernel void @system_seq_cst() {
51entry:
52 fence seq_cst
53 ret void
54}
55
Stanislav Mekhanoshin127dbdb2018-02-13 20:03:32 +000056; FUNC-LABEL: {{^}}singlethread_acquire:
Francis Visoiu Mistrih25528d62017-12-04 17:18:51 +000057; GCN: %bb.0
Konstantin Zhuravlyove9a5a772017-07-21 21:19:23 +000058; GCN-NOT: ATOMIC_FENCE
59; GCN: s_endpgm
60define amdgpu_kernel void @singlethread_acquire() {
61entry:
62 fence syncscope("singlethread") acquire
63 ret void
64}
65
Stanislav Mekhanoshin127dbdb2018-02-13 20:03:32 +000066; FUNC-LABEL: {{^}}singlethread_release:
Francis Visoiu Mistrih25528d62017-12-04 17:18:51 +000067; GCN: %bb.0
Konstantin Zhuravlyove9a5a772017-07-21 21:19:23 +000068; GCN-NOT: ATOMIC_FENCE
69; GCN: s_endpgm
70define amdgpu_kernel void @singlethread_release() {
71entry:
72 fence syncscope("singlethread") release
73 ret void
74}
75
Stanislav Mekhanoshin127dbdb2018-02-13 20:03:32 +000076; FUNC-LABEL: {{^}}singlethread_acq_rel:
Francis Visoiu Mistrih25528d62017-12-04 17:18:51 +000077; GCN: %bb.0
Konstantin Zhuravlyove9a5a772017-07-21 21:19:23 +000078; GCN-NOT: ATOMIC_FENCE
79; GCN: s_endpgm
80define amdgpu_kernel void @singlethread_acq_rel() {
81entry:
82 fence syncscope("singlethread") acq_rel
83 ret void
84}
85
Stanislav Mekhanoshin127dbdb2018-02-13 20:03:32 +000086; FUNC-LABEL: {{^}}singlethread_seq_cst:
Francis Visoiu Mistrih25528d62017-12-04 17:18:51 +000087; GCN: %bb.0
Konstantin Zhuravlyove9a5a772017-07-21 21:19:23 +000088; GCN-NOT: ATOMIC_FENCE
89; GCN: s_endpgm
90define amdgpu_kernel void @singlethread_seq_cst() {
91entry:
92 fence syncscope("singlethread") seq_cst
93 ret void
94}
95
Stanislav Mekhanoshin127dbdb2018-02-13 20:03:32 +000096; FUNC-LABEL: {{^}}agent_acquire:
Francis Visoiu Mistrih25528d62017-12-04 17:18:51 +000097; GCN: %bb.0
Konstantin Zhuravlyove9a5a772017-07-21 21:19:23 +000098; GCN-NOT: ATOMIC_FENCE
99; GFX6: s_waitcnt vmcnt(0){{$}}
100; GFX6-NEXT: buffer_wbinvl1{{$}}
101; GFX8: s_waitcnt vmcnt(0){{$}}
102; GFX8-NEXT: buffer_wbinvl1_vol{{$}}
103; GCN: s_endpgm
104define amdgpu_kernel void @agent_acquire() {
105entry:
106 fence syncscope("agent") acquire
107 ret void
108}
109
Stanislav Mekhanoshin127dbdb2018-02-13 20:03:32 +0000110; FUNC-LABEL: {{^}}agent_release:
Francis Visoiu Mistrih25528d62017-12-04 17:18:51 +0000111; GCN: %bb.0
Konstantin Zhuravlyove9a5a772017-07-21 21:19:23 +0000112; GCN-NOT: ATOMIC_FENCE
113; GCN: s_waitcnt vmcnt(0){{$}}
114; GCN: s_endpgm
115define amdgpu_kernel void @agent_release() {
116entry:
117 fence syncscope("agent") release
118 ret void
119}
120
Stanislav Mekhanoshin127dbdb2018-02-13 20:03:32 +0000121; FUNC-LABEL: {{^}}agent_acq_rel:
Francis Visoiu Mistrih25528d62017-12-04 17:18:51 +0000122; GCN: %bb.0
Konstantin Zhuravlyove9a5a772017-07-21 21:19:23 +0000123; GCN-NOT: ATOMIC_FENCE
124; GCN: s_waitcnt vmcnt(0){{$}}
125; GFX6: buffer_wbinvl1{{$}}
126; GFX8: buffer_wbinvl1_vol{{$}}
127; GCN: s_endpgm
128define amdgpu_kernel void @agent_acq_rel() {
129entry:
130 fence syncscope("agent") acq_rel
131 ret void
132}
133
Stanislav Mekhanoshin127dbdb2018-02-13 20:03:32 +0000134; FUNC-LABEL: {{^}}agent_seq_cst:
Francis Visoiu Mistrih25528d62017-12-04 17:18:51 +0000135; GCN: %bb.0
Konstantin Zhuravlyove9a5a772017-07-21 21:19:23 +0000136; GCN-NOT: ATOMIC_FENCE
137; GCN: s_waitcnt vmcnt(0){{$}}
138; GFX6: buffer_wbinvl1{{$}}
139; GFX8: buffer_wbinvl1_vol{{$}}
140; GCN: s_endpgm
141define amdgpu_kernel void @agent_seq_cst() {
142entry:
143 fence syncscope("agent") seq_cst
144 ret void
145}
146
Stanislav Mekhanoshin127dbdb2018-02-13 20:03:32 +0000147; FUNC-LABEL: {{^}}workgroup_acquire:
Francis Visoiu Mistrih25528d62017-12-04 17:18:51 +0000148; GCN: %bb.0
Stanislav Mekhanoshin127dbdb2018-02-13 20:03:32 +0000149; GFX68-NOT: s_waitcnt vmcnt(0){{$}}
Konstantin Zhuravlyove9a5a772017-07-21 21:19:23 +0000150; GCN-NOT: ATOMIC_FENCE
151; GCN: s_endpgm
152define amdgpu_kernel void @workgroup_acquire() {
153entry:
154 fence syncscope("workgroup") acquire
155 ret void
156}
157
Stanislav Mekhanoshin127dbdb2018-02-13 20:03:32 +0000158; FUNC-LABEL: {{^}}workgroup_release:
Francis Visoiu Mistrih25528d62017-12-04 17:18:51 +0000159; GCN: %bb.0
Stanislav Mekhanoshin127dbdb2018-02-13 20:03:32 +0000160; GFX68-NOT: s_waitcnt vmcnt(0){{$}}
Konstantin Zhuravlyove9a5a772017-07-21 21:19:23 +0000161; GCN-NOT: ATOMIC_FENCE
162; GCN: s_endpgm
163define amdgpu_kernel void @workgroup_release() {
164entry:
165 fence syncscope("workgroup") release
166 ret void
167}
168
Stanislav Mekhanoshin127dbdb2018-02-13 20:03:32 +0000169; FUNC-LABEL: {{^}}workgroup_acq_rel:
Francis Visoiu Mistrih25528d62017-12-04 17:18:51 +0000170; GCN: %bb.0
Stanislav Mekhanoshin127dbdb2018-02-13 20:03:32 +0000171; GFX68-NOT: s_waitcnt vmcnt(0){{$}}
Konstantin Zhuravlyove9a5a772017-07-21 21:19:23 +0000172; GCN-NOT: ATOMIC_FENCE
173; GCN: s_endpgm
174define amdgpu_kernel void @workgroup_acq_rel() {
175entry:
176 fence syncscope("workgroup") acq_rel
177 ret void
178}
179
Stanislav Mekhanoshin127dbdb2018-02-13 20:03:32 +0000180; FUNC-LABEL: {{^}}workgroup_seq_cst:
Francis Visoiu Mistrih25528d62017-12-04 17:18:51 +0000181; GCN: %bb.0
Stanislav Mekhanoshin127dbdb2018-02-13 20:03:32 +0000182; GFX68-NOT: s_waitcnt vmcnt(0){{$}}
Konstantin Zhuravlyove9a5a772017-07-21 21:19:23 +0000183; GCN-NOT: ATOMIC_FENCE
184; GCN: s_endpgm
185define amdgpu_kernel void @workgroup_seq_cst() {
186entry:
187 fence syncscope("workgroup") seq_cst
188 ret void
189}
190
Stanislav Mekhanoshin127dbdb2018-02-13 20:03:32 +0000191; FUNC-LABEL: {{^}}wavefront_acquire:
Francis Visoiu Mistrih25528d62017-12-04 17:18:51 +0000192; GCN: %bb.0
Konstantin Zhuravlyove9a5a772017-07-21 21:19:23 +0000193; GCN-NOT: ATOMIC_FENCE
194; GCN: s_endpgm
195define amdgpu_kernel void @wavefront_acquire() {
196entry:
197 fence syncscope("wavefront") acquire
198 ret void
199}
200
Stanislav Mekhanoshin127dbdb2018-02-13 20:03:32 +0000201; FUNC-LABEL: {{^}}wavefront_release:
Francis Visoiu Mistrih25528d62017-12-04 17:18:51 +0000202; GCN: %bb.0
Konstantin Zhuravlyove9a5a772017-07-21 21:19:23 +0000203; GCN-NOT: ATOMIC_FENCE
204; GCN: s_endpgm
205define amdgpu_kernel void @wavefront_release() {
206entry:
207 fence syncscope("wavefront") release
208 ret void
209}
210
Stanislav Mekhanoshin127dbdb2018-02-13 20:03:32 +0000211; FUNC-LABEL: {{^}}wavefront_acq_rel:
Francis Visoiu Mistrih25528d62017-12-04 17:18:51 +0000212; GCN: %bb.0
Konstantin Zhuravlyove9a5a772017-07-21 21:19:23 +0000213; GCN-NOT: ATOMIC_FENCE
214; GCN: s_endpgm
215define amdgpu_kernel void @wavefront_acq_rel() {
216entry:
217 fence syncscope("wavefront") acq_rel
218 ret void
219}
220
Stanislav Mekhanoshin127dbdb2018-02-13 20:03:32 +0000221; FUNC-LABEL: {{^}}wavefront_seq_cst:
Francis Visoiu Mistrih25528d62017-12-04 17:18:51 +0000222; GCN: %bb.0
Konstantin Zhuravlyove9a5a772017-07-21 21:19:23 +0000223; GCN-NOT: ATOMIC_FENCE
224; GCN: s_endpgm
225define amdgpu_kernel void @wavefront_seq_cst() {
226entry:
227 fence syncscope("wavefront") seq_cst
228 ret void
229}