• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RUN: llc -march=amdgcn -mcpu=gfx1010 -verify-machineinstrs -run-pass=si-optimize-exec-masking-pre-ra -o - %s | FileCheck -check-prefix=GCN %s
2
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 dead $scc
6# GCN-NEXT: S_CBRANCH_VCCNZ %bb.2, implicit $vcc
7---
8name:            negated_cond_vop2
9body:             |
10  bb.0:
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
16    S_BRANCH %bb.1
17
18  bb.1:
19    S_BRANCH %bb.0
20
21  bb.2:
22    S_ENDPGM 0
23...
24
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 dead $scc
28# GCN-NEXT: S_CBRANCH_VCCNZ %bb.2, implicit $vcc
29---
30name:            negated_cond_vop3
31body:             |
32  bb.0:
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
38    S_BRANCH %bb.1
39
40  bb.1:
41    S_BRANCH %bb.0
42
43  bb.2:
44    S_ENDPGM 0
45...
46
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
54---
55name:            negated_cond_vop2_redef_vcc1
56body:             |
57  bb.0:
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
61    $vcc_lo = COPY $sgpr0
62    $vcc_lo = S_AND_B32 $exec_lo, killed $vcc_lo, implicit-def dead $scc
63    S_CBRANCH_VCCNZ %bb.2, implicit killed $vcc
64    S_BRANCH %bb.1
65
66  bb.1:
67    S_BRANCH %bb.0
68
69  bb.2:
70    S_ENDPGM 0
71...
72
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
80---
81name:            negated_cond_vop3_redef_cmp
82body:             |
83  bb.0:
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
87    %2 = COPY $sgpr0
88    $vcc_lo = S_AND_B32 killed %2, $exec_lo, implicit-def dead $scc
89    S_CBRANCH_VCCNZ %bb.2, implicit killed $vcc
90    S_BRANCH %bb.1
91
92  bb.1:
93    S_BRANCH %bb.0
94
95  bb.2:
96    S_ENDPGM 0
97...
98
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
102---
103name:            negated_cond_undef_vcc
104body:             |
105  bb.0:
106    $vcc_lo = S_AND_B32 $exec_lo, undef $vcc_lo, implicit-def dead $scc
107    S_CBRANCH_VCCNZ %bb.2, implicit killed $vcc
108    S_BRANCH %bb.1
109
110  bb.1:
111    S_BRANCH %bb.0
112
113  bb.2:
114    S_ENDPGM 0
115...
116
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 dead $scc
120# GCN-NEXT: S_CBRANCH_VCCNZ %bb.2, implicit $vcc
121---
122name:            negated_cond_vop3_imp_vcc
123body:             |
124  bb.0:
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
130    S_BRANCH %bb.1
131
132  bb.1:
133    S_BRANCH %bb.0
134
135  bb.2:
136    S_ENDPGM 0
137...
138
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 dead $scc
142# GCN-NEXT: S_CBRANCH_VCCNZ %bb.2, implicit $vcc
143---
144name:            negated_cond_vop2_imp_vcc
145body:             |
146  bb.0:
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
152    S_BRANCH %bb.1
153
154  bb.1:
155    S_BRANCH %bb.0
156
157  bb.2:
158    S_ENDPGM 0
159...
160
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
168---
169name:            negated_cond_vop3_redef_sel
170body:             |
171  bb.0:
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
178    S_BRANCH %bb.1
179
180  bb.1:
181    S_BRANCH %bb.0
182
183  bb.2:
184    S_ENDPGM 0
185...
186
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 dead $scc
191# GCN-NEXT: S_CBRANCH_VCCNZ %bb.2, implicit $vcc
192---
193name:            negated_cond_vop2_used_sel
194body:             |
195  bb.0:
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
201    S_BRANCH %bb.1
202
203  bb.1:
204    S_BRANCH %bb.0
205
206  bb.2:
207    $vgpr0 = COPY %1
208    S_ENDPGM 0
209...
210
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 dead $scc
217# GCN-NEXT: S_CBRANCH_VCCNZ %bb.2, implicit $vcc
218---
219name:            negated_cond_vop2_used_vcc
220body:             |
221  bb.0:
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
228    S_BRANCH %bb.1
229
230  bb.1:
231    S_BRANCH %bb.0
232
233  bb.2:
234    S_ENDPGM 0
235...
236
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
244---
245name:            negated_cond_vop3_sel_wrong_subreg1
246body:             |
247  bb.0:
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
254    S_BRANCH %bb.1
255
256  bb.1:
257    S_BRANCH %bb.0
258
259  bb.2:
260    S_ENDPGM 0
261...
262
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
270---
271name:            negated_cond_vop3_sel_wrong_subreg2
272body:             |
273  bb.0:
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
280    S_BRANCH %bb.1
281
282  bb.1:
283    S_BRANCH %bb.0
284
285  bb.2:
286    S_ENDPGM 0
287...
288
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 dead $scc
293# GCN-NEXT: S_CBRANCH_VCCNZ %bb.2, implicit $vcc
294---
295name:            negated_cond_vop3_sel_right_subreg1
296body:             |
297  bb.0:
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
304    S_BRANCH %bb.1
305
306  bb.1:
307    S_BRANCH %bb.0
308
309  bb.2:
310    S_ENDPGM 0
311...
312
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 dead $scc
317# GCN-NEXT: S_CBRANCH_VCCNZ %bb.2, implicit $vcc
318---
319name:            negated_cond_vop3_sel_right_subreg2
320body:             |
321  bb.0:
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
328    S_BRANCH %bb.1
329
330  bb.1:
331    S_BRANCH %bb.0
332
333  bb.2:
334    S_ENDPGM 0
335...
336
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
344---
345name:            negated_cond_vop3_sel_subreg_overlap
346body:             |
347  bb.0:
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
354    S_BRANCH %bb.1
355
356  bb.1:
357    S_BRANCH %bb.0
358
359  bb.2:
360    S_ENDPGM 0
361...
362