1 # RUN: llc -mtriple=amdgcn -mcpu=gfx1010 -verify-machineinstrs -run-pass post-RA-hazard-rec -o - %s | FileCheck -check-prefixes=GCN,GFX10 %s
2 # RUN: llc -mtriple=amdgcn -mcpu=gfx1100 -verify-machineinstrs -run-pass post-RA-hazard-rec -o - %s | FileCheck -check-prefixes=GCN %s
4 # GCN-LABEL: name: vmem_write_sgpr
5 # GCN: BUFFER_LOAD_DWORD_OFFEN
6 # GFX10-NEXT: S_WAITCNT_DEPCTR 65507
12 $sgpr0_sgpr1_sgpr2_sgpr3 = IMPLICIT_DEF
15 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 0, 0, 0, implicit $exec
18 # GCN-LABEL: name: vmem_write_exec
19 # GCN: BUFFER_STORE_DWORD_OFFEN_exact
20 # GFX10-NEXT: S_WAITCNT_DEPCTR 65507
26 $sgpr0_sgpr1_sgpr2_sgpr3 = IMPLICIT_DEF
30 BUFFER_STORE_DWORD_OFFEN_exact killed renamable $vgpr0, renamable $vgpr1, renamable $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 0, 0, implicit $exec
31 $exec_lo = S_MOV_B32 -1
33 # GCN-LABEL: name: vmem_write_sgpr_chain
34 # GCN: BUFFER_LOAD_DWORD_OFFEN
39 # GFX10-NEXT: S_WAITCNT_DEPCTR 65507
42 name: vmem_write_sgpr_chain
46 $sgpr0_sgpr1_sgpr2_sgpr3 = IMPLICIT_DEF
49 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 0, 0, 0, implicit $exec
50 $sgpr5 = S_MOV_B32 $sgpr0
51 $sgpr6 = S_MOV_B32 $sgpr1
52 $sgpr7 = S_MOV_B32 $sgpr2
53 $sgpr8 = S_MOV_B32 $sgpr3
56 # GCN-LABEL: name: vmem_smem_write_sgpr
57 # GCN: BUFFER_LOAD_DWORD_OFFEN
58 # GFX10-NEXT: S_WAITCNT_DEPCTR 65507
59 # GCN-NEXT: S_LOAD_DWORD_IMM
61 name: vmem_smem_write_sgpr
64 $sgpr0_sgpr1_sgpr2_sgpr3 = IMPLICIT_DEF
67 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 0, 0, 0, implicit $exec
68 $sgpr0 = S_LOAD_DWORD_IMM $sgpr0_sgpr1, 0, 0
70 # GCN-LABEL: name: vmem_snop_write_sgpr
71 # GCN: BUFFER_LOAD_DWORD_OFFEN
73 # GFX10-NEXT: S_WAITCNT_DEPCTR 65507
76 name: vmem_snop_write_sgpr
79 $sgpr0_sgpr1_sgpr2_sgpr3 = IMPLICIT_DEF
82 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 0, 0, 0, implicit $exec
86 # GCN-LABEL: name: vmem_valu_write_sgpr
87 # GCN: BUFFER_LOAD_DWORD_OFFEN
91 name: vmem_valu_write_sgpr
94 $sgpr0_sgpr1_sgpr2_sgpr3 = IMPLICIT_DEF
97 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 0, 0, 0, implicit $exec
98 $vgpr2 = V_ADD_F32_e32 $vgpr1, $vgpr1, implicit $mode, implicit $exec
101 # GCN-LABEL: name: vmem_swait0_write_sgpr
102 # GCN: BUFFER_LOAD_DWORD_OFFEN
103 # GCN-NEXT: S_WAITCNT
104 # GCN-NEXT: S_MOV_B32
106 name: vmem_swait0_write_sgpr
109 $sgpr0_sgpr1_sgpr2_sgpr3 = IMPLICIT_DEF
110 $sgpr4 = IMPLICIT_DEF
111 $vgpr0 = IMPLICIT_DEF
112 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 0, 0, 0, implicit $exec
116 # GCN-LABEL: name: vmem_swait_any_write_sgpr
117 # GCN: BUFFER_LOAD_DWORD_OFFEN
118 # GCN-NEXT: S_WAITCNT
119 # GFX10-NEXT: S_WAITCNT_DEPCTR 65507
120 # GCN-NEXT: S_MOV_B32
122 name: vmem_swait_any_write_sgpr
125 $sgpr0_sgpr1_sgpr2_sgpr3 = IMPLICIT_DEF
126 $sgpr4 = IMPLICIT_DEF
127 $vgpr0 = IMPLICIT_DEF
128 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 0, 0, 0, implicit $exec
132 # GCN-LABEL: name: vmem_write_exec_impread
133 # GCN: BUFFER_LOAD_DWORD_OFFEN
134 # GFX10-NEXT: S_WAITCNT_DEPCTR 65507
135 # GCN-NEXT: S_MOV_B64
137 name: vmem_write_exec_impread
140 $sgpr0_sgpr1_sgpr2_sgpr3 = IMPLICIT_DEF
141 $sgpr4 = IMPLICIT_DEF
142 $vgpr0 = IMPLICIT_DEF
143 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 0, 0, 0, implicit $exec
146 # GCN-LABEL: name: vmem_write_exec_expread
147 # GCN: BUFFER_LOAD_DWORD_OFFEN
148 # GFX10-NEXT: S_WAITCNT_DEPCTR 65507
149 # GCN-NEXT: S_MOV_B64
151 name: vmem_write_exec_expread
154 $sgpr0_sgpr1_sgpr2_sgpr3 = IMPLICIT_DEF
155 $vgpr0 = IMPLICIT_DEF
156 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $exec_lo, 0, 0, 0, implicit $exec
159 # GCN-LABEL: name: ds_write_m0
161 # GFX10-NEXT: S_WAITCNT_DEPCTR 65507
162 # GCN-NEXT: S_MOV_B32
167 $sgpr0_sgpr1_sgpr2_sgpr3 = IMPLICIT_DEF
168 $sgpr4 = IMPLICIT_DEF
169 $vgpr0 = IMPLICIT_DEF
170 $vgpr1 = DS_READ_B32 $vgpr0, 0, 0, implicit $m0, implicit $exec
173 # GCN-LABEL: name: vmem_write_sgpr_fall_through
174 # GCN: BUFFER_LOAD_DWORD_OFFEN
176 # GFX10-NEXT: S_WAITCNT_DEPCTR 65507
177 # GCN-NEXT: S_MOV_B32
179 name: vmem_write_sgpr_fall_through
183 $sgpr0_sgpr1_sgpr2_sgpr3 = IMPLICIT_DEF
184 $sgpr4 = IMPLICIT_DEF
185 $vgpr0 = IMPLICIT_DEF
186 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 0, 0, 0, implicit $exec
191 # GCN-LABEL: name: vmem_write_sgpr_branch
192 # GCN: BUFFER_LOAD_DWORD_OFFEN
195 # GFX10-NEXT: S_WAITCNT_DEPCTR 65507
196 # GCN-NEXT: S_MOV_B32
198 name: vmem_write_sgpr_branch
202 $sgpr0_sgpr1_sgpr2_sgpr3 = IMPLICIT_DEF
203 $sgpr4 = IMPLICIT_DEF
204 $vgpr0 = IMPLICIT_DEF
205 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 0, 0, 0, implicit $exec
211 # GCN-LABEL: name: vmem_write_sgpr_branch_around
212 # GCN: BUFFER_LOAD_DWORD_OFFEN
215 # GFX10-NEXT: S_WAITCNT_DEPCTR 65507
216 # GCN-NEXT: S_MOV_B32
218 name: vmem_write_sgpr_branch_around
222 $sgpr0_sgpr1_sgpr2_sgpr3 = IMPLICIT_DEF
223 $sgpr4 = IMPLICIT_DEF
224 $vgpr0 = IMPLICIT_DEF
225 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 0, 0, 0, implicit $exec
235 # GCN-LABEL: name: vmem_write_sgpr_cbranch_around
236 # GCN: BUFFER_LOAD_DWORD_OFFEN
237 # GCN-NEXT: S_CBRANCH
243 # GFX10-NEXT: S_WAITCNT_DEPCTR 65507
244 # GCN-NEXT: S_MOV_B32
246 name: vmem_write_sgpr_cbranch_around
249 successors: %bb.1, %bb.2
250 $sgpr0_sgpr1_sgpr2_sgpr3 = IMPLICIT_DEF
251 $sgpr4 = IMPLICIT_DEF
252 $vgpr0 = IMPLICIT_DEF
253 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 0, 0, 0, implicit $exec
254 S_CBRANCH_SCC0 %bb.2, implicit $scc
260 $vgpr2, $vcc_lo = V_ADD_CO_U32_e64 $vgpr1, $vgpr1, 0, implicit $exec
266 # GCN-LABEL: name: vmem_write_sgpr_branch_backedge
267 # GCN: $vgpr0 = IMPLICIT_DEF
268 # GFX10-NEXT: S_WAITCNT_DEPCTR 65507
269 # GCN-NEXT: S_MOV_B32
271 name: vmem_write_sgpr_branch_backedge
275 $sgpr0_sgpr1_sgpr2_sgpr3 = IMPLICIT_DEF
276 $sgpr4 = IMPLICIT_DEF
277 $vgpr0 = IMPLICIT_DEF
281 $vgpr1 = BUFFER_LOAD_DWORD_OFFEN $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 0, 0, 0, implicit $exec
284 # GCN-LABEL: name: ds_write_exec
285 # GCN: DS_WRITE_B32_gfx9
286 # GFX10-NEXT: S_WAITCNT_DEPCTR 65507
287 # GCN-NEXT: S_MOV_B32
292 $vgpr0 = IMPLICIT_DEF
293 $vgpr1 = IMPLICIT_DEF
294 DS_WRITE_B32_gfx9 $vgpr0, $vgpr1, 0, 0, implicit $exec
295 $exec_lo = S_MOV_B32 -1
297 # GCN-LABEL: name: vmem_scratch_exec
298 # GCN: SCRATCH_LOAD_DWORD
299 # GFX10-NEXT: S_WAITCNT_DEPCTR 65507
300 # GCN-NEXT: S_MOV_B32
302 name: vmem_scratch_exec
305 $vgpr0 = IMPLICIT_DEF
306 $vgpr1 = SCRATCH_LOAD_DWORD undef $vgpr0, 0, 0, implicit $exec, implicit $flat_scr
307 $exec_lo = S_MOV_B32 -1
309 # GCN-LABEL: name: vmem_flat_exec
310 # GCN: FLAT_LOAD_DWORD
311 # GFX10-NEXT: S_WAITCNT_DEPCTR 65507
312 # GCN-NEXT: S_MOV_B32
317 $vgpr0 = IMPLICIT_DEF
318 $vgpr1 = IMPLICIT_DEF
319 $vgpr2 = FLAT_LOAD_DWORD $vgpr0_vgpr1, 0, 0, implicit $exec, implicit $flat_scr
320 $exec_lo = S_MOV_B32 -1
322 # GCN-LABEL: name: vmem_global_exec
323 # GCN: GLOBAL_LOAD_DWORD
324 # GFX10-NEXT: S_WAITCNT_DEPCTR 65507
325 # GCN-NEXT: S_MOV_B32
327 name: vmem_global_exec
330 $vgpr0 = IMPLICIT_DEF
331 $vgpr1 = IMPLICIT_DEF
332 $vgpr2 = GLOBAL_LOAD_DWORD $vgpr0_vgpr1, 0, 0, implicit $exec
333 $exec_lo = S_MOV_B32 -1
335 # GCN-LABEL: name: vmem_global_atomic_exec
336 # GCN: GLOBAL_ATOMIC_ADD_RTN
337 # GFX10-NEXT: S_WAITCNT_DEPCTR 65507
338 # GCN-NEXT: S_MOV_B32
340 name: vmem_global_atomic_exec
343 $vgpr0 = IMPLICIT_DEF
344 $vgpr1 = IMPLICIT_DEF
345 $vgpr2 = IMPLICIT_DEF
346 $vgpr3 = GLOBAL_ATOMIC_ADD_RTN $vgpr0_vgpr1, $vgpr2, 0, 1, implicit $exec :: (load store syncscope("agent") seq_cst (s32), addrspace 1)
347 $exec_lo = S_MOV_B32 -1