1 # RUN: llc -mtriple=amdgcn -mcpu=tahiti -run-pass post-RA-hazard-rec %s -o - | FileCheck %s -check-prefixes=GCN,SICI
2 # RUN: llc -mtriple=amdgcn -mcpu=hawaii -run-pass post-RA-hazard-rec %s -o - | FileCheck %s -check-prefixes=GCN,CIVI,SICI
3 # RUN: llc -mtriple=amdgcn -mcpu=fiji -run-pass post-RA-hazard-rec %s -o - | FileCheck %s -check-prefixes=GCN,CIVI,VI
4 # RUN: llc -mtriple=amdgcn -mcpu=gfx900 -run-pass post-RA-hazard-rec %s -o - | FileCheck %s -check-prefixes=GCN,CIVI,VI,GFX9
7 define amdgpu_kernel void @div_fmas() { ret void }
8 define amdgpu_kernel void @s_getreg() { ret void }
9 define amdgpu_kernel void @s_setreg() { ret void }
10 define amdgpu_kernel void @vmem_gt_8dw_store() { ret void }
11 define amdgpu_kernel void @readwrite_lane() { ret void }
12 define amdgpu_kernel void @rfe() { ret void }
13 define amdgpu_kernel void @s_movrel() { ret void }
14 define amdgpu_kernel void @v_interp() { ret void }
15 define amdgpu_kernel void @dpp() { ret void }
18 # GCN-LABEL: name: div_fmas
36 # GCN: V_DIV_SCALE_F32
44 $vgpr0 = V_DIV_FMAS_F32_e64 0, $vgpr1, 0, $vgpr2, 0, $vgpr3, 0, 0, implicit $mode, implicit $vcc, implicit $exec
48 implicit $vcc = V_CMP_EQ_I32_e32 $vgpr1, $vgpr2, implicit $exec
49 $vgpr0 = V_DIV_FMAS_F32_e64 0, $vgpr1, 0, $vgpr2, 0, $vgpr3, 0, 0, implicit $mode, implicit $vcc, implicit $exec
53 $vcc = V_CMP_EQ_I32_e64 $vgpr1, $vgpr2, implicit $exec
54 $vgpr0 = V_DIV_FMAS_F32_e64 0, $vgpr1, 0, $vgpr2, 0, $vgpr3, 0, 0, implicit $mode, implicit $vcc, implicit $exec
58 $vgpr4, $vcc = V_DIV_SCALE_F32_e64 0, $vgpr1, 0, $vgpr1, 0, $vgpr3, 0, 0, implicit $mode, implicit $exec
59 $vgpr0 = V_DIV_FMAS_F32_e64 0, $vgpr1, 0, $vgpr2, 0, $vgpr3, 0, 0, implicit $mode, implicit $vcc, implicit $exec
66 # GCN-LABEL: name: s_getreg
91 S_SETREG_B32 $sgpr0, 1, implicit-def $mode, implicit $mode
92 $sgpr1 = S_GETREG_B32 1, implicit-def $mode, implicit $mode
96 S_SETREG_IMM32_B32 0, 1, implicit-def $mode, implicit $mode
97 $sgpr1 = S_GETREG_B32 1, implicit-def $mode, implicit $mode
101 S_SETREG_B32 $sgpr0, 1, implicit-def $mode, implicit $mode
103 $sgpr2 = S_GETREG_B32 1, implicit-def $mode, implicit $mode
107 S_SETREG_B32 $sgpr0, 0, implicit-def $mode, implicit $mode
108 $sgpr1 = S_GETREG_B32 1, implicit-def $mode, implicit $mode
114 # GCN-LABEL: name: s_setreg
136 S_SETREG_B32 $sgpr0, 1, implicit-def $mode, implicit $mode
137 S_SETREG_B32 $sgpr1, 1, implicit-def $mode, implicit $mode
141 S_SETREG_B32 $sgpr0, 64, implicit-def $mode, implicit $mode
142 S_SETREG_B32 $sgpr1, 128, implicit-def $mode, implicit $mode
146 S_SETREG_B32 $sgpr0, 1, implicit-def $mode, implicit $mode
147 S_SETREG_B32 $sgpr1, 0, implicit-def $mode, implicit $mode
153 # GCN-LABEL: name: vmem_gt_8dw_store
156 # GCN: BUFFER_STORE_DWORD_OFFSET
157 # GCN-NEXT: V_MOV_B32
158 # GCN: BUFFER_STORE_DWORDX3_OFFSET
160 # GCN-NEXT: V_MOV_B32
161 # GCN: BUFFER_STORE_DWORDX4_OFFSET
162 # GCN-NEXT: V_MOV_B32
163 # GCN: BUFFER_STORE_DWORDX4_OFFSET
165 # GCN-NEXT: V_MOV_B32
166 # GCN: BUFFER_STORE_FORMAT_XYZ_OFFSET
168 # GCN-NEXT: V_MOV_B32
169 # GCN: BUFFER_STORE_FORMAT_XYZW_OFFSET
171 # GCN-NEXT: V_MOV_B32
174 # GCN: FLAT_STORE_DWORDX2
175 # GCN-NEXT: V_MOV_B32
176 # GCN: FLAT_STORE_DWORDX3
178 # GCN-NEXT: V_MOV_B32
179 # GCN: FLAT_STORE_DWORDX4
181 # GCN-NEXT: V_MOV_B32
182 # GCN: FLAT_ATOMIC_CMPSWAP_X2
184 # GCN-NEXT: V_MOV_B32
185 # GCN: FLAT_ATOMIC_FCMPSWAP_X2
189 name: vmem_gt_8dw_store
193 BUFFER_STORE_DWORD_OFFSET $vgpr3, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 0, 0, 0, implicit $exec
194 $vgpr3 = V_MOV_B32_e32 0, implicit $exec
195 BUFFER_STORE_DWORDX3_OFFSET $vgpr2_vgpr3_vgpr4, $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 0, 0, implicit $exec
196 $vgpr3 = V_MOV_B32_e32 0, implicit $exec
197 BUFFER_STORE_DWORDX4_OFFSET $vgpr2_vgpr3_vgpr4_vgpr5, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 0, 0, 0, implicit $exec
198 $vgpr3 = V_MOV_B32_e32 0, implicit $exec
199 BUFFER_STORE_DWORDX4_OFFSET $vgpr2_vgpr3_vgpr4_vgpr5, $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 0, 0, implicit $exec
200 $vgpr3 = V_MOV_B32_e32 0, implicit $exec
201 BUFFER_STORE_FORMAT_XYZ_OFFSET $vgpr2_vgpr3_vgpr4, $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 0, 0, implicit $exec
202 $vgpr3 = V_MOV_B32_e32 0, implicit $exec
203 BUFFER_STORE_FORMAT_XYZW_OFFSET $vgpr2_vgpr3_vgpr4_vgpr5, $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 0, 0, implicit $exec
204 $vgpr3 = V_MOV_B32_e32 0, implicit $exec
205 BUFFER_ATOMIC_CMPSWAP_X2_OFFSET $vgpr2_vgpr3_vgpr4_vgpr5, $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 0, implicit $exec
206 $vgpr3 = V_MOV_B32_e32 0, implicit $exec
210 FLAT_STORE_DWORDX2 $vgpr0_vgpr1, $vgpr2_vgpr3, 0, 0, implicit $exec, implicit $flat_scr
211 $vgpr3 = V_MOV_B32_e32 0, implicit $exec
212 FLAT_STORE_DWORDX3 $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4, 0, 0, implicit $exec, implicit $flat_scr
213 $vgpr3 = V_MOV_B32_e32 0, implicit $exec
214 FLAT_STORE_DWORDX4 $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5, 0, 0, implicit $exec, implicit $flat_scr
215 $vgpr3 = V_MOV_B32_e32 0, implicit $exec
216 FLAT_ATOMIC_CMPSWAP_X2 $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5, 0, 0, implicit $exec, implicit $flat_scr
217 $vgpr3 = V_MOV_B32_e32 0, implicit $exec
218 FLAT_ATOMIC_FCMPSWAP_X2 $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5, 0, 0, implicit $exec, implicit $flat_scr
219 $vgpr3 = V_MOV_B32_e32 0, implicit $exec
227 # GCN-LABEL: name: readwrite_lane
232 # GCN: V_READLANE_B32
237 # GCN: V_WRITELANE_B32
242 # GCN: V_READLANE_B32
247 # GCN: V_WRITELANE_B32
253 $vgpr0,$sgpr0_sgpr1 = V_ADD_CO_U32_e64 $vgpr1, $vgpr2, implicit $vcc, 0, implicit $exec
254 $sgpr4 = V_READLANE_B32 $vgpr4, $sgpr0
258 $vgpr0,$sgpr0_sgpr1 = V_ADD_CO_U32_e64 $vgpr1, $vgpr2, implicit $vcc, 0, implicit $exec
259 $vgpr4 = V_WRITELANE_B32 $sgpr0, $sgpr0, $vgpr4
263 $vgpr0,implicit $vcc = V_ADD_CO_U32_e32 $vgpr1, $vgpr2, implicit $vcc, implicit $exec
264 $sgpr4 = V_READLANE_B32 $vgpr4, $vcc_lo
268 $m0 = S_MOV_B32 $sgpr4
269 $vgpr0,implicit $vcc = V_ADD_CO_U32_e32 $vgpr1, $vgpr2, implicit $vcc, implicit $exec
270 $vgpr4 = V_WRITELANE_B32 $m0, $vcc_lo, $vgpr4
278 # GCN-LABEL: name: rfe
283 # GCN-NEXT: S_RFE_B64
287 # GCN-NEXT: S_RFE_B64
293 S_SETREG_B32 $sgpr0, 3, implicit-def $mode, implicit $mode
294 S_RFE_B64 $sgpr2_sgpr3
298 S_SETREG_B32 $sgpr0, 0, implicit-def $mode, implicit $mode
299 S_RFE_B64 $sgpr2_sgpr3
307 # GCN-LABEL: name: s_movrel
312 # GCN-NEXT: S_MOVRELS_B32
317 # GCN-NEXT: S_MOVRELS_B64
322 # GCN-NEXT: S_MOVRELD_B32
327 # GCN-NEXT: S_MOVRELD_B64
334 $sgpr0 = S_MOVRELS_B32 $sgpr0, implicit $m0
339 $sgpr0_sgpr1 = S_MOVRELS_B64 $sgpr0_sgpr1, implicit $m0
344 S_MOVRELD_B32 $sgpr0, $sgpr0, implicit $m0
349 S_MOVRELD_B64 $sgpr0_sgpr1, $sgpr0_sgpr1, implicit $m0
356 # GCN-LABEL: name: v_interp
361 # GCN-NEXT: V_INTERP_P1_F32
366 # GCN-NEXT: V_INTERP_P2_F32
371 # GCN-NEXT: V_INTERP_P1_F32_16bank
376 # GCN-NEXT: V_INTERP_MOV_F32
383 $vgpr0 = V_INTERP_P1_F32 $vgpr0, 0, 0, implicit $mode, implicit $m0, implicit $exec
388 $vgpr0 = V_INTERP_P2_F32 $vgpr0, $vgpr1, 0, 0, implicit $mode, implicit $m0, implicit $exec
393 $vgpr0 = V_INTERP_P1_F32_16bank $vgpr0, 0, 0, implicit $mode, implicit $m0, implicit $exec
398 $vgpr0 = V_INTERP_MOV_F32 0, 0, 0, implicit $mode, implicit $m0, implicit $exec
405 # GCN-LABEL: name: dpp
410 # VI-NEXT: V_MOV_B32_dpp
413 # VI: V_CMPX_EQ_I32_e32
415 # VI-NEXT: V_MOV_B32_dpp
421 $vgpr0 = V_MOV_B32_e32 0, implicit $exec
422 $vgpr1 = V_MOV_B32_dpp $vgpr1, $vgpr0, 0, 15, 15, 0, implicit $exec
426 implicit $exec, implicit $vcc = V_CMPX_EQ_I32_e32 $vgpr0, $vgpr1, implicit $exec
427 $vgpr3 = V_MOV_B32_dpp $vgpr3, $vgpr0, 0, 15, 15, 0, implicit $exec