1 # RUN: llc -mtriple=amdgcn -mcpu=gfx940 -verify-machineinstrs -run-pass post-RA-hazard-rec %s -o - | FileCheck -check-prefix=GCN %s
3 # GCN-LABEL: name: trans32_write_non_trans32_read
7 name: trans32_write_non_trans32_read
10 $vgpr1 = V_RCP_F32_e32 $vgpr0, implicit $mode, implicit $exec
11 $vgpr2 = V_MUL_F32_e32 $vgpr1, $vgpr2, implicit $mode, implicit $exec
14 # GCN-LABEL: name: trans32_write_trans_read
17 name: trans32_write_trans_read
20 $vgpr0 = V_SIN_F32_e32 $vgpr1, implicit $mode, implicit $exec
21 $vgpr2 = V_COS_F32_e32 $vgpr0, implicit $mode, implicit $exec
24 # GCN-LABEL: name: trans64_write_non_trans_read
28 name: trans64_write_non_trans_read
31 $vgpr0_vgpr1 = V_RCP_F64_e32 $vgpr2_vgpr3, implicit $mode, implicit $exec
32 $vgpr4 = V_OR_B32_e32 $vgpr1, $vgpr5, implicit $mode, implicit $exec
35 # GCN-LABEL: name: trans32_write_non_trans64_read
39 name: trans32_write_non_trans64_read
42 $vgpr1 = V_EXP_F32_e32 $vgpr0, implicit $mode, implicit $exec
43 $vgpr2_vgpr3 = V_MUL_F64_e64 0, $vgpr0_vgpr1, 0, $vgpr2_vgpr3, 0, 0, implicit $mode, implicit $exec
46 # GCN-LABEL: name: opsel_hi16_write_valu_read
50 name: opsel_hi16_write_valu_read
53 $vgpr0 = V_ADD_I16_e64 8, $vgpr1, 0, $vgpr2, 0, 0, implicit $exec
54 $vgpr4_vgpr5 = V_MUL_F64_e64 0, $vgpr0_vgpr1, 0, $vgpr2_vgpr3, 0, 0, implicit $mode, implicit $exec
57 # GCN-LABEL: name: opsel_lo16_write_valu_read
60 name: opsel_lo16_write_valu_read
63 $vgpr0 = V_ADD_I16_e64 0, $vgpr1, 0, $vgpr2, 0, 0, implicit $exec
64 $vgpr4_vgpr5 = V_MUL_F64_e64 0, $vgpr0_vgpr1, 0, $vgpr2_vgpr3, 0, 0, implicit $mode, implicit $exec
67 # GCN-LABEL: name: sdwa_hi16_write_valu_read
70 # GCN-NEXT: V_MOV_B32_e32
71 name: sdwa_hi16_write_valu_read
74 $vgpr0 = V_MOV_B32_sdwa 0, $vgpr1, 0, 5, 2, 5, implicit $vgpr0(tied-def 0), implicit $exec
75 $vgpr3 = V_MOV_B32_e32 $vgpr0, implicit $exec
78 # GCN-LABEL: name: sdwa_lo16_write_valu_read
81 # GCN-NEXT: V_MOV_B32_e32
82 name: sdwa_lo16_write_valu_read
85 $vgpr0 = V_MOV_B32_sdwa 0, $vgpr1, 0, 4, 2, 5, implicit $vgpr0(tied-def 0), implicit $exec
86 $vgpr3 = V_MOV_B32_e32 $vgpr0, implicit $exec
89 # GCN-LABEL: name: sdwa_dword_write_valu_read
91 # GCN-NEXT: V_MOV_B32_e32
92 name: sdwa_dword_write_valu_read
95 $vgpr0 = V_MOV_B32_sdwa 0, $vgpr1, 0, 6, 2, 5, implicit $vgpr0(tied-def 0), implicit $exec
96 $vgpr3 = V_MOV_B32_e32 $vgpr0, implicit $exec
99 # GCN-LABEL: name: sdwa_lo16_no_write_valu_read
100 # GCN: V_CMP_EQ_U32_sdwa
101 # GCN-NEXT: V_MOV_B32_e32
102 name: sdwa_lo16_no_write_valu_read
105 $vcc = V_CMP_EQ_U32_sdwa 0, $vgpr1, 0, $vgpr0, 0, 5, 2, implicit $exec
106 $vgpr3 = V_MOV_B32_e32 $vgpr0, implicit $exec
109 # GCN-LABEL: name: valu_write_sgpr_valu_read_as_constant
110 # GCN: V_READFIRSTLANE_B32
112 # GCN-NEXT: V_MOV_B32_e32
113 name: valu_write_sgpr_valu_read_as_constant
116 $sgpr0 = V_READFIRSTLANE_B32 $vgpr0, implicit $exec
117 $vgpr1 = V_MOV_B32_e32 $sgpr0, implicit $exec
120 # GCN-LABEL: name: valu_write_vcc_valu_read_as_constant
121 # GCN: V_CMP_NE_U32_e32
123 # GCN-NEXT: V_ADDC_U32_e32
124 name: valu_write_vcc_valu_read_as_constant
127 V_CMP_NE_U32_e32 0, $vgpr0, implicit-def $vcc, implicit $exec
128 $vgpr1 = V_ADDC_U32_e32 0, $vgpr1, implicit-def $vcc, implicit $vcc, implicit $exec
131 # GCN-LABEL: name: valu_write_sgpr_readlane_read_as_laneselect
132 # GCN: V_READFIRSTLANE_B32
134 # GCN-NEXT: V_READLANE_B32
135 name: valu_write_sgpr_readlane_read_as_laneselect
138 $sgpr0 = V_READFIRSTLANE_B32 $vgpr0, implicit $exec
139 $sgpr1 = V_READLANE_B32 $vgpr1, $sgpr0, implicit $exec
142 # GCN-LABEL: name: valu_write_sgpr_writelane_read_as_laneselect
143 # GCN: V_ADD_CO_U32_e64
145 # GCN-NEXT: V_WRITELANE_B32
146 name: valu_write_sgpr_writelane_read_as_laneselect
149 $vgpr0, $sgpr0_sgpr1 = V_ADD_CO_U32_e64 $vgpr0, 1, 0, implicit $exec
150 $vgpr1 = V_WRITELANE_B32 0, $sgpr0, $vgpr1, implicit $exec
153 # GCN-LABEL: name: vcmpx_write_exec_valu_read_as_constant
154 # GCN: V_CMPX_EQ_I32_e32
156 # GCN-NEXT: V_MOV_B32_e32
157 name: vcmpx_write_exec_valu_read_as_constant
160 implicit $exec, implicit $vcc = V_CMPX_EQ_I32_e32 $vgpr0, $vgpr1, implicit $exec
161 $vgpr1 = V_MOV_B32_e32 $exec_lo, implicit $exec
164 # GCN-LABEL: name: vcmpx_write_exec_readlane
165 # GCN: V_CMPX_EQ_I32_e32
167 # GCN-NEXT: V_READLANE_B32
168 name: vcmpx_write_exec_readlane
171 implicit $exec, implicit $vcc = V_CMPX_EQ_I32_e32 $vgpr0, $vgpr1, implicit $exec
172 $sgpr1 = V_READLANE_B32 $vgpr1, 0, implicit $exec
175 # GCN-LABEL: name: vcmpx_write_exec_readfirstlane
176 # GCN: V_CMPX_EQ_I32_e32
178 # GCN-NEXT: V_READFIRSTLANE_B32
179 name: vcmpx_write_exec_readfirstlane
182 implicit $exec, implicit $vcc = V_CMPX_EQ_I32_e32 $vgpr0, $vgpr1, implicit $exec
183 $sgpr1 = V_READFIRSTLANE_B32 $vgpr1, implicit $exec
186 # GCN-LABEL: name: vcmpx_write_exec_writelane
187 # GCN: V_CMPX_EQ_I32_e32
189 # GCN-NEXT: V_WRITELANE_B32
190 name: vcmpx_write_exec_writelane
193 implicit $exec, implicit $vcc = V_CMPX_EQ_I32_e32 $vgpr0, $vgpr1, implicit $exec
194 $vgpr1 = V_WRITELANE_B32 0, $sgpr0, $vgpr1, implicit $exec
197 # GCN-LABEL: name: valu_write_vgpr_readlane_read
198 # GCN: V_ADD_CO_U32_e32
200 # GCN-NEXT: V_READLANE_B32
201 name: valu_write_vgpr_readlane_read
204 $vgpr1 = V_ADD_CO_U32_e32 $vgpr0, $vgpr0, implicit-def $vcc, implicit $exec
205 $sgpr1 = V_READLANE_B32 $vgpr1, $sgpr0, implicit $exec
208 # GCN-LABEL: name: valu_write_vgpr_readfirstlane_read
209 # GCN: V_ADD_CO_U32_e32
211 # GCN-NEXT: V_READFIRSTLANE_B32
212 name: valu_write_vgpr_readfirstlane_read
215 $vgpr1 = V_ADD_CO_U32_e32 $vgpr0, $vgpr0, implicit-def $vcc, implicit $exec
216 $sgpr1 = V_READFIRSTLANE_B32 $vgpr1, implicit $exec
219 # GCN-LABEL: name: global_store_dwordx4_data_hazard
220 # GCN: GLOBAL_STORE_DWORDX4
222 # GCN-NEXT: V_MOV_B32_e32
223 name: global_store_dwordx4_data_hazard
227 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
228 GLOBAL_STORE_DWORDX4 $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5, 0, 0, implicit $exec
229 $vgpr2 = V_MOV_B32_e32 0, implicit $exec
232 # GCN-LABEL: name: global_store_dwordx3_data_hazard
233 # GCN: GLOBAL_STORE_DWORDX3
235 # GCN-NEXT: V_MOV_B32_e32
236 name: global_store_dwordx3_data_hazard
240 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4
241 GLOBAL_STORE_DWORDX3 $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4, 0, 0, implicit $exec
242 $vgpr2 = V_MOV_B32_e32 0, implicit $exec