1 # RUN: llc -march=amdgcn -mcpu=gfx1010 -verify-machineinstrs -run-pass post-RA-hazard-rec -o - %s | FileCheck -check-prefix=GCN %s
3 # GCN-LABEL: name: vmem_write_sgpr
4 # GCN: BUFFER_LOAD_DWORD_OFFEN
5 # GCN-NEXT: S_WAITCNT_DEPCTR 65507
11 $sgpr0_sgpr1_sgpr2_sgpr3 = IMPLICIT_DEF
14 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 0, 0, 0, 0, implicit $exec
17 # GCN-LABEL: name: vmem_write_exec
18 # GCN: BUFFER_STORE_DWORD_OFFEN_exact
19 # GCN-NEXT: S_WAITCNT_DEPCTR 65507
25 $sgpr0_sgpr1_sgpr2_sgpr3 = IMPLICIT_DEF
29 BUFFER_STORE_DWORD_OFFEN_exact killed renamable $vgpr0, renamable $vgpr1, renamable $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 0, 0, 0, implicit $exec
30 $exec_lo = S_MOV_B32 -1
32 # GCN-LABEL: name: vmem_write_sgpr_chain
33 # GCN: BUFFER_LOAD_DWORD_OFFEN
38 # GCN-NEXT: S_WAITCNT_DEPCTR 65507
41 name: vmem_write_sgpr_chain
45 $sgpr0_sgpr1_sgpr2_sgpr3 = IMPLICIT_DEF
48 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 0, 0, 0, 0, implicit $exec
49 $sgpr5 = S_MOV_B32 $sgpr0
50 $sgpr6 = S_MOV_B32 $sgpr1
51 $sgpr7 = S_MOV_B32 $sgpr2
52 $sgpr8 = S_MOV_B32 $sgpr3
55 # GCN-LABEL: name: vmem_smem_write_sgpr
56 # GCN: BUFFER_LOAD_DWORD_OFFEN
57 # GCN-NEXT: S_WAITCNT_DEPCTR 65507
58 # GCN-NEXT: S_LOAD_DWORD_IMM
60 name: vmem_smem_write_sgpr
63 $sgpr0_sgpr1_sgpr2_sgpr3 = IMPLICIT_DEF
66 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 0, 0, 0, 0, implicit $exec
67 $sgpr0 = S_LOAD_DWORD_IMM $sgpr0_sgpr1, 0, 0
69 # GCN-LABEL: name: vmem_snop_write_sgpr
70 # GCN: BUFFER_LOAD_DWORD_OFFEN
72 # GCN-NEXT: S_WAITCNT_DEPCTR 65507
75 name: vmem_snop_write_sgpr
78 $sgpr0_sgpr1_sgpr2_sgpr3 = IMPLICIT_DEF
81 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 0, 0, 0, 0, implicit $exec
85 # GCN-LABEL: name: vmem_valu_write_sgpr
86 # GCN: BUFFER_LOAD_DWORD_OFFEN
90 name: vmem_valu_write_sgpr
93 $sgpr0_sgpr1_sgpr2_sgpr3 = IMPLICIT_DEF
96 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 0, 0, 0, 0, implicit $exec
97 $vgpr2 = V_ADD_F32_e32 $vgpr1, $vgpr1, implicit $mode, implicit $exec
100 # GCN-LABEL: name: vmem_swait0_write_sgpr
101 # GCN: BUFFER_LOAD_DWORD_OFFEN
102 # GCN-NEXT: S_WAITCNT
103 # GCN-NEXT: S_MOV_B32
105 name: vmem_swait0_write_sgpr
108 $sgpr0_sgpr1_sgpr2_sgpr3 = IMPLICIT_DEF
109 $sgpr4 = IMPLICIT_DEF
110 $vgpr0 = IMPLICIT_DEF
111 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 0, 0, 0, 0, implicit $exec
115 # GCN-LABEL: name: vmem_swait_any_write_sgpr
116 # GCN: BUFFER_LOAD_DWORD_OFFEN
117 # GCN-NEXT: S_WAITCNT
118 # GCN-NEXT: S_WAITCNT_DEPCTR 65507
119 # GCN-NEXT: S_MOV_B32
121 name: vmem_swait_any_write_sgpr
124 $sgpr0_sgpr1_sgpr2_sgpr3 = IMPLICIT_DEF
125 $sgpr4 = IMPLICIT_DEF
126 $vgpr0 = IMPLICIT_DEF
127 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 0, 0, 0, 0, implicit $exec
131 # GCN-LABEL: name: vmem_write_exec_impread
132 # GCN: BUFFER_LOAD_DWORD_OFFEN
133 # GCN: S_WAITCNT_DEPCTR 65507
134 # GCN-NEXT: S_MOV_B64
136 name: vmem_write_exec_impread
139 $sgpr0_sgpr1_sgpr2_sgpr3 = IMPLICIT_DEF
140 $sgpr4 = IMPLICIT_DEF
141 $vgpr0 = IMPLICIT_DEF
142 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 0, 0, 0, 0, implicit $exec
145 # GCN-LABEL: name: vmem_write_exec_expread
146 # GCN: BUFFER_LOAD_DWORD_OFFEN
147 # GCN-NEXT: S_WAITCNT_DEPCTR 65507
148 # GCN-NEXT: S_MOV_B64
150 name: vmem_write_exec_expread
153 $sgpr0_sgpr1_sgpr2_sgpr3 = IMPLICIT_DEF
154 $vgpr0 = IMPLICIT_DEF
155 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $exec_lo, 0, 0, 0, 0, implicit $exec
158 # GCN-LABEL: name: ds_write_m0
160 # GCN-NEXT: S_WAITCNT_DEPCTR 65507
161 # GCN-NEXT: S_MOV_B32
166 $sgpr0_sgpr1_sgpr2_sgpr3 = IMPLICIT_DEF
167 $sgpr4 = IMPLICIT_DEF
168 $vgpr0 = IMPLICIT_DEF
169 $vgpr1 = DS_READ_B32 $vgpr0, 0, 0, implicit $m0, implicit $exec
172 # GCN-LABEL: name: vmem_write_sgpr_fall_through
173 # GCN: BUFFER_LOAD_DWORD_OFFEN
174 # GCN: S_WAITCNT_DEPCTR 65507
175 # GCN-NEXT: S_MOV_B32
177 name: vmem_write_sgpr_fall_through
181 $sgpr0_sgpr1_sgpr2_sgpr3 = IMPLICIT_DEF
182 $sgpr4 = IMPLICIT_DEF
183 $vgpr0 = IMPLICIT_DEF
184 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 0, 0, 0, 0, implicit $exec
189 # GCN-LABEL: name: vmem_write_sgpr_branch
190 # GCN: BUFFER_LOAD_DWORD_OFFEN
192 # GCN: S_WAITCNT_DEPCTR 65507
193 # GCN-NEXT: S_MOV_B32
195 name: vmem_write_sgpr_branch
199 $sgpr0_sgpr1_sgpr2_sgpr3 = IMPLICIT_DEF
200 $sgpr4 = IMPLICIT_DEF
201 $vgpr0 = IMPLICIT_DEF
202 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 0, 0, 0, 0, implicit $exec
208 # GCN-LABEL: name: vmem_write_sgpr_branch_around
209 # GCN: BUFFER_LOAD_DWORD_OFFEN
212 # GCN-NEXT: S_WAITCNT_DEPCTR 65507
213 # GCN-NEXT: S_MOV_B32
215 name: vmem_write_sgpr_branch_around
219 $sgpr0_sgpr1_sgpr2_sgpr3 = IMPLICIT_DEF
220 $sgpr4 = IMPLICIT_DEF
221 $vgpr0 = IMPLICIT_DEF
222 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 0, 0, 0, 0, implicit $exec
232 # GCN-LABEL: name: vmem_write_sgpr_cbranch_around
233 # GCN: BUFFER_LOAD_DWORD_OFFEN
234 # GCN-NEXT: S_CBRANCH
240 # GCN-NEXT: S_WAITCNT_DEPCTR 65507
241 # GCN-NEXT: S_MOV_B32
243 name: vmem_write_sgpr_cbranch_around
246 successors: %bb.1, %bb.2
247 $sgpr0_sgpr1_sgpr2_sgpr3 = IMPLICIT_DEF
248 $sgpr4 = IMPLICIT_DEF
249 $vgpr0 = IMPLICIT_DEF
250 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 0, 0, 0, 0, implicit $exec
251 S_CBRANCH_SCC0 %bb.2, implicit $scc
257 $vgpr2, $vcc_lo = V_ADD_CO_U32_e64 $vgpr1, $vgpr1, 0, implicit $exec
263 # GCN-LABEL: name: vmem_write_sgpr_branch_backedge
264 # GCN: $vgpr0 = IMPLICIT_DEF
265 # GCN-NEXT: S_WAITCNT_DEPCTR 65507
266 # GCN-NEXT: S_MOV_B32
268 name: vmem_write_sgpr_branch_backedge
272 $sgpr0_sgpr1_sgpr2_sgpr3 = IMPLICIT_DEF
273 $sgpr4 = IMPLICIT_DEF
274 $vgpr0 = IMPLICIT_DEF
278 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 0, 0, 0, 0, implicit $exec
281 # GCN-LABEL: name: ds_write_exec
282 # GCN: DS_WRITE_B32_gfx9
283 # GCN-NEXT: S_WAITCNT_DEPCTR 65507
284 # GCN-NEXT: S_MOV_B32
289 $vgpr0 = IMPLICIT_DEF
290 $vgpr1 = IMPLICIT_DEF
291 DS_WRITE_B32_gfx9 $vgpr0, $vgpr1, 0, 0, implicit $exec
292 $exec_lo = S_MOV_B32 -1
294 # GCN-LABEL: name: vmem_scratch_exec
295 # GCN: SCRATCH_LOAD_DWORD
296 # GCN-NEXT: S_WAITCNT_DEPCTR 65507
297 # GCN-NEXT: S_MOV_B32
299 name: vmem_scratch_exec
302 $vgpr0 = IMPLICIT_DEF
303 $vgpr1 = SCRATCH_LOAD_DWORD undef $vgpr0, 0, 0, implicit $exec, implicit $flat_scr
304 $exec_lo = S_MOV_B32 -1
306 # GCN-LABEL: name: vmem_flat_exec
307 # GCN: FLAT_LOAD_DWORD
308 # GCN-NEXT: S_WAITCNT_DEPCTR 65507
309 # GCN-NEXT: S_MOV_B32
314 $vgpr0 = IMPLICIT_DEF
315 $vgpr1 = IMPLICIT_DEF
316 $vgpr2 = FLAT_LOAD_DWORD $vgpr0_vgpr1, 0, 0, implicit $exec, implicit $flat_scr
317 $exec_lo = S_MOV_B32 -1
319 # GCN-LABEL: name: vmem_global_exec
320 # GCN: GLOBAL_LOAD_DWORD
321 # GCN-NEXT: S_WAITCNT_DEPCTR 65507
322 # GCN-NEXT: S_MOV_B32
324 name: vmem_global_exec
327 $vgpr0 = IMPLICIT_DEF
328 $vgpr1 = IMPLICIT_DEF
329 $vgpr2 = GLOBAL_LOAD_DWORD $vgpr0_vgpr1, 0, 0, implicit $exec
330 $exec_lo = S_MOV_B32 -1
332 # GCN-LABEL: name: vmem_global_atomic_exec
333 # GCN: GLOBAL_ATOMIC_ADD_RTN
334 # GCN-NEXT: S_WAITCNT_DEPCTR 65507
335 # GCN-NEXT: S_MOV_B32
337 name: vmem_global_atomic_exec
340 $vgpr0 = IMPLICIT_DEF
341 $vgpr1 = IMPLICIT_DEF
342 $vgpr2 = IMPLICIT_DEF
343 $vgpr3 = GLOBAL_ATOMIC_ADD_RTN $vgpr0_vgpr1, $vgpr2, 0, 1, implicit $exec :: (load store syncscope("agent") seq_cst (s32), addrspace 1)
344 $exec_lo = S_MOV_B32 -1