1 # RUN: llc -march=amdgcn -mcpu=gfx1010 -verify-machineinstrs -run-pass=si-optimize-exec-masking-pre-ra -o - %s | FileCheck -check-prefix=GCN %s
3 # GCN: name: negated_cond_vop2
4 # GCN: %0:sgpr_32 = IMPLICIT_DEF
5 # GCN-NEXT: $vcc_lo = S_ANDN2_B32 $exec_lo, %0, implicit-def $scc
6 # GCN-NEXT: S_CBRANCH_VCCNZ %bb.2, implicit $vcc
8 name: negated_cond_vop2
11 %0:sgpr_32 = IMPLICIT_DEF
12 %1:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, %0, implicit $exec
13 V_CMP_NE_U32_e32 1, %1, implicit-def $vcc, implicit $exec
14 $vcc_lo = S_AND_B32 $exec_lo, killed $vcc_lo, implicit-def dead $scc
15 S_CBRANCH_VCCNZ %bb.2, implicit killed $vcc
25 # GCN: name: negated_cond_vop3
26 # GCN: %0:sgpr_32 = IMPLICIT_DEF
27 # GCN-NEXT: $vcc_lo = S_ANDN2_B32 $exec_lo, %0, implicit-def $scc
28 # GCN-NEXT: S_CBRANCH_VCCNZ %bb.2, implicit $vcc
30 name: negated_cond_vop3
33 %0:sgpr_32 = IMPLICIT_DEF
34 %1:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, %0, implicit $exec
35 %2:sgpr_32 = V_CMP_NE_U32_e64 %1, 1, implicit $exec
36 $vcc_lo = S_AND_B32 killed %2, $exec_lo, implicit-def dead $scc
37 S_CBRANCH_VCCNZ %bb.2, implicit killed $vcc
47 # GCN: name: negated_cond_vop2_redef_vcc1
48 # GCN: %0:sgpr_32 = IMPLICIT_DEF
49 # GCN-NEXT: %1:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, %0, implicit $exec
50 # GCN-NEXT: V_CMP_NE_U32_e32 1, %1, implicit-def $vcc, implicit $exec
51 # GCN-NEXT: $vcc_lo = COPY $sgpr0
52 # GCN-NEXT: $vcc_lo = S_AND_B32 $exec_lo, $vcc_lo, implicit-def dead $scc
53 # GCN-NEXT: S_CBRANCH_VCCNZ %bb.2, implicit $vcc
55 name: negated_cond_vop2_redef_vcc1
58 %0:sgpr_32 = IMPLICIT_DEF
59 %1:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, %0, implicit $exec
60 V_CMP_NE_U32_e32 1, %1, implicit-def $vcc, implicit $exec
62 $vcc_lo = S_AND_B32 $exec_lo, killed $vcc_lo, implicit-def dead $scc
63 S_CBRANCH_VCCNZ %bb.2, implicit killed $vcc
73 # GCN: name: negated_cond_vop3_redef_cmp
74 # GCN: %0:sgpr_32 = IMPLICIT_DEF
75 # GCN-NEXT: %1:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, %0, implicit $exec
76 # GCN-NEXT: %2:sgpr_32 = V_CMP_NE_U32_e64 %1, 1, implicit $exec
77 # GCN-NEXT: %2:sgpr_32 = COPY $sgpr0
78 # GCN-NEXT: $vcc_lo = S_AND_B32 %2, $exec_lo, implicit-def dead $scc
79 # GCN-NEXT: S_CBRANCH_VCCNZ %bb.2, implicit $vcc
81 name: negated_cond_vop3_redef_cmp
84 %0:sgpr_32 = IMPLICIT_DEF
85 %1:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, %0, implicit $exec
86 %2:sgpr_32 = V_CMP_NE_U32_e64 %1, 1, implicit $exec
88 $vcc_lo = S_AND_B32 killed %2, $exec_lo, implicit-def dead $scc
89 S_CBRANCH_VCCNZ %bb.2, implicit killed $vcc
99 # GCN: name: negated_cond_undef_vcc
100 # GCN: $vcc_lo = S_AND_B32 $exec_lo, undef $vcc_lo, implicit-def dead $scc
101 # GCN-NEXT: S_CBRANCH_VCCNZ %bb.2, implicit $vcc
103 name: negated_cond_undef_vcc
106 $vcc_lo = S_AND_B32 $exec_lo, undef $vcc_lo, implicit-def dead $scc
107 S_CBRANCH_VCCNZ %bb.2, implicit killed $vcc
117 # GCN: name: negated_cond_vop3_imp_vcc
118 # GCN: $vcc_lo = IMPLICIT_DEF
119 # GCN-NEXT: $vcc_lo = S_ANDN2_B32 $exec_lo, $vcc_lo, implicit-def $scc
120 # GCN-NEXT: S_CBRANCH_VCCNZ %bb.2, implicit $vcc
122 name: negated_cond_vop3_imp_vcc
125 $vcc_lo = IMPLICIT_DEF
126 %1:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, $vcc_lo, implicit $exec
127 %2:sgpr_32 = V_CMP_NE_U32_e64 %1, 1, implicit $exec
128 $vcc_lo = S_AND_B32 killed %2, $exec_lo, implicit-def dead $scc
129 S_CBRANCH_VCCNZ %bb.2, implicit killed $vcc
139 # GCN: name: negated_cond_vop2_imp_vcc
140 # GCN: $vcc_lo = IMPLICIT_DEF
141 # GCN-NEXT: $vcc_lo = S_ANDN2_B32 $exec_lo, $vcc_lo, implicit-def $scc
142 # GCN-NEXT: S_CBRANCH_VCCNZ %bb.2, implicit $vcc
144 name: negated_cond_vop2_imp_vcc
147 $vcc_lo = IMPLICIT_DEF
148 %1:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, $vcc_lo, implicit $exec
149 V_CMP_NE_U32_e32 1, %1, implicit-def $vcc, implicit $exec
150 $vcc_lo = S_AND_B32 killed $vcc_lo, $exec_lo, implicit-def dead $scc
151 S_CBRANCH_VCCNZ %bb.2, implicit killed $vcc
161 # GCN: name: negated_cond_vop3_redef_sel
162 # GCN: %0:sgpr_32 = IMPLICIT_DEF
163 # GCN-NEXT: %1:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, %0, implicit $exec
164 # GCN-NEXT: %1:vgpr_32 = COPY $vgpr0
165 # GCN-NEXT: %2:sgpr_32 = V_CMP_NE_U32_e64 %1, 1, implicit $exec
166 # GCN-NEXT: $vcc_lo = S_AND_B32 %2, $exec_lo, implicit-def dead $scc
167 # GCN-NEXT: S_CBRANCH_VCCNZ %bb.2, implicit $vcc
169 name: negated_cond_vop3_redef_sel
172 %0:sgpr_32 = IMPLICIT_DEF
173 %1:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, %0, implicit $exec
174 %1:vgpr_32 = COPY $vgpr0
175 %2:sgpr_32 = V_CMP_NE_U32_e64 %1, 1, implicit $exec
176 $vcc_lo = S_AND_B32 killed %2, $exec_lo, implicit-def dead $scc
177 S_CBRANCH_VCCNZ %bb.2, implicit killed $vcc
187 # GCN: name: negated_cond_vop2_used_sel
188 # GCN: %0:sgpr_32 = IMPLICIT_DEF
189 # GCN-NEXT: %1:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, %0, implicit $exec
190 # GCN-NEXT: $vcc_lo = S_ANDN2_B32 $exec_lo, %0, implicit-def $scc
191 # GCN-NEXT: S_CBRANCH_VCCNZ %bb.2, implicit $vcc
193 name: negated_cond_vop2_used_sel
196 %0:sgpr_32 = IMPLICIT_DEF
197 %1:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, %0, implicit $exec
198 V_CMP_NE_U32_e32 1, %1, implicit-def $vcc, implicit $exec
199 $vcc_lo = S_AND_B32 $exec_lo, killed $vcc_lo, implicit-def dead $scc
200 S_CBRANCH_VCCNZ %bb.2, implicit killed $vcc
211 # GCN: name: negated_cond_vop2_used_vcc
212 # GCN: %0:sgpr_32 = IMPLICIT_DEF
213 # GCN-NEXT: %1:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, %0, implicit $exec
214 # GCN-NEXT: V_CMP_NE_U32_e32 1, %1, implicit-def $vcc, implicit $exec
215 # GCN-NEXT: $sgpr0_sgpr1 = COPY $vcc
216 # GCN-NEXT: $vcc_lo = S_ANDN2_B32 $exec_lo, %0, implicit-def $scc
217 # GCN-NEXT: S_CBRANCH_VCCNZ %bb.2, implicit $vcc
219 name: negated_cond_vop2_used_vcc
222 %0:sgpr_32 = IMPLICIT_DEF
223 %1:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, %0, implicit $exec
224 V_CMP_NE_U32_e32 1, %1, implicit-def $vcc, implicit $exec
225 $sgpr0_sgpr1 = COPY $vcc
226 $vcc_lo = S_AND_B32 $exec_lo, killed $vcc_lo, implicit-def dead $scc
227 S_CBRANCH_VCCNZ %bb.2, implicit killed $vcc
237 # GCN: name: negated_cond_vop3_sel_wrong_subreg1
238 # GCN: %0:sgpr_32 = IMPLICIT_DEF
239 # GCN-NEXT: %1.sub1:vreg_64 = IMPLICIT_DEF
240 # GCN-NEXT: %1.sub0:vreg_64 = V_CNDMASK_B32_e64 0, 0, 0, 1, %0, implicit $exec
241 # GCN-NEXT: %2:sgpr_32 = V_CMP_NE_U32_e64 %1.sub1, 1, implicit $exec
242 # GCN-NEXT: $vcc_lo = S_AND_B32 %2, $exec_lo, implicit-def dead $scc
243 # GCN-NEXT: S_CBRANCH_VCCNZ %bb.2, implicit $vcc
245 name: negated_cond_vop3_sel_wrong_subreg1
248 %0:sgpr_32 = IMPLICIT_DEF
249 %1.sub1 = IMPLICIT_DEF
250 %1.sub0:vreg_64 = V_CNDMASK_B32_e64 0, 0, 0, 1, %0, implicit $exec
251 %2:sgpr_32 = V_CMP_NE_U32_e64 %1.sub1, 1, implicit $exec
252 $vcc_lo = S_AND_B32 killed %2, $exec_lo, implicit-def dead $scc
253 S_CBRANCH_VCCNZ %bb.2, implicit killed $vcc
263 # GCN: name: negated_cond_vop3_sel_wrong_subreg2
264 # GCN: %0:sgpr_32 = IMPLICIT_DEF
265 # GCN-NEXT: %1.sub0:vreg_64 = V_CNDMASK_B32_e64 0, 0, 0, 1, %0, implicit $exec
266 # GCN-NEXT: %1.sub1:vreg_64 = IMPLICIT_DEF
267 # GCN-NEXT: %2:sgpr_32 = V_CMP_NE_U32_e64 %1.sub1, 1, implicit $exec
268 # GCN-NEXT: $vcc_lo = S_AND_B32 %2, $exec_lo, implicit-def dead $scc
269 # GCN-NEXT: S_CBRANCH_VCCNZ %bb.2, implicit $vcc
271 name: negated_cond_vop3_sel_wrong_subreg2
274 %0:sgpr_32 = IMPLICIT_DEF
275 %1.sub0:vreg_64 = V_CNDMASK_B32_e64 0, 0, 0, 1, %0, implicit $exec
276 %1.sub1 = IMPLICIT_DEF
277 %2:sgpr_32 = V_CMP_NE_U32_e64 %1.sub1, 1, implicit $exec
278 $vcc_lo = S_AND_B32 killed %2, $exec_lo, implicit-def dead $scc
279 S_CBRANCH_VCCNZ %bb.2, implicit killed $vcc
289 # GCN: name: negated_cond_vop3_sel_right_subreg1
290 # GCN: %0:sgpr_32 = IMPLICIT_DEF
291 # GCN-NEXT: %1.sub1:vreg_64 = IMPLICIT_DEF
292 # GCN-NEXT: $vcc_lo = S_ANDN2_B32 $exec_lo, %0, implicit-def $scc
293 # GCN-NEXT: S_CBRANCH_VCCNZ %bb.2, implicit $vcc
295 name: negated_cond_vop3_sel_right_subreg1
298 %0:sgpr_32 = IMPLICIT_DEF
299 %1.sub1 = IMPLICIT_DEF
300 %1.sub0:vreg_64 = V_CNDMASK_B32_e64 0, 0, 0, 1, %0, implicit $exec
301 %2:sgpr_32 = V_CMP_NE_U32_e64 %1.sub0, 1, implicit $exec
302 $vcc_lo = S_AND_B32 killed %2, $exec_lo, implicit-def dead $scc
303 S_CBRANCH_VCCNZ %bb.2, implicit killed $vcc
313 # GCN: name: negated_cond_vop3_sel_right_subreg2
314 # GCN: %0:sgpr_32 = IMPLICIT_DEF
315 # GCN-NEXT: %1.sub1:vreg_64 = IMPLICIT_DEF
316 # GCN-NEXT: $vcc_lo = S_ANDN2_B32 $exec_lo, %0, implicit-def $scc
317 # GCN-NEXT: S_CBRANCH_VCCNZ %bb.2, implicit $vcc
319 name: negated_cond_vop3_sel_right_subreg2
322 %0:sgpr_32 = IMPLICIT_DEF
323 %1.sub0:vreg_64 = V_CNDMASK_B32_e64 0, 0, 0, 1, %0, implicit $exec
324 %1.sub1 = IMPLICIT_DEF
325 %2:sgpr_32 = V_CMP_NE_U32_e64 %1.sub0, 1, implicit $exec
326 $vcc_lo = S_AND_B32 killed %2, $exec_lo, implicit-def dead $scc
327 S_CBRANCH_VCCNZ %bb.2, implicit killed $vcc
337 # GCN: name: negated_cond_vop3_sel_subreg_overlap
338 # GCN: %0:sgpr_32 = IMPLICIT_DEF
339 # GCN-NEXT: %1.sub2:vreg_128 = V_CNDMASK_B32_e64 0, 0, 0, 1, %0, implicit $exec
340 # GCN-NEXT: %1.sub2_sub3:vreg_128 = IMPLICIT_DEF
341 # GCN-NEXT: %2:sgpr_32 = V_CMP_NE_U32_e64 %1.sub2, 1, implicit $exec
342 # GCN-NEXT: $vcc_lo = S_AND_B32 %2, $exec_lo, implicit-def dead $scc
343 # GCN-NEXT: S_CBRANCH_VCCNZ %bb.2, implicit $vcc
345 name: negated_cond_vop3_sel_subreg_overlap
348 %0:sgpr_32 = IMPLICIT_DEF
349 %1.sub2:vreg_128 = V_CNDMASK_B32_e64 0, 0, 0, 1, %0, implicit $exec
350 %1.sub2_sub3 = IMPLICIT_DEF
351 %2:sgpr_32 = V_CMP_NE_U32_e64 %1.sub2, 1, implicit $exec
352 $vcc_lo = S_AND_B32 killed %2, $exec_lo, implicit-def dead $scc
353 S_CBRANCH_VCCNZ %bb.2, implicit killed $vcc