Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 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 |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 4 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 5 | ; FUNC-LABEL: {{^}}system_acquire: |
Francis Visoiu Mistrih | 25528d6 | 2017-12-04 17:18:51 +0000 | [diff] [blame] | 6 | ; GCN: %bb.0 |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 7 | ; 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 |
| 13 | define amdgpu_kernel void @system_acquire() { |
| 14 | entry: |
| 15 | fence acquire |
| 16 | ret void |
| 17 | } |
| 18 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 19 | ; FUNC-LABEL: {{^}}system_release: |
Francis Visoiu Mistrih | 25528d6 | 2017-12-04 17:18:51 +0000 | [diff] [blame] | 20 | ; GCN: %bb.0 |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 21 | ; GCN-NOT: ATOMIC_FENCE |
| 22 | ; GCN: s_waitcnt vmcnt(0){{$}} |
| 23 | ; GCN: s_endpgm |
| 24 | define amdgpu_kernel void @system_release() { |
| 25 | entry: |
| 26 | fence release |
| 27 | ret void |
| 28 | } |
| 29 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 30 | ; FUNC-LABEL: {{^}}system_acq_rel: |
Francis Visoiu Mistrih | 25528d6 | 2017-12-04 17:18:51 +0000 | [diff] [blame] | 31 | ; GCN: %bb.0 |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 32 | ; GCN-NOT: ATOMIC_FENCE |
| 33 | ; GCN: s_waitcnt vmcnt(0){{$}} |
| 34 | ; GFX6: buffer_wbinvl1{{$}} |
| 35 | ; GFX8: buffer_wbinvl1_vol{{$}} |
| 36 | ; GCN: s_endpgm |
| 37 | define amdgpu_kernel void @system_acq_rel() { |
| 38 | entry: |
| 39 | fence acq_rel |
| 40 | ret void |
| 41 | } |
| 42 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 43 | ; FUNC-LABEL: {{^}}system_seq_cst: |
Francis Visoiu Mistrih | 25528d6 | 2017-12-04 17:18:51 +0000 | [diff] [blame] | 44 | ; GCN: %bb.0 |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 45 | ; GCN-NOT: ATOMIC_FENCE |
| 46 | ; GCN: s_waitcnt vmcnt(0){{$}} |
| 47 | ; GFX6: buffer_wbinvl1{{$}} |
| 48 | ; GFX8: buffer_wbinvl1_vol{{$}} |
| 49 | ; GCN: s_endpgm |
| 50 | define amdgpu_kernel void @system_seq_cst() { |
| 51 | entry: |
| 52 | fence seq_cst |
| 53 | ret void |
| 54 | } |
| 55 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 56 | ; FUNC-LABEL: {{^}}singlethread_acquire: |
Francis Visoiu Mistrih | 25528d6 | 2017-12-04 17:18:51 +0000 | [diff] [blame] | 57 | ; GCN: %bb.0 |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 58 | ; GCN-NOT: ATOMIC_FENCE |
| 59 | ; GCN: s_endpgm |
| 60 | define amdgpu_kernel void @singlethread_acquire() { |
| 61 | entry: |
| 62 | fence syncscope("singlethread") acquire |
| 63 | ret void |
| 64 | } |
| 65 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 66 | ; FUNC-LABEL: {{^}}singlethread_release: |
Francis Visoiu Mistrih | 25528d6 | 2017-12-04 17:18:51 +0000 | [diff] [blame] | 67 | ; GCN: %bb.0 |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 68 | ; GCN-NOT: ATOMIC_FENCE |
| 69 | ; GCN: s_endpgm |
| 70 | define amdgpu_kernel void @singlethread_release() { |
| 71 | entry: |
| 72 | fence syncscope("singlethread") release |
| 73 | ret void |
| 74 | } |
| 75 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 76 | ; FUNC-LABEL: {{^}}singlethread_acq_rel: |
Francis Visoiu Mistrih | 25528d6 | 2017-12-04 17:18:51 +0000 | [diff] [blame] | 77 | ; GCN: %bb.0 |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 78 | ; GCN-NOT: ATOMIC_FENCE |
| 79 | ; GCN: s_endpgm |
| 80 | define amdgpu_kernel void @singlethread_acq_rel() { |
| 81 | entry: |
| 82 | fence syncscope("singlethread") acq_rel |
| 83 | ret void |
| 84 | } |
| 85 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 86 | ; FUNC-LABEL: {{^}}singlethread_seq_cst: |
Francis Visoiu Mistrih | 25528d6 | 2017-12-04 17:18:51 +0000 | [diff] [blame] | 87 | ; GCN: %bb.0 |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 88 | ; GCN-NOT: ATOMIC_FENCE |
| 89 | ; GCN: s_endpgm |
| 90 | define amdgpu_kernel void @singlethread_seq_cst() { |
| 91 | entry: |
| 92 | fence syncscope("singlethread") seq_cst |
| 93 | ret void |
| 94 | } |
| 95 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 96 | ; FUNC-LABEL: {{^}}agent_acquire: |
Francis Visoiu Mistrih | 25528d6 | 2017-12-04 17:18:51 +0000 | [diff] [blame] | 97 | ; GCN: %bb.0 |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 98 | ; 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 |
| 104 | define amdgpu_kernel void @agent_acquire() { |
| 105 | entry: |
| 106 | fence syncscope("agent") acquire |
| 107 | ret void |
| 108 | } |
| 109 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 110 | ; FUNC-LABEL: {{^}}agent_release: |
Francis Visoiu Mistrih | 25528d6 | 2017-12-04 17:18:51 +0000 | [diff] [blame] | 111 | ; GCN: %bb.0 |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 112 | ; GCN-NOT: ATOMIC_FENCE |
| 113 | ; GCN: s_waitcnt vmcnt(0){{$}} |
| 114 | ; GCN: s_endpgm |
| 115 | define amdgpu_kernel void @agent_release() { |
| 116 | entry: |
| 117 | fence syncscope("agent") release |
| 118 | ret void |
| 119 | } |
| 120 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 121 | ; FUNC-LABEL: {{^}}agent_acq_rel: |
Francis Visoiu Mistrih | 25528d6 | 2017-12-04 17:18:51 +0000 | [diff] [blame] | 122 | ; GCN: %bb.0 |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 123 | ; GCN-NOT: ATOMIC_FENCE |
| 124 | ; GCN: s_waitcnt vmcnt(0){{$}} |
| 125 | ; GFX6: buffer_wbinvl1{{$}} |
| 126 | ; GFX8: buffer_wbinvl1_vol{{$}} |
| 127 | ; GCN: s_endpgm |
| 128 | define amdgpu_kernel void @agent_acq_rel() { |
| 129 | entry: |
| 130 | fence syncscope("agent") acq_rel |
| 131 | ret void |
| 132 | } |
| 133 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 134 | ; FUNC-LABEL: {{^}}agent_seq_cst: |
Francis Visoiu Mistrih | 25528d6 | 2017-12-04 17:18:51 +0000 | [diff] [blame] | 135 | ; GCN: %bb.0 |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 136 | ; GCN-NOT: ATOMIC_FENCE |
| 137 | ; GCN: s_waitcnt vmcnt(0){{$}} |
| 138 | ; GFX6: buffer_wbinvl1{{$}} |
| 139 | ; GFX8: buffer_wbinvl1_vol{{$}} |
| 140 | ; GCN: s_endpgm |
| 141 | define amdgpu_kernel void @agent_seq_cst() { |
| 142 | entry: |
| 143 | fence syncscope("agent") seq_cst |
| 144 | ret void |
| 145 | } |
| 146 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 147 | ; FUNC-LABEL: {{^}}workgroup_acquire: |
Francis Visoiu Mistrih | 25528d6 | 2017-12-04 17:18:51 +0000 | [diff] [blame] | 148 | ; GCN: %bb.0 |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 149 | ; GFX68-NOT: s_waitcnt vmcnt(0){{$}} |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 150 | ; GCN-NOT: ATOMIC_FENCE |
| 151 | ; GCN: s_endpgm |
| 152 | define amdgpu_kernel void @workgroup_acquire() { |
| 153 | entry: |
| 154 | fence syncscope("workgroup") acquire |
| 155 | ret void |
| 156 | } |
| 157 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 158 | ; FUNC-LABEL: {{^}}workgroup_release: |
Francis Visoiu Mistrih | 25528d6 | 2017-12-04 17:18:51 +0000 | [diff] [blame] | 159 | ; GCN: %bb.0 |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 160 | ; GFX68-NOT: s_waitcnt vmcnt(0){{$}} |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 161 | ; GCN-NOT: ATOMIC_FENCE |
| 162 | ; GCN: s_endpgm |
| 163 | define amdgpu_kernel void @workgroup_release() { |
| 164 | entry: |
| 165 | fence syncscope("workgroup") release |
| 166 | ret void |
| 167 | } |
| 168 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 169 | ; FUNC-LABEL: {{^}}workgroup_acq_rel: |
Francis Visoiu Mistrih | 25528d6 | 2017-12-04 17:18:51 +0000 | [diff] [blame] | 170 | ; GCN: %bb.0 |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 171 | ; GFX68-NOT: s_waitcnt vmcnt(0){{$}} |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 172 | ; GCN-NOT: ATOMIC_FENCE |
| 173 | ; GCN: s_endpgm |
| 174 | define amdgpu_kernel void @workgroup_acq_rel() { |
| 175 | entry: |
| 176 | fence syncscope("workgroup") acq_rel |
| 177 | ret void |
| 178 | } |
| 179 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 180 | ; FUNC-LABEL: {{^}}workgroup_seq_cst: |
Francis Visoiu Mistrih | 25528d6 | 2017-12-04 17:18:51 +0000 | [diff] [blame] | 181 | ; GCN: %bb.0 |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 182 | ; GFX68-NOT: s_waitcnt vmcnt(0){{$}} |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 183 | ; GCN-NOT: ATOMIC_FENCE |
| 184 | ; GCN: s_endpgm |
| 185 | define amdgpu_kernel void @workgroup_seq_cst() { |
| 186 | entry: |
| 187 | fence syncscope("workgroup") seq_cst |
| 188 | ret void |
| 189 | } |
| 190 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 191 | ; FUNC-LABEL: {{^}}wavefront_acquire: |
Francis Visoiu Mistrih | 25528d6 | 2017-12-04 17:18:51 +0000 | [diff] [blame] | 192 | ; GCN: %bb.0 |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 193 | ; GCN-NOT: ATOMIC_FENCE |
| 194 | ; GCN: s_endpgm |
| 195 | define amdgpu_kernel void @wavefront_acquire() { |
| 196 | entry: |
| 197 | fence syncscope("wavefront") acquire |
| 198 | ret void |
| 199 | } |
| 200 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 201 | ; FUNC-LABEL: {{^}}wavefront_release: |
Francis Visoiu Mistrih | 25528d6 | 2017-12-04 17:18:51 +0000 | [diff] [blame] | 202 | ; GCN: %bb.0 |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 203 | ; GCN-NOT: ATOMIC_FENCE |
| 204 | ; GCN: s_endpgm |
| 205 | define amdgpu_kernel void @wavefront_release() { |
| 206 | entry: |
| 207 | fence syncscope("wavefront") release |
| 208 | ret void |
| 209 | } |
| 210 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 211 | ; FUNC-LABEL: {{^}}wavefront_acq_rel: |
Francis Visoiu Mistrih | 25528d6 | 2017-12-04 17:18:51 +0000 | [diff] [blame] | 212 | ; GCN: %bb.0 |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 213 | ; GCN-NOT: ATOMIC_FENCE |
| 214 | ; GCN: s_endpgm |
| 215 | define amdgpu_kernel void @wavefront_acq_rel() { |
| 216 | entry: |
| 217 | fence syncscope("wavefront") acq_rel |
| 218 | ret void |
| 219 | } |
| 220 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 221 | ; FUNC-LABEL: {{^}}wavefront_seq_cst: |
Francis Visoiu Mistrih | 25528d6 | 2017-12-04 17:18:51 +0000 | [diff] [blame] | 222 | ; GCN: %bb.0 |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 223 | ; GCN-NOT: ATOMIC_FENCE |
| 224 | ; GCN: s_endpgm |
| 225 | define amdgpu_kernel void @wavefront_seq_cst() { |
| 226 | entry: |
| 227 | fence syncscope("wavefront") seq_cst |
| 228 | ret void |
| 229 | } |