1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -mcpu=tahiti -run-pass=instruction-select -verify-machineinstrs -global-isel-abort=0 -o - %s | FileCheck -check-prefix=GFX6 %s
3 # RUN: llc -march=amdgcn -mcpu=hawaii -run-pass=instruction-select -verify-machineinstrs -global-isel-abort=0 -o - %s | FileCheck -check-prefix=GFX7 %s
4 # RUN: llc -march=amdgcn -mcpu=gfx900 -run-pass=instruction-select -verify-machineinstrs -global-isel-abort=0 -o - %s | FileCheck -check-prefix=GFX9 %s
5 # RUN: llc -march=amdgcn -mcpu=gfx1010 -run-pass=instruction-select -verify-machineinstrs -global-isel-abort=0 -o - %s | FileCheck -check-prefix=GFX9 %s
6 # RUN: llc -march=amdgcn -mcpu=gfx1100 -run-pass=instruction-select -verify-machineinstrs -global-isel-abort=0 -o - %s | FileCheck -check-prefix=GFX9 %s
10 name: atomic_store_local_s32_seq_cst
13 tracksRegLiveness: true
17 liveins: $vgpr0, $vgpr1
19 ; GFX6-LABEL: name: atomic_store_local_s32_seq_cst
20 ; GFX6: liveins: $vgpr0, $vgpr1
22 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
23 ; GFX6-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
24 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
25 ; GFX6-NEXT: DS_WRITE_B32 [[COPY1]], [[COPY]], 0, 0, implicit $m0, implicit $exec :: (store seq_cst (s32), addrspace 3)
26 ; GFX7-LABEL: name: atomic_store_local_s32_seq_cst
27 ; GFX7: liveins: $vgpr0, $vgpr1
29 ; GFX7-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
30 ; GFX7-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
31 ; GFX7-NEXT: $m0 = S_MOV_B32 -1
32 ; GFX7-NEXT: DS_WRITE_B32 [[COPY1]], [[COPY]], 0, 0, implicit $m0, implicit $exec :: (store seq_cst (s32), addrspace 3)
33 ; GFX9-LABEL: name: atomic_store_local_s32_seq_cst
34 ; GFX9: liveins: $vgpr0, $vgpr1
36 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
37 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
38 ; GFX9-NEXT: DS_WRITE_B32_gfx9 [[COPY1]], [[COPY]], 0, 0, implicit $exec :: (store seq_cst (s32), addrspace 3)
39 %0:vgpr(s32) = COPY $vgpr0
40 %1:vgpr(p3) = COPY $vgpr1
41 G_STORE %0, %1 :: (store seq_cst (s32), align 4, addrspace 3)
47 name: atomic_store_local_v2s16_seq_cst
50 tracksRegLiveness: true
54 liveins: $vgpr0, $vgpr1
56 ; GFX6-LABEL: name: atomic_store_local_v2s16_seq_cst
57 ; GFX6: liveins: $vgpr0, $vgpr1
59 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
60 ; GFX6-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr1
61 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
62 ; GFX6-NEXT: G_STORE [[COPY]](<2 x s16>), [[COPY1]](p3) :: (store seq_cst (<2 x s16>), addrspace 3)
63 ; GFX7-LABEL: name: atomic_store_local_v2s16_seq_cst
64 ; GFX7: liveins: $vgpr0, $vgpr1
66 ; GFX7-NEXT: [[COPY:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
67 ; GFX7-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr1
68 ; GFX7-NEXT: $m0 = S_MOV_B32 -1
69 ; GFX7-NEXT: G_STORE [[COPY]](<2 x s16>), [[COPY1]](p3) :: (store seq_cst (<2 x s16>), addrspace 3)
70 ; GFX9-LABEL: name: atomic_store_local_v2s16_seq_cst
71 ; GFX9: liveins: $vgpr0, $vgpr1
73 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
74 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr1
75 ; GFX9-NEXT: G_STORE [[COPY]](<2 x s16>), [[COPY1]](p3) :: (store seq_cst (<2 x s16>), addrspace 3)
76 %0:vgpr(<2 x s16>) = COPY $vgpr0
77 %1:vgpr(p3) = COPY $vgpr1
78 G_STORE %0, %1 :: (store seq_cst (<2 x s16>), align 4, addrspace 3)
84 name: atomic_store_local_p3_seq_cst
87 tracksRegLiveness: true
91 liveins: $vgpr0, $vgpr1
93 ; GFX6-LABEL: name: atomic_store_local_p3_seq_cst
94 ; GFX6: liveins: $vgpr0, $vgpr1
96 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vgpr(p3) = COPY $vgpr0
97 ; GFX6-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr1
98 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
99 ; GFX6-NEXT: G_STORE [[COPY]](p3), [[COPY1]](p3) :: (store seq_cst (p3), addrspace 3)
100 ; GFX7-LABEL: name: atomic_store_local_p3_seq_cst
101 ; GFX7: liveins: $vgpr0, $vgpr1
103 ; GFX7-NEXT: [[COPY:%[0-9]+]]:vgpr(p3) = COPY $vgpr0
104 ; GFX7-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr1
105 ; GFX7-NEXT: $m0 = S_MOV_B32 -1
106 ; GFX7-NEXT: G_STORE [[COPY]](p3), [[COPY1]](p3) :: (store seq_cst (p3), addrspace 3)
107 ; GFX9-LABEL: name: atomic_store_local_p3_seq_cst
108 ; GFX9: liveins: $vgpr0, $vgpr1
110 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr(p3) = COPY $vgpr0
111 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr1
112 ; GFX9-NEXT: G_STORE [[COPY]](p3), [[COPY1]](p3) :: (store seq_cst (p3), addrspace 3)
113 %0:vgpr(p3) = COPY $vgpr0
114 %1:vgpr(p3) = COPY $vgpr1
115 G_STORE %0, %1 :: (store seq_cst (p3), align 4, addrspace 3)
121 name: atomic_store_local_p5_seq_cst
123 regBankSelected: true
124 tracksRegLiveness: true
128 liveins: $vgpr0, $vgpr1
130 ; GFX6-LABEL: name: atomic_store_local_p5_seq_cst
131 ; GFX6: liveins: $vgpr0, $vgpr1
133 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vgpr(p5) = COPY $vgpr0
134 ; GFX6-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr1
135 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
136 ; GFX6-NEXT: G_STORE [[COPY]](p5), [[COPY1]](p3) :: (store seq_cst (p5), addrspace 3)
137 ; GFX7-LABEL: name: atomic_store_local_p5_seq_cst
138 ; GFX7: liveins: $vgpr0, $vgpr1
140 ; GFX7-NEXT: [[COPY:%[0-9]+]]:vgpr(p5) = COPY $vgpr0
141 ; GFX7-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr1
142 ; GFX7-NEXT: $m0 = S_MOV_B32 -1
143 ; GFX7-NEXT: G_STORE [[COPY]](p5), [[COPY1]](p3) :: (store seq_cst (p5), addrspace 3)
144 ; GFX9-LABEL: name: atomic_store_local_p5_seq_cst
145 ; GFX9: liveins: $vgpr0, $vgpr1
147 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr(p5) = COPY $vgpr0
148 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr1
149 ; GFX9-NEXT: G_STORE [[COPY]](p5), [[COPY1]](p3) :: (store seq_cst (p5), addrspace 3)
150 %0:vgpr(p5) = COPY $vgpr0
151 %1:vgpr(p3) = COPY $vgpr1
152 G_STORE %0, %1 :: (store seq_cst (p5), align 4, addrspace 3)
158 name: atomic_store_local_p6_seq_cst
160 regBankSelected: true
161 tracksRegLiveness: true
165 liveins: $vgpr0, $vgpr1
167 ; GFX6-LABEL: name: atomic_store_local_p6_seq_cst
168 ; GFX6: liveins: $vgpr0, $vgpr1
170 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vgpr(p6) = COPY $vgpr0
171 ; GFX6-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr1
172 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
173 ; GFX6-NEXT: G_STORE [[COPY]](p6), [[COPY1]](p3) :: (store seq_cst (p6), addrspace 3)
174 ; GFX7-LABEL: name: atomic_store_local_p6_seq_cst
175 ; GFX7: liveins: $vgpr0, $vgpr1
177 ; GFX7-NEXT: [[COPY:%[0-9]+]]:vgpr(p6) = COPY $vgpr0
178 ; GFX7-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr1
179 ; GFX7-NEXT: $m0 = S_MOV_B32 -1
180 ; GFX7-NEXT: G_STORE [[COPY]](p6), [[COPY1]](p3) :: (store seq_cst (p6), addrspace 3)
181 ; GFX9-LABEL: name: atomic_store_local_p6_seq_cst
182 ; GFX9: liveins: $vgpr0, $vgpr1
184 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr(p6) = COPY $vgpr0
185 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr1
186 ; GFX9-NEXT: G_STORE [[COPY]](p6), [[COPY1]](p3) :: (store seq_cst (p6), addrspace 3)
187 %0:vgpr(p6) = COPY $vgpr0
188 %1:vgpr(p3) = COPY $vgpr1
189 G_STORE %0, %1 :: (store seq_cst (p6), align 4, addrspace 3)
195 name: atomic_store_local_s64_seq_cst
197 regBankSelected: true
198 tracksRegLiveness: true
202 liveins: $vgpr0_vgpr1, $vgpr2
204 ; GFX6-LABEL: name: atomic_store_local_s64_seq_cst
205 ; GFX6: liveins: $vgpr0_vgpr1, $vgpr2
207 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
208 ; GFX6-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr2
209 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
210 ; GFX6-NEXT: DS_WRITE_B64 [[COPY1]], [[COPY]], 0, 0, implicit $m0, implicit $exec :: (store seq_cst (s64), addrspace 3)
211 ; GFX7-LABEL: name: atomic_store_local_s64_seq_cst
212 ; GFX7: liveins: $vgpr0_vgpr1, $vgpr2
214 ; GFX7-NEXT: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
215 ; GFX7-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr2
216 ; GFX7-NEXT: $m0 = S_MOV_B32 -1
217 ; GFX7-NEXT: DS_WRITE_B64 [[COPY1]], [[COPY]], 0, 0, implicit $m0, implicit $exec :: (store seq_cst (s64), addrspace 3)
218 ; GFX9-LABEL: name: atomic_store_local_s64_seq_cst
219 ; GFX9: liveins: $vgpr0_vgpr1, $vgpr2
221 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
222 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr2
223 ; GFX9-NEXT: DS_WRITE_B64_gfx9 [[COPY1]], [[COPY]], 0, 0, implicit $exec :: (store seq_cst (s64), addrspace 3)
224 %0:vgpr(s64) = COPY $vgpr0_vgpr1
225 %1:vgpr(p3) = COPY $vgpr2
226 G_STORE %0, %1 :: (store seq_cst (s64), align 8, addrspace 3)
232 name: atomic_store_local_v2s32_seq_cst
234 regBankSelected: true
235 tracksRegLiveness: true
239 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
241 ; GFX6-LABEL: name: atomic_store_local_v2s32_seq_cst
242 ; GFX6: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
244 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vgpr(<2 x s32>) = COPY $vgpr0_vgpr1
245 ; GFX6-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr2
246 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
247 ; GFX6-NEXT: G_STORE [[COPY]](<2 x s32>), [[COPY1]](p3) :: (store seq_cst (<2 x s32>), addrspace 3)
248 ; GFX7-LABEL: name: atomic_store_local_v2s32_seq_cst
249 ; GFX7: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
251 ; GFX7-NEXT: [[COPY:%[0-9]+]]:vgpr(<2 x s32>) = COPY $vgpr0_vgpr1
252 ; GFX7-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr2
253 ; GFX7-NEXT: $m0 = S_MOV_B32 -1
254 ; GFX7-NEXT: G_STORE [[COPY]](<2 x s32>), [[COPY1]](p3) :: (store seq_cst (<2 x s32>), addrspace 3)
255 ; GFX9-LABEL: name: atomic_store_local_v2s32_seq_cst
256 ; GFX9: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
258 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr(<2 x s32>) = COPY $vgpr0_vgpr1
259 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr2
260 ; GFX9-NEXT: G_STORE [[COPY]](<2 x s32>), [[COPY1]](p3) :: (store seq_cst (<2 x s32>), addrspace 3)
261 %0:vgpr(<2 x s32>) = COPY $vgpr0_vgpr1
262 %1:vgpr(p3) = COPY $vgpr2
263 G_STORE %0, %1 :: (store seq_cst (<2 x s32>), align 8, addrspace 3)
269 name: atomic_store_local_v4s16_seq_cst
271 regBankSelected: true
272 tracksRegLiveness: true
276 liveins: $vgpr0_vgpr1, $vgpr2
278 ; GFX6-LABEL: name: atomic_store_local_v4s16_seq_cst
279 ; GFX6: liveins: $vgpr0_vgpr1, $vgpr2
281 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vgpr(<4 x s16>) = COPY $vgpr0_vgpr1
282 ; GFX6-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr2
283 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
284 ; GFX6-NEXT: G_STORE [[COPY]](<4 x s16>), [[COPY1]](p3) :: (store seq_cst (<4 x s16>), addrspace 3)
285 ; GFX7-LABEL: name: atomic_store_local_v4s16_seq_cst
286 ; GFX7: liveins: $vgpr0_vgpr1, $vgpr2
288 ; GFX7-NEXT: [[COPY:%[0-9]+]]:vgpr(<4 x s16>) = COPY $vgpr0_vgpr1
289 ; GFX7-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr2
290 ; GFX7-NEXT: $m0 = S_MOV_B32 -1
291 ; GFX7-NEXT: G_STORE [[COPY]](<4 x s16>), [[COPY1]](p3) :: (store seq_cst (<4 x s16>), addrspace 3)
292 ; GFX9-LABEL: name: atomic_store_local_v4s16_seq_cst
293 ; GFX9: liveins: $vgpr0_vgpr1, $vgpr2
295 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr(<4 x s16>) = COPY $vgpr0_vgpr1
296 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr2
297 ; GFX9-NEXT: G_STORE [[COPY]](<4 x s16>), [[COPY1]](p3) :: (store seq_cst (<4 x s16>), addrspace 3)
298 %0:vgpr(<4 x s16>) = COPY $vgpr0_vgpr1
299 %1:vgpr(p3) = COPY $vgpr2
300 G_STORE %0, %1 :: (store seq_cst (<4 x s16>), align 8, addrspace 3)
306 name: atomic_store_local_p0_seq_cst
308 regBankSelected: true
309 tracksRegLiveness: true
313 liveins: $vgpr0_vgpr1, $vgpr2
315 ; GFX6-LABEL: name: atomic_store_local_p0_seq_cst
316 ; GFX6: liveins: $vgpr0_vgpr1, $vgpr2
318 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vgpr(p0) = COPY $vgpr0_vgpr1
319 ; GFX6-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr2
320 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
321 ; GFX6-NEXT: G_STORE [[COPY]](p0), [[COPY1]](p3) :: (store seq_cst (p0), addrspace 3)
322 ; GFX7-LABEL: name: atomic_store_local_p0_seq_cst
323 ; GFX7: liveins: $vgpr0_vgpr1, $vgpr2
325 ; GFX7-NEXT: [[COPY:%[0-9]+]]:vgpr(p0) = COPY $vgpr0_vgpr1
326 ; GFX7-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr2
327 ; GFX7-NEXT: $m0 = S_MOV_B32 -1
328 ; GFX7-NEXT: G_STORE [[COPY]](p0), [[COPY1]](p3) :: (store seq_cst (p0), addrspace 3)
329 ; GFX9-LABEL: name: atomic_store_local_p0_seq_cst
330 ; GFX9: liveins: $vgpr0_vgpr1, $vgpr2
332 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr(p0) = COPY $vgpr0_vgpr1
333 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr2
334 ; GFX9-NEXT: G_STORE [[COPY]](p0), [[COPY1]](p3) :: (store seq_cst (p0), addrspace 3)
335 %0:vgpr(p0) = COPY $vgpr0_vgpr1
336 %1:vgpr(p3) = COPY $vgpr2
337 G_STORE %0, %1 :: (store seq_cst (p0), align 8, addrspace 3)
342 name: atomic_store_local_p1_seq_cst
344 regBankSelected: true
345 tracksRegLiveness: true
349 liveins: $vgpr0_vgpr1, $vgpr2
351 ; GFX6-LABEL: name: atomic_store_local_p1_seq_cst
352 ; GFX6: liveins: $vgpr0_vgpr1, $vgpr2
354 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vgpr(p1) = COPY $vgpr0_vgpr1
355 ; GFX6-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr2
356 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
357 ; GFX6-NEXT: G_STORE [[COPY]](p1), [[COPY1]](p3) :: (store seq_cst (p1), addrspace 3)
358 ; GFX7-LABEL: name: atomic_store_local_p1_seq_cst
359 ; GFX7: liveins: $vgpr0_vgpr1, $vgpr2
361 ; GFX7-NEXT: [[COPY:%[0-9]+]]:vgpr(p1) = COPY $vgpr0_vgpr1
362 ; GFX7-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr2
363 ; GFX7-NEXT: $m0 = S_MOV_B32 -1
364 ; GFX7-NEXT: G_STORE [[COPY]](p1), [[COPY1]](p3) :: (store seq_cst (p1), addrspace 3)
365 ; GFX9-LABEL: name: atomic_store_local_p1_seq_cst
366 ; GFX9: liveins: $vgpr0_vgpr1, $vgpr2
368 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr(p1) = COPY $vgpr0_vgpr1
369 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr2
370 ; GFX9-NEXT: G_STORE [[COPY]](p1), [[COPY1]](p3) :: (store seq_cst (p1), addrspace 3)
371 %0:vgpr(p1) = COPY $vgpr0_vgpr1
372 %1:vgpr(p3) = COPY $vgpr2
373 G_STORE %0, %1 :: (store seq_cst (p1), align 8, addrspace 3)