1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn -mcpu=tahiti -run-pass=instruction-select -verify-machineinstrs -global-isel-abort=0 -o - %s | FileCheck -check-prefix=GFX6 %s
3 # RUN: llc -mtriple=amdgcn -mcpu=hawaii -run-pass=instruction-select -verify-machineinstrs -global-isel-abort=0 -o - %s | FileCheck -check-prefix=GFX7 %s
4 # RUN: llc -mtriple=amdgcn -mcpu=gfx900 -run-pass=instruction-select -verify-machineinstrs -global-isel-abort=0 -o - %s | FileCheck -check-prefix=GFX9 %s
5 # RUN: llc -mtriple=amdgcn -mcpu=gfx1010 -run-pass=instruction-select -verify-machineinstrs -global-isel-abort=0 -o - %s | FileCheck -check-prefix=GFX9 %s
6 # RUN: llc -mtriple=amdgcn -mcpu=gfx1100 -run-pass=instruction-select -verify-machineinstrs -global-isel-abort=0 -o - %s | FileCheck -check-prefix=GFX9 %s
7 # RUN: llc -mtriple=amdgcn -mcpu=gfx1200 -run-pass=instruction-select -verify-machineinstrs -global-isel-abort=0 -o - %s | FileCheck -check-prefix=GFX9 %s
11 name: atomic_store_local_s32_seq_cst
14 tracksRegLiveness: true
18 liveins: $vgpr0, $vgpr1
20 ; GFX6-LABEL: name: atomic_store_local_s32_seq_cst
21 ; GFX6: liveins: $vgpr0, $vgpr1
23 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
24 ; GFX6-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
25 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
26 ; GFX6-NEXT: DS_WRITE_B32 [[COPY1]], [[COPY]], 0, 0, implicit $m0, implicit $exec :: (store seq_cst (s32), addrspace 3)
27 ; GFX7-LABEL: name: atomic_store_local_s32_seq_cst
28 ; GFX7: liveins: $vgpr0, $vgpr1
30 ; GFX7-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
31 ; GFX7-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
32 ; GFX7-NEXT: $m0 = S_MOV_B32 -1
33 ; GFX7-NEXT: DS_WRITE_B32 [[COPY1]], [[COPY]], 0, 0, implicit $m0, implicit $exec :: (store seq_cst (s32), addrspace 3)
34 ; GFX9-LABEL: name: atomic_store_local_s32_seq_cst
35 ; GFX9: liveins: $vgpr0, $vgpr1
37 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
38 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
39 ; GFX9-NEXT: DS_WRITE_B32_gfx9 [[COPY1]], [[COPY]], 0, 0, implicit $exec :: (store seq_cst (s32), addrspace 3)
40 %0:vgpr(s32) = COPY $vgpr0
41 %1:vgpr(p3) = COPY $vgpr1
42 G_STORE %0, %1 :: (store seq_cst (s32), align 4, addrspace 3)
48 name: atomic_store_local_v2s16_seq_cst
51 tracksRegLiveness: true
55 liveins: $vgpr0, $vgpr1
57 ; GFX6-LABEL: name: atomic_store_local_v2s16_seq_cst
58 ; GFX6: liveins: $vgpr0, $vgpr1
60 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
61 ; GFX6-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr1
62 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
63 ; GFX6-NEXT: G_STORE [[COPY]](<2 x s16>), [[COPY1]](p3) :: (store seq_cst (<2 x s16>), addrspace 3)
64 ; GFX7-LABEL: name: atomic_store_local_v2s16_seq_cst
65 ; GFX7: liveins: $vgpr0, $vgpr1
67 ; GFX7-NEXT: [[COPY:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
68 ; GFX7-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr1
69 ; GFX7-NEXT: $m0 = S_MOV_B32 -1
70 ; GFX7-NEXT: G_STORE [[COPY]](<2 x s16>), [[COPY1]](p3) :: (store seq_cst (<2 x s16>), addrspace 3)
71 ; GFX9-LABEL: name: atomic_store_local_v2s16_seq_cst
72 ; GFX9: liveins: $vgpr0, $vgpr1
74 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
75 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr1
76 ; GFX9-NEXT: G_STORE [[COPY]](<2 x s16>), [[COPY1]](p3) :: (store seq_cst (<2 x s16>), addrspace 3)
77 %0:vgpr(<2 x s16>) = COPY $vgpr0
78 %1:vgpr(p3) = COPY $vgpr1
79 G_STORE %0, %1 :: (store seq_cst (<2 x s16>), align 4, addrspace 3)
85 name: atomic_store_local_p3_seq_cst
88 tracksRegLiveness: true
92 liveins: $vgpr0, $vgpr1
94 ; GFX6-LABEL: name: atomic_store_local_p3_seq_cst
95 ; GFX6: liveins: $vgpr0, $vgpr1
97 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vgpr(p3) = COPY $vgpr0
98 ; GFX6-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr1
99 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
100 ; GFX6-NEXT: G_STORE [[COPY]](p3), [[COPY1]](p3) :: (store seq_cst (p3), addrspace 3)
101 ; GFX7-LABEL: name: atomic_store_local_p3_seq_cst
102 ; GFX7: liveins: $vgpr0, $vgpr1
104 ; GFX7-NEXT: [[COPY:%[0-9]+]]:vgpr(p3) = COPY $vgpr0
105 ; GFX7-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr1
106 ; GFX7-NEXT: $m0 = S_MOV_B32 -1
107 ; GFX7-NEXT: G_STORE [[COPY]](p3), [[COPY1]](p3) :: (store seq_cst (p3), addrspace 3)
108 ; GFX9-LABEL: name: atomic_store_local_p3_seq_cst
109 ; GFX9: liveins: $vgpr0, $vgpr1
111 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr(p3) = COPY $vgpr0
112 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr1
113 ; GFX9-NEXT: G_STORE [[COPY]](p3), [[COPY1]](p3) :: (store seq_cst (p3), addrspace 3)
114 %0:vgpr(p3) = COPY $vgpr0
115 %1:vgpr(p3) = COPY $vgpr1
116 G_STORE %0, %1 :: (store seq_cst (p3), align 4, addrspace 3)
122 name: atomic_store_local_p5_seq_cst
124 regBankSelected: true
125 tracksRegLiveness: true
129 liveins: $vgpr0, $vgpr1
131 ; GFX6-LABEL: name: atomic_store_local_p5_seq_cst
132 ; GFX6: liveins: $vgpr0, $vgpr1
134 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vgpr(p5) = COPY $vgpr0
135 ; GFX6-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr1
136 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
137 ; GFX6-NEXT: G_STORE [[COPY]](p5), [[COPY1]](p3) :: (store seq_cst (p5), addrspace 3)
138 ; GFX7-LABEL: name: atomic_store_local_p5_seq_cst
139 ; GFX7: liveins: $vgpr0, $vgpr1
141 ; GFX7-NEXT: [[COPY:%[0-9]+]]:vgpr(p5) = COPY $vgpr0
142 ; GFX7-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr1
143 ; GFX7-NEXT: $m0 = S_MOV_B32 -1
144 ; GFX7-NEXT: G_STORE [[COPY]](p5), [[COPY1]](p3) :: (store seq_cst (p5), addrspace 3)
145 ; GFX9-LABEL: name: atomic_store_local_p5_seq_cst
146 ; GFX9: liveins: $vgpr0, $vgpr1
148 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr(p5) = COPY $vgpr0
149 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr1
150 ; GFX9-NEXT: G_STORE [[COPY]](p5), [[COPY1]](p3) :: (store seq_cst (p5), addrspace 3)
151 %0:vgpr(p5) = COPY $vgpr0
152 %1:vgpr(p3) = COPY $vgpr1
153 G_STORE %0, %1 :: (store seq_cst (p5), align 4, addrspace 3)
159 name: atomic_store_local_p6_seq_cst
161 regBankSelected: true
162 tracksRegLiveness: true
166 liveins: $vgpr0, $vgpr1
168 ; GFX6-LABEL: name: atomic_store_local_p6_seq_cst
169 ; GFX6: liveins: $vgpr0, $vgpr1
171 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vgpr(p6) = COPY $vgpr0
172 ; GFX6-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr1
173 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
174 ; GFX6-NEXT: G_STORE [[COPY]](p6), [[COPY1]](p3) :: (store seq_cst (p6), addrspace 3)
175 ; GFX7-LABEL: name: atomic_store_local_p6_seq_cst
176 ; GFX7: liveins: $vgpr0, $vgpr1
178 ; GFX7-NEXT: [[COPY:%[0-9]+]]:vgpr(p6) = COPY $vgpr0
179 ; GFX7-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr1
180 ; GFX7-NEXT: $m0 = S_MOV_B32 -1
181 ; GFX7-NEXT: G_STORE [[COPY]](p6), [[COPY1]](p3) :: (store seq_cst (p6), addrspace 3)
182 ; GFX9-LABEL: name: atomic_store_local_p6_seq_cst
183 ; GFX9: liveins: $vgpr0, $vgpr1
185 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr(p6) = COPY $vgpr0
186 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr1
187 ; GFX9-NEXT: G_STORE [[COPY]](p6), [[COPY1]](p3) :: (store seq_cst (p6), addrspace 3)
188 %0:vgpr(p6) = COPY $vgpr0
189 %1:vgpr(p3) = COPY $vgpr1
190 G_STORE %0, %1 :: (store seq_cst (p6), align 4, addrspace 3)
196 name: atomic_store_local_s64_seq_cst
198 regBankSelected: true
199 tracksRegLiveness: true
203 liveins: $vgpr0_vgpr1, $vgpr2
205 ; GFX6-LABEL: name: atomic_store_local_s64_seq_cst
206 ; GFX6: liveins: $vgpr0_vgpr1, $vgpr2
208 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
209 ; GFX6-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr2
210 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
211 ; GFX6-NEXT: DS_WRITE_B64 [[COPY1]], [[COPY]], 0, 0, implicit $m0, implicit $exec :: (store seq_cst (s64), addrspace 3)
212 ; GFX7-LABEL: name: atomic_store_local_s64_seq_cst
213 ; GFX7: liveins: $vgpr0_vgpr1, $vgpr2
215 ; GFX7-NEXT: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
216 ; GFX7-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr2
217 ; GFX7-NEXT: $m0 = S_MOV_B32 -1
218 ; GFX7-NEXT: DS_WRITE_B64 [[COPY1]], [[COPY]], 0, 0, implicit $m0, implicit $exec :: (store seq_cst (s64), addrspace 3)
219 ; GFX9-LABEL: name: atomic_store_local_s64_seq_cst
220 ; GFX9: liveins: $vgpr0_vgpr1, $vgpr2
222 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
223 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr2
224 ; GFX9-NEXT: DS_WRITE_B64_gfx9 [[COPY1]], [[COPY]], 0, 0, implicit $exec :: (store seq_cst (s64), addrspace 3)
225 %0:vgpr(s64) = COPY $vgpr0_vgpr1
226 %1:vgpr(p3) = COPY $vgpr2
227 G_STORE %0, %1 :: (store seq_cst (s64), align 8, addrspace 3)
233 name: atomic_store_local_v2s32_seq_cst
235 regBankSelected: true
236 tracksRegLiveness: true
240 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
242 ; GFX6-LABEL: name: atomic_store_local_v2s32_seq_cst
243 ; GFX6: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
245 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vgpr(<2 x s32>) = COPY $vgpr0_vgpr1
246 ; GFX6-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr2
247 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
248 ; GFX6-NEXT: G_STORE [[COPY]](<2 x s32>), [[COPY1]](p3) :: (store seq_cst (<2 x s32>), addrspace 3)
249 ; GFX7-LABEL: name: atomic_store_local_v2s32_seq_cst
250 ; GFX7: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
252 ; GFX7-NEXT: [[COPY:%[0-9]+]]:vgpr(<2 x s32>) = COPY $vgpr0_vgpr1
253 ; GFX7-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr2
254 ; GFX7-NEXT: $m0 = S_MOV_B32 -1
255 ; GFX7-NEXT: G_STORE [[COPY]](<2 x s32>), [[COPY1]](p3) :: (store seq_cst (<2 x s32>), addrspace 3)
256 ; GFX9-LABEL: name: atomic_store_local_v2s32_seq_cst
257 ; GFX9: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
259 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr(<2 x s32>) = COPY $vgpr0_vgpr1
260 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr2
261 ; GFX9-NEXT: G_STORE [[COPY]](<2 x s32>), [[COPY1]](p3) :: (store seq_cst (<2 x s32>), addrspace 3)
262 %0:vgpr(<2 x s32>) = COPY $vgpr0_vgpr1
263 %1:vgpr(p3) = COPY $vgpr2
264 G_STORE %0, %1 :: (store seq_cst (<2 x s32>), align 8, addrspace 3)
270 name: atomic_store_local_v4s16_seq_cst
272 regBankSelected: true
273 tracksRegLiveness: true
277 liveins: $vgpr0_vgpr1, $vgpr2
279 ; GFX6-LABEL: name: atomic_store_local_v4s16_seq_cst
280 ; GFX6: liveins: $vgpr0_vgpr1, $vgpr2
282 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vgpr(<4 x s16>) = COPY $vgpr0_vgpr1
283 ; GFX6-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr2
284 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
285 ; GFX6-NEXT: G_STORE [[COPY]](<4 x s16>), [[COPY1]](p3) :: (store seq_cst (<4 x s16>), addrspace 3)
286 ; GFX7-LABEL: name: atomic_store_local_v4s16_seq_cst
287 ; GFX7: liveins: $vgpr0_vgpr1, $vgpr2
289 ; GFX7-NEXT: [[COPY:%[0-9]+]]:vgpr(<4 x s16>) = COPY $vgpr0_vgpr1
290 ; GFX7-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr2
291 ; GFX7-NEXT: $m0 = S_MOV_B32 -1
292 ; GFX7-NEXT: G_STORE [[COPY]](<4 x s16>), [[COPY1]](p3) :: (store seq_cst (<4 x s16>), addrspace 3)
293 ; GFX9-LABEL: name: atomic_store_local_v4s16_seq_cst
294 ; GFX9: liveins: $vgpr0_vgpr1, $vgpr2
296 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr(<4 x s16>) = COPY $vgpr0_vgpr1
297 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr2
298 ; GFX9-NEXT: G_STORE [[COPY]](<4 x s16>), [[COPY1]](p3) :: (store seq_cst (<4 x s16>), addrspace 3)
299 %0:vgpr(<4 x s16>) = COPY $vgpr0_vgpr1
300 %1:vgpr(p3) = COPY $vgpr2
301 G_STORE %0, %1 :: (store seq_cst (<4 x s16>), align 8, addrspace 3)
307 name: atomic_store_local_p0_seq_cst
309 regBankSelected: true
310 tracksRegLiveness: true
314 liveins: $vgpr0_vgpr1, $vgpr2
316 ; GFX6-LABEL: name: atomic_store_local_p0_seq_cst
317 ; GFX6: liveins: $vgpr0_vgpr1, $vgpr2
319 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vgpr(p0) = COPY $vgpr0_vgpr1
320 ; GFX6-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr2
321 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
322 ; GFX6-NEXT: G_STORE [[COPY]](p0), [[COPY1]](p3) :: (store seq_cst (p0), addrspace 3)
323 ; GFX7-LABEL: name: atomic_store_local_p0_seq_cst
324 ; GFX7: liveins: $vgpr0_vgpr1, $vgpr2
326 ; GFX7-NEXT: [[COPY:%[0-9]+]]:vgpr(p0) = COPY $vgpr0_vgpr1
327 ; GFX7-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr2
328 ; GFX7-NEXT: $m0 = S_MOV_B32 -1
329 ; GFX7-NEXT: G_STORE [[COPY]](p0), [[COPY1]](p3) :: (store seq_cst (p0), addrspace 3)
330 ; GFX9-LABEL: name: atomic_store_local_p0_seq_cst
331 ; GFX9: liveins: $vgpr0_vgpr1, $vgpr2
333 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr(p0) = COPY $vgpr0_vgpr1
334 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr2
335 ; GFX9-NEXT: G_STORE [[COPY]](p0), [[COPY1]](p3) :: (store seq_cst (p0), addrspace 3)
336 %0:vgpr(p0) = COPY $vgpr0_vgpr1
337 %1:vgpr(p3) = COPY $vgpr2
338 G_STORE %0, %1 :: (store seq_cst (p0), align 8, addrspace 3)
343 name: atomic_store_local_p1_seq_cst
345 regBankSelected: true
346 tracksRegLiveness: true
350 liveins: $vgpr0_vgpr1, $vgpr2
352 ; GFX6-LABEL: name: atomic_store_local_p1_seq_cst
353 ; GFX6: liveins: $vgpr0_vgpr1, $vgpr2
355 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vgpr(p1) = COPY $vgpr0_vgpr1
356 ; GFX6-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr2
357 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
358 ; GFX6-NEXT: G_STORE [[COPY]](p1), [[COPY1]](p3) :: (store seq_cst (p1), addrspace 3)
359 ; GFX7-LABEL: name: atomic_store_local_p1_seq_cst
360 ; GFX7: liveins: $vgpr0_vgpr1, $vgpr2
362 ; GFX7-NEXT: [[COPY:%[0-9]+]]:vgpr(p1) = COPY $vgpr0_vgpr1
363 ; GFX7-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr2
364 ; GFX7-NEXT: $m0 = S_MOV_B32 -1
365 ; GFX7-NEXT: G_STORE [[COPY]](p1), [[COPY1]](p3) :: (store seq_cst (p1), addrspace 3)
366 ; GFX9-LABEL: name: atomic_store_local_p1_seq_cst
367 ; GFX9: liveins: $vgpr0_vgpr1, $vgpr2
369 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr(p1) = COPY $vgpr0_vgpr1
370 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:vgpr(p3) = COPY $vgpr2
371 ; GFX9-NEXT: G_STORE [[COPY]](p1), [[COPY1]](p3) :: (store seq_cst (p1), addrspace 3)
372 %0:vgpr(p1) = COPY $vgpr0_vgpr1
373 %1:vgpr(p3) = COPY $vgpr2
374 G_STORE %0, %1 :: (store seq_cst (p1), align 8, addrspace 3)