1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn -mcpu=gfx908 -run-pass=amdgpu-regbankselect -regbankselect-fast -verify-machineinstrs -o - %s | FileCheck -check-prefix=FAST %s
3 # RUN: llc -mtriple=amdgcn -mcpu=gfx908 -run-pass=amdgpu-regbankselect -regbankselect-greedy -verify-machineinstrs -o - %s | FileCheck -check-prefix=GREEDY %s
6 name: phi_s32_ss_sbranch
8 tracksRegLiveness: true
11 ; FAST-LABEL: name: phi_s32_ss_sbranch
13 ; FAST-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
14 ; FAST-NEXT: liveins: $sgpr0, $sgpr1, $sgpr2
16 ; FAST-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
17 ; FAST-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
18 ; FAST-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr2
19 ; FAST-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
20 ; FAST-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
21 ; FAST-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
22 ; FAST-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s1)
23 ; FAST-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
24 ; FAST-NEXT: G_BR %bb.2
27 ; FAST-NEXT: successors: %bb.2(0x80000000)
29 ; FAST-NEXT: [[COPY3:%[0-9]+]]:sgpr(s32) = COPY [[COPY1]](s32)
30 ; FAST-NEXT: G_BR %bb.2
33 ; FAST-NEXT: [[PHI:%[0-9]+]]:sgpr(s32) = G_PHI [[COPY]](s32), %bb.0, [[COPY3]](s32), %bb.1
34 ; FAST-NEXT: $sgpr0 = COPY [[PHI]](s32)
35 ; FAST-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31
36 ; GREEDY-LABEL: name: phi_s32_ss_sbranch
38 ; GREEDY-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
39 ; GREEDY-NEXT: liveins: $sgpr0, $sgpr1, $sgpr2
41 ; GREEDY-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
42 ; GREEDY-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
43 ; GREEDY-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr2
44 ; GREEDY-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
45 ; GREEDY-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
46 ; GREEDY-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
47 ; GREEDY-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s1)
48 ; GREEDY-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
49 ; GREEDY-NEXT: G_BR %bb.2
52 ; GREEDY-NEXT: successors: %bb.2(0x80000000)
54 ; GREEDY-NEXT: [[COPY3:%[0-9]+]]:sgpr(s32) = COPY [[COPY1]](s32)
55 ; GREEDY-NEXT: G_BR %bb.2
58 ; GREEDY-NEXT: [[PHI:%[0-9]+]]:sgpr(s32) = G_PHI [[COPY]](s32), %bb.0, [[COPY3]](s32), %bb.1
59 ; GREEDY-NEXT: $sgpr0 = COPY [[PHI]](s32)
60 ; GREEDY-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31
62 successors: %bb.1, %bb.2
63 liveins: $sgpr0, $sgpr1, $sgpr2
65 %0:_(s32) = COPY $sgpr0
66 %1:_(s32) = COPY $sgpr1
67 %2:_(s32) = COPY $sgpr2
68 %3:_(s32) = G_CONSTANT i32 0
69 %4:_(s1) = G_ICMP intpred(eq), %2, %3
80 %6:_(s32) = G_PHI %0, %bb.0, %5, %bb.1
82 S_SETPC_B64 undef $sgpr30_sgpr31
87 name: phi_s32_sv_sbranch
89 tracksRegLiveness: true
92 ; FAST-LABEL: name: phi_s32_sv_sbranch
94 ; FAST-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
95 ; FAST-NEXT: liveins: $sgpr0, $vgpr0, $sgpr1
97 ; FAST-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
98 ; FAST-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
99 ; FAST-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
100 ; FAST-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
101 ; FAST-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
102 ; FAST-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
103 ; FAST-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s1)
104 ; FAST-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
105 ; FAST-NEXT: G_BR %bb.2
108 ; FAST-NEXT: successors: %bb.2(0x80000000)
110 ; FAST-NEXT: [[COPY3:%[0-9]+]]:vgpr(s32) = COPY [[COPY1]](s32)
111 ; FAST-NEXT: G_BR %bb.2
114 ; FAST-NEXT: [[PHI:%[0-9]+]]:vgpr(s32) = G_PHI [[COPY]](s32), %bb.0, [[COPY3]](s32), %bb.1
115 ; FAST-NEXT: $vgpr0 = COPY [[PHI]](s32)
116 ; FAST-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31
117 ; GREEDY-LABEL: name: phi_s32_sv_sbranch
119 ; GREEDY-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
120 ; GREEDY-NEXT: liveins: $sgpr0, $vgpr0, $sgpr1
121 ; GREEDY-NEXT: {{ $}}
122 ; GREEDY-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
123 ; GREEDY-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
124 ; GREEDY-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
125 ; GREEDY-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
126 ; GREEDY-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
127 ; GREEDY-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
128 ; GREEDY-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s1)
129 ; GREEDY-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
130 ; GREEDY-NEXT: G_BR %bb.2
131 ; GREEDY-NEXT: {{ $}}
133 ; GREEDY-NEXT: successors: %bb.2(0x80000000)
134 ; GREEDY-NEXT: {{ $}}
135 ; GREEDY-NEXT: [[COPY3:%[0-9]+]]:vgpr(s32) = COPY [[COPY1]](s32)
136 ; GREEDY-NEXT: G_BR %bb.2
137 ; GREEDY-NEXT: {{ $}}
139 ; GREEDY-NEXT: [[PHI:%[0-9]+]]:vgpr(s32) = G_PHI [[COPY]](s32), %bb.0, [[COPY3]](s32), %bb.1
140 ; GREEDY-NEXT: $vgpr0 = COPY [[PHI]](s32)
141 ; GREEDY-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31
143 successors: %bb.1, %bb.2
144 liveins: $sgpr0, $vgpr0, $sgpr1
146 %0:_(s32) = COPY $sgpr0
147 %1:_(s32) = COPY $vgpr0
148 %2:_(s32) = COPY $sgpr1
149 %3:_(s32) = G_CONSTANT i32 0
150 %4:_(s1) = G_ICMP intpred(eq), %2, %3
161 %6:_(s32) = G_PHI %0, %bb.0, %5, %bb.1
163 S_SETPC_B64 undef $sgpr30_sgpr31
168 name: phi_s32_vs_sbranch
170 tracksRegLiveness: true
173 ; FAST-LABEL: name: phi_s32_vs_sbranch
175 ; FAST-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
176 ; FAST-NEXT: liveins: $vgpr0, $sgpr0, $sgpr1
178 ; FAST-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
179 ; FAST-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
180 ; FAST-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
181 ; FAST-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
182 ; FAST-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
183 ; FAST-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
184 ; FAST-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s1)
185 ; FAST-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
186 ; FAST-NEXT: G_BR %bb.2
189 ; FAST-NEXT: successors: %bb.2(0x80000000)
191 ; FAST-NEXT: [[COPY3:%[0-9]+]]:sgpr(s32) = COPY [[COPY1]](s32)
192 ; FAST-NEXT: G_BR %bb.2
195 ; FAST-NEXT: [[PHI:%[0-9]+]]:vgpr(s32) = G_PHI [[COPY]](s32), %bb.0, [[COPY3]](s32), %bb.1
196 ; FAST-NEXT: $vgpr0 = COPY [[PHI]](s32)
197 ; FAST-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31
198 ; GREEDY-LABEL: name: phi_s32_vs_sbranch
200 ; GREEDY-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
201 ; GREEDY-NEXT: liveins: $vgpr0, $sgpr0, $sgpr1
202 ; GREEDY-NEXT: {{ $}}
203 ; GREEDY-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
204 ; GREEDY-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
205 ; GREEDY-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
206 ; GREEDY-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
207 ; GREEDY-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
208 ; GREEDY-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
209 ; GREEDY-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s1)
210 ; GREEDY-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
211 ; GREEDY-NEXT: G_BR %bb.2
212 ; GREEDY-NEXT: {{ $}}
214 ; GREEDY-NEXT: successors: %bb.2(0x80000000)
215 ; GREEDY-NEXT: {{ $}}
216 ; GREEDY-NEXT: [[COPY3:%[0-9]+]]:sgpr(s32) = COPY [[COPY1]](s32)
217 ; GREEDY-NEXT: G_BR %bb.2
218 ; GREEDY-NEXT: {{ $}}
220 ; GREEDY-NEXT: [[PHI:%[0-9]+]]:vgpr(s32) = G_PHI [[COPY]](s32), %bb.0, [[COPY3]](s32), %bb.1
221 ; GREEDY-NEXT: $vgpr0 = COPY [[PHI]](s32)
222 ; GREEDY-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31
224 successors: %bb.1, %bb.2
225 liveins: $vgpr0, $sgpr0, $sgpr1
227 %0:_(s32) = COPY $vgpr0
228 %1:_(s32) = COPY $sgpr0
229 %2:_(s32) = COPY $sgpr1
230 %3:_(s32) = G_CONSTANT i32 0
231 %4:_(s1) = G_ICMP intpred(eq), %2, %3
242 %6:_(s32) = G_PHI %0, %bb.0, %5, %bb.1
244 S_SETPC_B64 undef $sgpr30_sgpr31
249 name: phi_s32_vv_sbranch
251 tracksRegLiveness: true
254 ; FAST-LABEL: name: phi_s32_vv_sbranch
256 ; FAST-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
257 ; FAST-NEXT: liveins: $vgpr0, $vgpr1, $sgpr0
259 ; FAST-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
260 ; FAST-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
261 ; FAST-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
262 ; FAST-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
263 ; FAST-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
264 ; FAST-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
265 ; FAST-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s1)
266 ; FAST-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
267 ; FAST-NEXT: G_BR %bb.2
270 ; FAST-NEXT: successors: %bb.2(0x80000000)
272 ; FAST-NEXT: [[COPY3:%[0-9]+]]:vgpr(s32) = COPY [[COPY1]](s32)
273 ; FAST-NEXT: G_BR %bb.2
276 ; FAST-NEXT: [[PHI:%[0-9]+]]:vgpr(s32) = G_PHI [[COPY]](s32), %bb.0, [[COPY3]](s32), %bb.1
277 ; FAST-NEXT: $vgpr0 = COPY [[PHI]](s32)
278 ; FAST-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31
279 ; GREEDY-LABEL: name: phi_s32_vv_sbranch
281 ; GREEDY-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
282 ; GREEDY-NEXT: liveins: $vgpr0, $vgpr1, $sgpr0
283 ; GREEDY-NEXT: {{ $}}
284 ; GREEDY-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
285 ; GREEDY-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
286 ; GREEDY-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
287 ; GREEDY-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
288 ; GREEDY-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
289 ; GREEDY-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
290 ; GREEDY-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s1)
291 ; GREEDY-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
292 ; GREEDY-NEXT: G_BR %bb.2
293 ; GREEDY-NEXT: {{ $}}
295 ; GREEDY-NEXT: successors: %bb.2(0x80000000)
296 ; GREEDY-NEXT: {{ $}}
297 ; GREEDY-NEXT: [[COPY3:%[0-9]+]]:vgpr(s32) = COPY [[COPY1]](s32)
298 ; GREEDY-NEXT: G_BR %bb.2
299 ; GREEDY-NEXT: {{ $}}
301 ; GREEDY-NEXT: [[PHI:%[0-9]+]]:vgpr(s32) = G_PHI [[COPY]](s32), %bb.0, [[COPY3]](s32), %bb.1
302 ; GREEDY-NEXT: $vgpr0 = COPY [[PHI]](s32)
303 ; GREEDY-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31
305 successors: %bb.1, %bb.2
306 liveins: $vgpr0, $vgpr1, $sgpr0
308 %0:_(s32) = COPY $vgpr0
309 %1:_(s32) = COPY $vgpr1
310 %2:_(s32) = COPY $sgpr0
311 %3:_(s32) = G_CONSTANT i32 0
312 %4:_(s1) = G_ICMP intpred(eq), %2, %3
323 %6:_(s32) = G_PHI %0, %bb.0, %5, %bb.1
325 S_SETPC_B64 undef $sgpr30_sgpr31
329 name: phi_s32_ss_vcc_sbranch
331 tracksRegLiveness: true
334 ; FAST-LABEL: name: phi_s32_ss_vcc_sbranch
336 ; FAST-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
337 ; FAST-NEXT: liveins: $sgpr0, $sgpr1, $vgpr0
339 ; FAST-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
340 ; FAST-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
341 ; FAST-NEXT: [[COPY2:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
342 ; FAST-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
343 ; FAST-NEXT: [[COPY3:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
344 ; FAST-NEXT: [[ICMP:%[0-9]+]]:vcc(s1) = G_ICMP intpred(eq), [[COPY2]](s32), [[COPY3]]
345 ; FAST-NEXT: G_BRCOND [[ICMP]](s1), %bb.1
346 ; FAST-NEXT: G_BR %bb.2
349 ; FAST-NEXT: successors: %bb.2(0x80000000)
351 ; FAST-NEXT: [[COPY4:%[0-9]+]]:sgpr(s32) = COPY [[COPY1]](s32)
352 ; FAST-NEXT: G_BR %bb.2
355 ; FAST-NEXT: [[PHI:%[0-9]+]]:sgpr(s32) = G_PHI [[COPY]](s32), %bb.0, [[COPY4]](s32), %bb.1
356 ; FAST-NEXT: $sgpr0 = COPY [[PHI]](s32)
357 ; FAST-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31
358 ; GREEDY-LABEL: name: phi_s32_ss_vcc_sbranch
360 ; GREEDY-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
361 ; GREEDY-NEXT: liveins: $sgpr0, $sgpr1, $vgpr0
362 ; GREEDY-NEXT: {{ $}}
363 ; GREEDY-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
364 ; GREEDY-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
365 ; GREEDY-NEXT: [[COPY2:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
366 ; GREEDY-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
367 ; GREEDY-NEXT: [[COPY3:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
368 ; GREEDY-NEXT: [[ICMP:%[0-9]+]]:vcc(s1) = G_ICMP intpred(eq), [[COPY2]](s32), [[COPY3]]
369 ; GREEDY-NEXT: G_BRCOND [[ICMP]](s1), %bb.1
370 ; GREEDY-NEXT: G_BR %bb.2
371 ; GREEDY-NEXT: {{ $}}
373 ; GREEDY-NEXT: successors: %bb.2(0x80000000)
374 ; GREEDY-NEXT: {{ $}}
375 ; GREEDY-NEXT: [[COPY4:%[0-9]+]]:sgpr(s32) = COPY [[COPY1]](s32)
376 ; GREEDY-NEXT: G_BR %bb.2
377 ; GREEDY-NEXT: {{ $}}
379 ; GREEDY-NEXT: [[PHI:%[0-9]+]]:sgpr(s32) = G_PHI [[COPY]](s32), %bb.0, [[COPY4]](s32), %bb.1
380 ; GREEDY-NEXT: $sgpr0 = COPY [[PHI]](s32)
381 ; GREEDY-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31
383 successors: %bb.1, %bb.2
384 liveins: $sgpr0, $sgpr1, $vgpr0
386 %0:_(s32) = COPY $sgpr0
387 %1:_(s32) = COPY $sgpr1
388 %2:_(s32) = COPY $vgpr0
389 %3:_(s32) = G_CONSTANT i32 0
390 %4:_(s1) = G_ICMP intpred(eq), %2, %3
401 %6:_(s32) = G_PHI %0, %bb.0, %5, %bb.1
403 S_SETPC_B64 undef $sgpr30_sgpr31
408 name: phi_s32_sv_vcc_sbranch
410 tracksRegLiveness: true
413 ; FAST-LABEL: name: phi_s32_sv_vcc_sbranch
415 ; FAST-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
416 ; FAST-NEXT: liveins: $sgpr0, $vgpr0, $vgpr1
418 ; FAST-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
419 ; FAST-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
420 ; FAST-NEXT: [[COPY2:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
421 ; FAST-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
422 ; FAST-NEXT: [[COPY3:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
423 ; FAST-NEXT: [[ICMP:%[0-9]+]]:vcc(s1) = G_ICMP intpred(eq), [[COPY2]](s32), [[COPY3]]
424 ; FAST-NEXT: G_BRCOND [[ICMP]](s1), %bb.1
425 ; FAST-NEXT: G_BR %bb.2
428 ; FAST-NEXT: successors: %bb.2(0x80000000)
430 ; FAST-NEXT: [[COPY4:%[0-9]+]]:vgpr(s32) = COPY [[COPY1]](s32)
431 ; FAST-NEXT: G_BR %bb.2
434 ; FAST-NEXT: [[PHI:%[0-9]+]]:vgpr(s32) = G_PHI [[COPY]](s32), %bb.0, [[COPY4]](s32), %bb.1
435 ; FAST-NEXT: $vgpr0 = COPY [[PHI]](s32)
436 ; FAST-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31
437 ; GREEDY-LABEL: name: phi_s32_sv_vcc_sbranch
439 ; GREEDY-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
440 ; GREEDY-NEXT: liveins: $sgpr0, $vgpr0, $vgpr1
441 ; GREEDY-NEXT: {{ $}}
442 ; GREEDY-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
443 ; GREEDY-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
444 ; GREEDY-NEXT: [[COPY2:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
445 ; GREEDY-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
446 ; GREEDY-NEXT: [[COPY3:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
447 ; GREEDY-NEXT: [[ICMP:%[0-9]+]]:vcc(s1) = G_ICMP intpred(eq), [[COPY2]](s32), [[COPY3]]
448 ; GREEDY-NEXT: G_BRCOND [[ICMP]](s1), %bb.1
449 ; GREEDY-NEXT: G_BR %bb.2
450 ; GREEDY-NEXT: {{ $}}
452 ; GREEDY-NEXT: successors: %bb.2(0x80000000)
453 ; GREEDY-NEXT: {{ $}}
454 ; GREEDY-NEXT: [[COPY4:%[0-9]+]]:vgpr(s32) = COPY [[COPY1]](s32)
455 ; GREEDY-NEXT: G_BR %bb.2
456 ; GREEDY-NEXT: {{ $}}
458 ; GREEDY-NEXT: [[PHI:%[0-9]+]]:vgpr(s32) = G_PHI [[COPY]](s32), %bb.0, [[COPY4]](s32), %bb.1
459 ; GREEDY-NEXT: $vgpr0 = COPY [[PHI]](s32)
460 ; GREEDY-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31
462 successors: %bb.1, %bb.2
463 liveins: $sgpr0, $vgpr0, $vgpr1
465 %0:_(s32) = COPY $sgpr0
466 %1:_(s32) = COPY $vgpr0
467 %2:_(s32) = COPY $vgpr1
468 %3:_(s32) = G_CONSTANT i32 0
469 %4:_(s1) = G_ICMP intpred(eq), %2, %3
480 %6:_(s32) = G_PHI %0, %bb.0, %5, %bb.1
482 S_SETPC_B64 undef $sgpr30_sgpr31
487 name: phi_s32_vs_vcc_sbranch
489 tracksRegLiveness: true
492 ; FAST-LABEL: name: phi_s32_vs_vcc_sbranch
494 ; FAST-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
495 ; FAST-NEXT: liveins: $vgpr0, $sgpr0, $vgpr1
497 ; FAST-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
498 ; FAST-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
499 ; FAST-NEXT: [[COPY2:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
500 ; FAST-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
501 ; FAST-NEXT: [[COPY3:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
502 ; FAST-NEXT: [[ICMP:%[0-9]+]]:vcc(s1) = G_ICMP intpred(eq), [[COPY2]](s32), [[COPY3]]
503 ; FAST-NEXT: G_BRCOND [[ICMP]](s1), %bb.1
504 ; FAST-NEXT: G_BR %bb.2
507 ; FAST-NEXT: successors: %bb.2(0x80000000)
509 ; FAST-NEXT: [[COPY4:%[0-9]+]]:sgpr(s32) = COPY [[COPY1]](s32)
510 ; FAST-NEXT: G_BR %bb.2
513 ; FAST-NEXT: [[PHI:%[0-9]+]]:vgpr(s32) = G_PHI [[COPY]](s32), %bb.0, [[COPY4]](s32), %bb.1
514 ; FAST-NEXT: $vgpr0 = COPY [[PHI]](s32)
515 ; FAST-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31
516 ; GREEDY-LABEL: name: phi_s32_vs_vcc_sbranch
518 ; GREEDY-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
519 ; GREEDY-NEXT: liveins: $vgpr0, $sgpr0, $vgpr1
520 ; GREEDY-NEXT: {{ $}}
521 ; GREEDY-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
522 ; GREEDY-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
523 ; GREEDY-NEXT: [[COPY2:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
524 ; GREEDY-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
525 ; GREEDY-NEXT: [[COPY3:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
526 ; GREEDY-NEXT: [[ICMP:%[0-9]+]]:vcc(s1) = G_ICMP intpred(eq), [[COPY2]](s32), [[COPY3]]
527 ; GREEDY-NEXT: G_BRCOND [[ICMP]](s1), %bb.1
528 ; GREEDY-NEXT: G_BR %bb.2
529 ; GREEDY-NEXT: {{ $}}
531 ; GREEDY-NEXT: successors: %bb.2(0x80000000)
532 ; GREEDY-NEXT: {{ $}}
533 ; GREEDY-NEXT: [[COPY4:%[0-9]+]]:sgpr(s32) = COPY [[COPY1]](s32)
534 ; GREEDY-NEXT: G_BR %bb.2
535 ; GREEDY-NEXT: {{ $}}
537 ; GREEDY-NEXT: [[PHI:%[0-9]+]]:vgpr(s32) = G_PHI [[COPY]](s32), %bb.0, [[COPY4]](s32), %bb.1
538 ; GREEDY-NEXT: $vgpr0 = COPY [[PHI]](s32)
539 ; GREEDY-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31
541 successors: %bb.1, %bb.2
542 liveins: $vgpr0, $sgpr0, $vgpr1
544 %0:_(s32) = COPY $vgpr0
545 %1:_(s32) = COPY $sgpr0
546 %2:_(s32) = COPY $vgpr1
547 %3:_(s32) = G_CONSTANT i32 0
548 %4:_(s1) = G_ICMP intpred(eq), %2, %3
559 %6:_(s32) = G_PHI %0, %bb.0, %5, %bb.1
561 S_SETPC_B64 undef $sgpr30_sgpr31
566 name: phi_s32_vv_vcc_sbranch
568 tracksRegLiveness: true
571 ; FAST-LABEL: name: phi_s32_vv_vcc_sbranch
573 ; FAST-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
574 ; FAST-NEXT: liveins: $vgpr0, $vgpr1, $vgpr2
576 ; FAST-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
577 ; FAST-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
578 ; FAST-NEXT: [[COPY2:%[0-9]+]]:vgpr(s32) = COPY $vgpr2
579 ; FAST-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
580 ; FAST-NEXT: [[COPY3:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
581 ; FAST-NEXT: [[ICMP:%[0-9]+]]:vcc(s1) = G_ICMP intpred(eq), [[COPY2]](s32), [[COPY3]]
582 ; FAST-NEXT: G_BRCOND [[ICMP]](s1), %bb.1
583 ; FAST-NEXT: G_BR %bb.2
586 ; FAST-NEXT: successors: %bb.2(0x80000000)
588 ; FAST-NEXT: [[COPY4:%[0-9]+]]:vgpr(s32) = COPY [[COPY1]](s32)
589 ; FAST-NEXT: G_BR %bb.2
592 ; FAST-NEXT: [[PHI:%[0-9]+]]:vgpr(s32) = G_PHI [[COPY]](s32), %bb.0, [[COPY4]](s32), %bb.1
593 ; FAST-NEXT: $vgpr0 = COPY [[PHI]](s32)
594 ; FAST-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31
595 ; GREEDY-LABEL: name: phi_s32_vv_vcc_sbranch
597 ; GREEDY-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
598 ; GREEDY-NEXT: liveins: $vgpr0, $vgpr1, $vgpr2
599 ; GREEDY-NEXT: {{ $}}
600 ; GREEDY-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
601 ; GREEDY-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
602 ; GREEDY-NEXT: [[COPY2:%[0-9]+]]:vgpr(s32) = COPY $vgpr2
603 ; GREEDY-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
604 ; GREEDY-NEXT: [[COPY3:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
605 ; GREEDY-NEXT: [[ICMP:%[0-9]+]]:vcc(s1) = G_ICMP intpred(eq), [[COPY2]](s32), [[COPY3]]
606 ; GREEDY-NEXT: G_BRCOND [[ICMP]](s1), %bb.1
607 ; GREEDY-NEXT: G_BR %bb.2
608 ; GREEDY-NEXT: {{ $}}
610 ; GREEDY-NEXT: successors: %bb.2(0x80000000)
611 ; GREEDY-NEXT: {{ $}}
612 ; GREEDY-NEXT: [[COPY4:%[0-9]+]]:vgpr(s32) = COPY [[COPY1]](s32)
613 ; GREEDY-NEXT: G_BR %bb.2
614 ; GREEDY-NEXT: {{ $}}
616 ; GREEDY-NEXT: [[PHI:%[0-9]+]]:vgpr(s32) = G_PHI [[COPY]](s32), %bb.0, [[COPY4]](s32), %bb.1
617 ; GREEDY-NEXT: $vgpr0 = COPY [[PHI]](s32)
618 ; GREEDY-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31
620 successors: %bb.1, %bb.2
621 liveins: $vgpr0, $vgpr1, $vgpr2
623 %0:_(s32) = COPY $vgpr0
624 %1:_(s32) = COPY $vgpr1
625 %2:_(s32) = COPY $vgpr2
626 %3:_(s32) = G_CONSTANT i32 0
627 %4:_(s1) = G_ICMP intpred(eq), %2, %3
638 %6:_(s32) = G_PHI %0, %bb.0, %5, %bb.1
640 S_SETPC_B64 undef $sgpr30_sgpr31
645 name: phi_s1_scc_scc_sbranch
647 tracksRegLiveness: true
650 ; FAST-LABEL: name: phi_s1_scc_scc_sbranch
652 ; FAST-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
653 ; FAST-NEXT: liveins: $sgpr0, $sgpr1, $sgpr2
655 ; FAST-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
656 ; FAST-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
657 ; FAST-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr2
658 ; FAST-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
659 ; FAST-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY]](s32), [[C]]
660 ; FAST-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
661 ; FAST-NEXT: [[ICMP1:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
662 ; FAST-NEXT: [[TRUNC1:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP1]](s32)
663 ; FAST-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC1]](s1)
664 ; FAST-NEXT: [[ANYEXT:%[0-9]+]]:sgpr(s32) = G_ANYEXT [[TRUNC]](s1)
665 ; FAST-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
666 ; FAST-NEXT: G_BR %bb.2
669 ; FAST-NEXT: successors: %bb.2(0x80000000)
671 ; FAST-NEXT: [[ICMP2:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY1]](s32), [[C]]
672 ; FAST-NEXT: [[TRUNC2:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP2]](s32)
673 ; FAST-NEXT: [[ANYEXT1:%[0-9]+]]:sgpr(s32) = G_ANYEXT [[TRUNC2]](s1)
674 ; FAST-NEXT: G_BR %bb.2
677 ; FAST-NEXT: [[PHI:%[0-9]+]]:sgpr(s32) = G_PHI [[ANYEXT]](s32), %bb.0, [[ANYEXT1]](s32), %bb.1
678 ; FAST-NEXT: [[TRUNC3:%[0-9]+]]:sgpr(s1) = G_TRUNC [[PHI]](s32)
679 ; FAST-NEXT: [[ZEXT1:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC3]](s1)
680 ; FAST-NEXT: [[SELECT:%[0-9]+]]:sgpr(s32) = G_SELECT [[ZEXT1]](s32), [[C]], [[COPY]]
681 ; FAST-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31, implicit [[SELECT]](s32)
682 ; GREEDY-LABEL: name: phi_s1_scc_scc_sbranch
684 ; GREEDY-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
685 ; GREEDY-NEXT: liveins: $sgpr0, $sgpr1, $sgpr2
686 ; GREEDY-NEXT: {{ $}}
687 ; GREEDY-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
688 ; GREEDY-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
689 ; GREEDY-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr2
690 ; GREEDY-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
691 ; GREEDY-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY]](s32), [[C]]
692 ; GREEDY-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
693 ; GREEDY-NEXT: [[ICMP1:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
694 ; GREEDY-NEXT: [[TRUNC1:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP1]](s32)
695 ; GREEDY-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC1]](s1)
696 ; GREEDY-NEXT: [[ANYEXT:%[0-9]+]]:sgpr(s32) = G_ANYEXT [[TRUNC]](s1)
697 ; GREEDY-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
698 ; GREEDY-NEXT: G_BR %bb.2
699 ; GREEDY-NEXT: {{ $}}
701 ; GREEDY-NEXT: successors: %bb.2(0x80000000)
702 ; GREEDY-NEXT: {{ $}}
703 ; GREEDY-NEXT: [[ICMP2:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY1]](s32), [[C]]
704 ; GREEDY-NEXT: [[TRUNC2:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP2]](s32)
705 ; GREEDY-NEXT: [[ANYEXT1:%[0-9]+]]:sgpr(s32) = G_ANYEXT [[TRUNC2]](s1)
706 ; GREEDY-NEXT: G_BR %bb.2
707 ; GREEDY-NEXT: {{ $}}
709 ; GREEDY-NEXT: [[PHI:%[0-9]+]]:sgpr(s32) = G_PHI [[ANYEXT]](s32), %bb.0, [[ANYEXT1]](s32), %bb.1
710 ; GREEDY-NEXT: [[TRUNC3:%[0-9]+]]:sgpr(s1) = G_TRUNC [[PHI]](s32)
711 ; GREEDY-NEXT: [[ZEXT1:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC3]](s1)
712 ; GREEDY-NEXT: [[SELECT:%[0-9]+]]:sgpr(s32) = G_SELECT [[ZEXT1]](s32), [[C]], [[COPY]]
713 ; GREEDY-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31, implicit [[SELECT]](s32)
715 successors: %bb.1, %bb.2
716 liveins: $sgpr0, $sgpr1, $sgpr2
718 %0:_(s32) = COPY $sgpr0
719 %1:_(s32) = COPY $sgpr1
720 %2:_(s32) = COPY $sgpr2
721 %3:_(s32) = G_CONSTANT i32 0
722 %4:_(s1) = G_ICMP intpred(eq), %0, %3
723 %5:_(s1) = G_ICMP intpred(eq), %2, %3
730 %6:_(s1) = G_ICMP intpred(eq), %1, %3
734 %7:_(s1) = G_PHI %4, %bb.0, %6, %bb.1
735 %8:_(s32) = G_SELECT %7, %3, %0
736 S_SETPC_B64 undef $sgpr30_sgpr31, implicit %8
741 name: phi_s1_scc_scc_scc_sbranch
743 tracksRegLiveness: true
746 ; FAST-LABEL: name: phi_s1_scc_scc_scc_sbranch
748 ; FAST-NEXT: successors: %bb.1(0x40000000), %bb.3(0x40000000)
749 ; FAST-NEXT: liveins: $sgpr0, $sgpr1, $sgpr2, $sgpr3
751 ; FAST-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
752 ; FAST-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
753 ; FAST-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr2
754 ; FAST-NEXT: [[COPY3:%[0-9]+]]:sgpr(s32) = COPY $sgpr3
755 ; FAST-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
756 ; FAST-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY3]]
757 ; FAST-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
758 ; FAST-NEXT: [[ICMP1:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[COPY3]]
759 ; FAST-NEXT: [[TRUNC1:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP1]](s32)
760 ; FAST-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC1]](s1)
761 ; FAST-NEXT: [[ANYEXT:%[0-9]+]]:sgpr(s32) = G_ANYEXT [[TRUNC]](s1)
762 ; FAST-NEXT: G_BRCOND [[ZEXT]](s32), %bb.3
763 ; FAST-NEXT: G_BR %bb.1
766 ; FAST-NEXT: successors: %bb.2(0x40000000), %bb.3(0x40000000)
768 ; FAST-NEXT: [[C1:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 99
769 ; FAST-NEXT: [[C2:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 888
770 ; FAST-NEXT: [[ICMP2:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY1]](s32), [[C1]]
771 ; FAST-NEXT: [[TRUNC2:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP2]](s32)
772 ; FAST-NEXT: [[ICMP3:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY1]](s32), [[C2]]
773 ; FAST-NEXT: [[TRUNC3:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP3]](s32)
774 ; FAST-NEXT: [[ZEXT1:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC3]](s1)
775 ; FAST-NEXT: [[ANYEXT1:%[0-9]+]]:sgpr(s32) = G_ANYEXT [[TRUNC2]](s1)
776 ; FAST-NEXT: G_BRCOND [[ZEXT1]](s32), %bb.3
777 ; FAST-NEXT: G_BR %bb.2
780 ; FAST-NEXT: successors: %bb.3(0x80000000)
782 ; FAST-NEXT: [[C3:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 123
783 ; FAST-NEXT: [[ICMP4:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C3]]
784 ; FAST-NEXT: [[TRUNC4:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP4]](s32)
785 ; FAST-NEXT: [[ANYEXT2:%[0-9]+]]:sgpr(s32) = G_ANYEXT [[TRUNC4]](s1)
786 ; FAST-NEXT: G_BR %bb.3
789 ; FAST-NEXT: [[PHI:%[0-9]+]]:sgpr(s32) = G_PHI [[ANYEXT]](s32), %bb.0, [[ANYEXT1]](s32), %bb.1, [[ANYEXT2]](s32), %bb.2
790 ; FAST-NEXT: [[TRUNC5:%[0-9]+]]:sgpr(s1) = G_TRUNC [[PHI]](s32)
791 ; FAST-NEXT: [[ZEXT2:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC5]](s1)
792 ; FAST-NEXT: [[SELECT:%[0-9]+]]:sgpr(s32) = G_SELECT [[ZEXT2]](s32), [[COPY]], [[COPY1]]
793 ; FAST-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31, implicit [[SELECT]](s32)
794 ; GREEDY-LABEL: name: phi_s1_scc_scc_scc_sbranch
796 ; GREEDY-NEXT: successors: %bb.1(0x40000000), %bb.3(0x40000000)
797 ; GREEDY-NEXT: liveins: $sgpr0, $sgpr1, $sgpr2, $sgpr3
798 ; GREEDY-NEXT: {{ $}}
799 ; GREEDY-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
800 ; GREEDY-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
801 ; GREEDY-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr2
802 ; GREEDY-NEXT: [[COPY3:%[0-9]+]]:sgpr(s32) = COPY $sgpr3
803 ; GREEDY-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
804 ; GREEDY-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY3]]
805 ; GREEDY-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
806 ; GREEDY-NEXT: [[ICMP1:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[COPY3]]
807 ; GREEDY-NEXT: [[TRUNC1:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP1]](s32)
808 ; GREEDY-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC1]](s1)
809 ; GREEDY-NEXT: [[ANYEXT:%[0-9]+]]:sgpr(s32) = G_ANYEXT [[TRUNC]](s1)
810 ; GREEDY-NEXT: G_BRCOND [[ZEXT]](s32), %bb.3
811 ; GREEDY-NEXT: G_BR %bb.1
812 ; GREEDY-NEXT: {{ $}}
814 ; GREEDY-NEXT: successors: %bb.2(0x40000000), %bb.3(0x40000000)
815 ; GREEDY-NEXT: {{ $}}
816 ; GREEDY-NEXT: [[C1:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 99
817 ; GREEDY-NEXT: [[C2:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 888
818 ; GREEDY-NEXT: [[ICMP2:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY1]](s32), [[C1]]
819 ; GREEDY-NEXT: [[TRUNC2:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP2]](s32)
820 ; GREEDY-NEXT: [[ICMP3:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY1]](s32), [[C2]]
821 ; GREEDY-NEXT: [[TRUNC3:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP3]](s32)
822 ; GREEDY-NEXT: [[ZEXT1:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC3]](s1)
823 ; GREEDY-NEXT: [[ANYEXT1:%[0-9]+]]:sgpr(s32) = G_ANYEXT [[TRUNC2]](s1)
824 ; GREEDY-NEXT: G_BRCOND [[ZEXT1]](s32), %bb.3
825 ; GREEDY-NEXT: G_BR %bb.2
826 ; GREEDY-NEXT: {{ $}}
828 ; GREEDY-NEXT: successors: %bb.3(0x80000000)
829 ; GREEDY-NEXT: {{ $}}
830 ; GREEDY-NEXT: [[C3:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 123
831 ; GREEDY-NEXT: [[ICMP4:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C3]]
832 ; GREEDY-NEXT: [[TRUNC4:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP4]](s32)
833 ; GREEDY-NEXT: [[ANYEXT2:%[0-9]+]]:sgpr(s32) = G_ANYEXT [[TRUNC4]](s1)
834 ; GREEDY-NEXT: G_BR %bb.3
835 ; GREEDY-NEXT: {{ $}}
837 ; GREEDY-NEXT: [[PHI:%[0-9]+]]:sgpr(s32) = G_PHI [[ANYEXT]](s32), %bb.0, [[ANYEXT1]](s32), %bb.1, [[ANYEXT2]](s32), %bb.2
838 ; GREEDY-NEXT: [[TRUNC5:%[0-9]+]]:sgpr(s1) = G_TRUNC [[PHI]](s32)
839 ; GREEDY-NEXT: [[ZEXT2:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC5]](s1)
840 ; GREEDY-NEXT: [[SELECT:%[0-9]+]]:sgpr(s32) = G_SELECT [[ZEXT2]](s32), [[COPY]], [[COPY1]]
841 ; GREEDY-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31, implicit [[SELECT]](s32)
843 successors: %bb.1, %bb.3
844 liveins: $sgpr0, $sgpr1, $sgpr2, $sgpr3
846 %0:_(s32) = COPY $sgpr0
847 %1:_(s32) = COPY $sgpr1
848 %2:_(s32) = COPY $sgpr2
849 %3:_(s32) = COPY $sgpr3
850 %4:_(s32) = G_CONSTANT i32 0
851 %5:_(s1) = G_ICMP intpred(eq), %0, %3
852 %6:_(s1) = G_ICMP intpred(eq), %2, %3
857 successors: %bb.2, %bb.3
859 %7:_(s32) = G_CONSTANT i32 99
860 %8:_(s32) = G_CONSTANT i32 888
861 %9:_(s1) = G_ICMP intpred(eq), %1, %7
862 %10:_(s1) = G_ICMP intpred(eq), %1, %8
869 %11:_(s32) = G_CONSTANT i32 123
870 %12:_(s1) = G_ICMP intpred(eq), %2, %11
874 %13:_(s1) = G_PHI %5, %bb.0, %9, %bb.1, %12, %bb.2
875 %14:_(s32) = G_SELECT %13, %0, %1
876 S_SETPC_B64 undef $sgpr30_sgpr31, implicit %14
881 name: phi_s1_scc_vcc_sbranch
883 tracksRegLiveness: true
886 ; FAST-LABEL: name: phi_s1_scc_vcc_sbranch
888 ; FAST-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
889 ; FAST-NEXT: liveins: $sgpr0, $sgpr1, $vgpr0
891 ; FAST-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
892 ; FAST-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
893 ; FAST-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
894 ; FAST-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
895 ; FAST-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY]](s32), [[C]]
896 ; FAST-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
897 ; FAST-NEXT: [[ICMP1:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
898 ; FAST-NEXT: [[TRUNC1:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP1]](s32)
899 ; FAST-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC1]](s1)
900 ; FAST-NEXT: [[COPY3:%[0-9]+]]:vcc(s1) = COPY [[TRUNC]](s1)
901 ; FAST-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
902 ; FAST-NEXT: G_BR %bb.2
905 ; FAST-NEXT: successors: %bb.2(0x80000000)
907 ; FAST-NEXT: [[COPY4:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
908 ; FAST-NEXT: [[ICMP2:%[0-9]+]]:vcc(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[COPY4]]
909 ; FAST-NEXT: G_BR %bb.2
912 ; FAST-NEXT: [[PHI:%[0-9]+]]:vcc(s1) = G_PHI [[COPY3]](s1), %bb.0, [[ICMP2]](s1), %bb.1
913 ; FAST-NEXT: [[COPY5:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
914 ; FAST-NEXT: [[COPY6:%[0-9]+]]:vgpr(s32) = COPY [[COPY]](s32)
915 ; FAST-NEXT: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[PHI]](s1), [[COPY5]], [[COPY6]]
916 ; FAST-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31, implicit [[SELECT]](s32)
917 ; GREEDY-LABEL: name: phi_s1_scc_vcc_sbranch
919 ; GREEDY-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
920 ; GREEDY-NEXT: liveins: $sgpr0, $sgpr1, $vgpr0
921 ; GREEDY-NEXT: {{ $}}
922 ; GREEDY-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
923 ; GREEDY-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
924 ; GREEDY-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
925 ; GREEDY-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
926 ; GREEDY-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY]](s32), [[C]]
927 ; GREEDY-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
928 ; GREEDY-NEXT: [[ICMP1:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
929 ; GREEDY-NEXT: [[TRUNC1:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP1]](s32)
930 ; GREEDY-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC1]](s1)
931 ; GREEDY-NEXT: [[COPY3:%[0-9]+]]:vcc(s1) = COPY [[TRUNC]](s1)
932 ; GREEDY-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
933 ; GREEDY-NEXT: G_BR %bb.2
934 ; GREEDY-NEXT: {{ $}}
936 ; GREEDY-NEXT: successors: %bb.2(0x80000000)
937 ; GREEDY-NEXT: {{ $}}
938 ; GREEDY-NEXT: [[COPY4:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
939 ; GREEDY-NEXT: [[ICMP2:%[0-9]+]]:vcc(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[COPY4]]
940 ; GREEDY-NEXT: G_BR %bb.2
941 ; GREEDY-NEXT: {{ $}}
943 ; GREEDY-NEXT: [[PHI:%[0-9]+]]:vcc(s1) = G_PHI [[COPY3]](s1), %bb.0, [[ICMP2]](s1), %bb.1
944 ; GREEDY-NEXT: [[COPY5:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
945 ; GREEDY-NEXT: [[COPY6:%[0-9]+]]:vgpr(s32) = COPY [[COPY]](s32)
946 ; GREEDY-NEXT: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[PHI]](s1), [[COPY5]], [[COPY6]]
947 ; GREEDY-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31, implicit [[SELECT]](s32)
949 successors: %bb.1, %bb.2
950 liveins: $sgpr0, $sgpr1, $vgpr0
952 %0:_(s32) = COPY $sgpr0
953 %1:_(s32) = COPY $vgpr0
954 %2:_(s32) = COPY $sgpr1
955 %3:_(s32) = G_CONSTANT i32 0
956 %4:_(s1) = G_ICMP intpred(eq), %0, %3
957 %5:_(s1) = G_ICMP intpred(eq), %2, %3
964 %6:_(s1) = G_ICMP intpred(eq), %1, %3
968 %7:_(s1) = G_PHI %4, %bb.0, %6, %bb.1
969 %8:_(s32) = G_SELECT %7, %3, %0
970 S_SETPC_B64 undef $sgpr30_sgpr31, implicit %8
975 name: phi_s1_vcc_scc_sbranch
977 tracksRegLiveness: true
980 ; FAST-LABEL: name: phi_s1_vcc_scc_sbranch
982 ; FAST-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
983 ; FAST-NEXT: liveins: $vgpr0, $sgpr0, $sgpr1
985 ; FAST-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
986 ; FAST-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
987 ; FAST-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
988 ; FAST-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
989 ; FAST-NEXT: [[COPY3:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
990 ; FAST-NEXT: [[ICMP:%[0-9]+]]:vcc(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY3]]
991 ; FAST-NEXT: [[ICMP1:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
992 ; FAST-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP1]](s32)
993 ; FAST-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s1)
994 ; FAST-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
995 ; FAST-NEXT: G_BR %bb.2
998 ; FAST-NEXT: successors: %bb.2(0x80000000)
1000 ; FAST-NEXT: [[ICMP2:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY1]](s32), [[C]]
1001 ; FAST-NEXT: [[TRUNC1:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP2]](s32)
1002 ; FAST-NEXT: [[COPY4:%[0-9]+]]:vcc(s1) = COPY [[TRUNC1]](s1)
1003 ; FAST-NEXT: G_BR %bb.2
1006 ; FAST-NEXT: [[PHI:%[0-9]+]]:vcc(s1) = G_PHI [[ICMP]](s1), %bb.0, [[COPY4]](s1), %bb.1
1007 ; FAST-NEXT: [[COPY5:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
1008 ; FAST-NEXT: [[COPY6:%[0-9]+]]:vgpr(s32) = COPY [[COPY1]](s32)
1009 ; FAST-NEXT: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[PHI]](s1), [[COPY5]], [[COPY6]]
1010 ; FAST-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31, implicit [[SELECT]](s32)
1011 ; GREEDY-LABEL: name: phi_s1_vcc_scc_sbranch
1013 ; GREEDY-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
1014 ; GREEDY-NEXT: liveins: $vgpr0, $sgpr0, $sgpr1
1015 ; GREEDY-NEXT: {{ $}}
1016 ; GREEDY-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
1017 ; GREEDY-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
1018 ; GREEDY-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
1019 ; GREEDY-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
1020 ; GREEDY-NEXT: [[COPY3:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
1021 ; GREEDY-NEXT: [[ICMP:%[0-9]+]]:vcc(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY3]]
1022 ; GREEDY-NEXT: [[ICMP1:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
1023 ; GREEDY-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP1]](s32)
1024 ; GREEDY-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s1)
1025 ; GREEDY-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
1026 ; GREEDY-NEXT: G_BR %bb.2
1027 ; GREEDY-NEXT: {{ $}}
1028 ; GREEDY-NEXT: bb.1:
1029 ; GREEDY-NEXT: successors: %bb.2(0x80000000)
1030 ; GREEDY-NEXT: {{ $}}
1031 ; GREEDY-NEXT: [[ICMP2:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY1]](s32), [[C]]
1032 ; GREEDY-NEXT: [[TRUNC1:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP2]](s32)
1033 ; GREEDY-NEXT: [[COPY4:%[0-9]+]]:vcc(s1) = COPY [[TRUNC1]](s1)
1034 ; GREEDY-NEXT: G_BR %bb.2
1035 ; GREEDY-NEXT: {{ $}}
1036 ; GREEDY-NEXT: bb.2:
1037 ; GREEDY-NEXT: [[PHI:%[0-9]+]]:vcc(s1) = G_PHI [[ICMP]](s1), %bb.0, [[COPY4]](s1), %bb.1
1038 ; GREEDY-NEXT: [[COPY5:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
1039 ; GREEDY-NEXT: [[COPY6:%[0-9]+]]:vgpr(s32) = COPY [[COPY1]](s32)
1040 ; GREEDY-NEXT: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[PHI]](s1), [[COPY5]], [[COPY6]]
1041 ; GREEDY-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31, implicit [[SELECT]](s32)
1043 successors: %bb.1, %bb.2
1044 liveins: $vgpr0, $sgpr0, $sgpr1
1046 %0:_(s32) = COPY $vgpr0
1047 %1:_(s32) = COPY $sgpr0
1048 %2:_(s32) = COPY $sgpr1
1049 %3:_(s32) = G_CONSTANT i32 0
1050 %4:_(s1) = G_ICMP intpred(eq), %0, %3
1051 %5:_(s1) = G_ICMP intpred(eq), %2, %3
1058 %6:_(s1) = G_ICMP intpred(eq), %1, %3
1062 %7:_(s1) = G_PHI %4, %bb.0, %6, %bb.1
1063 %8:_(s32) = G_SELECT %7, %3, %1
1064 S_SETPC_B64 undef $sgpr30_sgpr31, implicit %8
1069 name: phi_s1_vcc_vcc_sbranch
1071 tracksRegLiveness: true
1074 ; FAST-LABEL: name: phi_s1_vcc_vcc_sbranch
1076 ; FAST-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
1077 ; FAST-NEXT: liveins: $vgpr0, $vgpr1, $sgpr0
1079 ; FAST-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
1080 ; FAST-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
1081 ; FAST-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
1082 ; FAST-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
1083 ; FAST-NEXT: [[COPY3:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
1084 ; FAST-NEXT: [[ICMP:%[0-9]+]]:vcc(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY3]]
1085 ; FAST-NEXT: [[ICMP1:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
1086 ; FAST-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP1]](s32)
1087 ; FAST-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s1)
1088 ; FAST-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
1089 ; FAST-NEXT: G_BR %bb.2
1092 ; FAST-NEXT: successors: %bb.2(0x80000000)
1094 ; FAST-NEXT: [[COPY4:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
1095 ; FAST-NEXT: [[ICMP2:%[0-9]+]]:vcc(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[COPY4]]
1096 ; FAST-NEXT: G_BR %bb.2
1099 ; FAST-NEXT: [[PHI:%[0-9]+]]:vcc(s1) = G_PHI [[ICMP]](s1), %bb.0, [[ICMP2]](s1), %bb.1
1100 ; FAST-NEXT: [[COPY5:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
1101 ; FAST-NEXT: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[PHI]](s1), [[COPY5]], [[COPY]]
1102 ; FAST-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31, implicit [[SELECT]](s32)
1103 ; GREEDY-LABEL: name: phi_s1_vcc_vcc_sbranch
1105 ; GREEDY-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
1106 ; GREEDY-NEXT: liveins: $vgpr0, $vgpr1, $sgpr0
1107 ; GREEDY-NEXT: {{ $}}
1108 ; GREEDY-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
1109 ; GREEDY-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
1110 ; GREEDY-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
1111 ; GREEDY-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
1112 ; GREEDY-NEXT: [[COPY3:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
1113 ; GREEDY-NEXT: [[ICMP:%[0-9]+]]:vcc(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY3]]
1114 ; GREEDY-NEXT: [[ICMP1:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
1115 ; GREEDY-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP1]](s32)
1116 ; GREEDY-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s1)
1117 ; GREEDY-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
1118 ; GREEDY-NEXT: G_BR %bb.2
1119 ; GREEDY-NEXT: {{ $}}
1120 ; GREEDY-NEXT: bb.1:
1121 ; GREEDY-NEXT: successors: %bb.2(0x80000000)
1122 ; GREEDY-NEXT: {{ $}}
1123 ; GREEDY-NEXT: [[COPY4:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
1124 ; GREEDY-NEXT: [[ICMP2:%[0-9]+]]:vcc(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[COPY4]]
1125 ; GREEDY-NEXT: G_BR %bb.2
1126 ; GREEDY-NEXT: {{ $}}
1127 ; GREEDY-NEXT: bb.2:
1128 ; GREEDY-NEXT: [[PHI:%[0-9]+]]:vcc(s1) = G_PHI [[ICMP]](s1), %bb.0, [[ICMP2]](s1), %bb.1
1129 ; GREEDY-NEXT: [[COPY5:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
1130 ; GREEDY-NEXT: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[PHI]](s1), [[COPY5]], [[COPY]]
1131 ; GREEDY-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31, implicit [[SELECT]](s32)
1133 successors: %bb.1, %bb.2
1134 liveins: $vgpr0, $vgpr1, $sgpr0
1136 %0:_(s32) = COPY $vgpr0
1137 %1:_(s32) = COPY $vgpr1
1138 %2:_(s32) = COPY $sgpr0
1139 %3:_(s32) = G_CONSTANT i32 0
1140 %4:_(s1) = G_ICMP intpred(eq), %0, %3
1141 %5:_(s1) = G_ICMP intpred(eq), %2, %3
1148 %6:_(s1) = G_ICMP intpred(eq), %1, %3
1152 %7:_(s1) = G_PHI %4, %bb.0, %6, %bb.1
1153 %8:_(s32) = G_SELECT %7, %3, %0
1154 S_SETPC_B64 undef $sgpr30_sgpr31, implicit %8
1159 name: phi_s1_s_scc_sbranch
1161 tracksRegLiveness: true
1164 ; FAST-LABEL: name: phi_s1_s_scc_sbranch
1166 ; FAST-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
1167 ; FAST-NEXT: liveins: $sgpr0, $sgpr1, $sgpr2
1169 ; FAST-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
1170 ; FAST-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
1171 ; FAST-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr2
1172 ; FAST-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
1173 ; FAST-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[COPY]](s32)
1174 ; FAST-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
1175 ; FAST-NEXT: [[TRUNC1:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
1176 ; FAST-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC1]](s1)
1177 ; FAST-NEXT: [[ANYEXT:%[0-9]+]]:sgpr(s32) = G_ANYEXT [[TRUNC]](s1)
1178 ; FAST-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
1179 ; FAST-NEXT: G_BR %bb.2
1182 ; FAST-NEXT: successors: %bb.2(0x80000000)
1184 ; FAST-NEXT: [[ICMP1:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY1]](s32), [[C]]
1185 ; FAST-NEXT: [[TRUNC2:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP1]](s32)
1186 ; FAST-NEXT: [[ANYEXT1:%[0-9]+]]:sgpr(s32) = G_ANYEXT [[TRUNC2]](s1)
1187 ; FAST-NEXT: G_BR %bb.2
1190 ; FAST-NEXT: [[PHI:%[0-9]+]]:sgpr(s32) = G_PHI [[ANYEXT]](s32), %bb.0, [[ANYEXT1]](s32), %bb.1
1191 ; FAST-NEXT: [[TRUNC3:%[0-9]+]]:sgpr(s1) = G_TRUNC [[PHI]](s32)
1192 ; FAST-NEXT: [[ZEXT1:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC3]](s1)
1193 ; FAST-NEXT: [[SELECT:%[0-9]+]]:sgpr(s32) = G_SELECT [[ZEXT1]](s32), [[C]], [[COPY]]
1194 ; FAST-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31, implicit [[SELECT]](s32)
1195 ; GREEDY-LABEL: name: phi_s1_s_scc_sbranch
1197 ; GREEDY-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
1198 ; GREEDY-NEXT: liveins: $sgpr0, $sgpr1, $sgpr2
1199 ; GREEDY-NEXT: {{ $}}
1200 ; GREEDY-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
1201 ; GREEDY-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
1202 ; GREEDY-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr2
1203 ; GREEDY-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
1204 ; GREEDY-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[COPY]](s32)
1205 ; GREEDY-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
1206 ; GREEDY-NEXT: [[TRUNC1:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
1207 ; GREEDY-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC1]](s1)
1208 ; GREEDY-NEXT: [[ANYEXT:%[0-9]+]]:sgpr(s32) = G_ANYEXT [[TRUNC]](s1)
1209 ; GREEDY-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
1210 ; GREEDY-NEXT: G_BR %bb.2
1211 ; GREEDY-NEXT: {{ $}}
1212 ; GREEDY-NEXT: bb.1:
1213 ; GREEDY-NEXT: successors: %bb.2(0x80000000)
1214 ; GREEDY-NEXT: {{ $}}
1215 ; GREEDY-NEXT: [[ICMP1:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY1]](s32), [[C]]
1216 ; GREEDY-NEXT: [[TRUNC2:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP1]](s32)
1217 ; GREEDY-NEXT: [[ANYEXT1:%[0-9]+]]:sgpr(s32) = G_ANYEXT [[TRUNC2]](s1)
1218 ; GREEDY-NEXT: G_BR %bb.2
1219 ; GREEDY-NEXT: {{ $}}
1220 ; GREEDY-NEXT: bb.2:
1221 ; GREEDY-NEXT: [[PHI:%[0-9]+]]:sgpr(s32) = G_PHI [[ANYEXT]](s32), %bb.0, [[ANYEXT1]](s32), %bb.1
1222 ; GREEDY-NEXT: [[TRUNC3:%[0-9]+]]:sgpr(s1) = G_TRUNC [[PHI]](s32)
1223 ; GREEDY-NEXT: [[ZEXT1:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC3]](s1)
1224 ; GREEDY-NEXT: [[SELECT:%[0-9]+]]:sgpr(s32) = G_SELECT [[ZEXT1]](s32), [[C]], [[COPY]]
1225 ; GREEDY-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31, implicit [[SELECT]](s32)
1227 successors: %bb.1, %bb.2
1228 liveins: $sgpr0, $sgpr1, $sgpr2
1230 %0:_(s32) = COPY $sgpr0
1231 %1:_(s32) = COPY $sgpr1
1232 %2:_(s32) = COPY $sgpr2
1233 %3:_(s32) = G_CONSTANT i32 0
1234 %4:_(s1) = G_TRUNC %0
1235 %5:_(s1) = G_ICMP intpred(eq), %2, %3
1242 %6:_(s1) = G_ICMP intpred(eq), %1, %3
1246 %7:_(s1) = G_PHI %4, %bb.0, %6, %bb.1
1247 %8:_(s32) = G_SELECT %7, %3, %0
1248 S_SETPC_B64 undef $sgpr30_sgpr31, implicit %8
1253 name: phi_s1_scc_s_sbranch
1255 tracksRegLiveness: true
1258 ; FAST-LABEL: name: phi_s1_scc_s_sbranch
1260 ; FAST-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
1261 ; FAST-NEXT: liveins: $sgpr0, $sgpr1, $sgpr2
1263 ; FAST-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
1264 ; FAST-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
1265 ; FAST-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr2
1266 ; FAST-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
1267 ; FAST-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY]](s32), [[C]]
1268 ; FAST-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
1269 ; FAST-NEXT: [[ICMP1:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
1270 ; FAST-NEXT: [[TRUNC1:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP1]](s32)
1271 ; FAST-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC1]](s1)
1272 ; FAST-NEXT: [[ANYEXT:%[0-9]+]]:sgpr(s32) = G_ANYEXT [[TRUNC]](s1)
1273 ; FAST-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
1274 ; FAST-NEXT: G_BR %bb.2
1277 ; FAST-NEXT: successors: %bb.2(0x80000000)
1279 ; FAST-NEXT: [[TRUNC2:%[0-9]+]]:sgpr(s1) = G_TRUNC [[COPY1]](s32)
1280 ; FAST-NEXT: [[ANYEXT1:%[0-9]+]]:sgpr(s32) = G_ANYEXT [[TRUNC2]](s1)
1281 ; FAST-NEXT: G_BR %bb.2
1284 ; FAST-NEXT: [[PHI:%[0-9]+]]:sgpr(s32) = G_PHI [[ANYEXT]](s32), %bb.0, [[ANYEXT1]](s32), %bb.1
1285 ; FAST-NEXT: [[TRUNC3:%[0-9]+]]:sgpr(s1) = G_TRUNC [[PHI]](s32)
1286 ; FAST-NEXT: [[ZEXT1:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC3]](s1)
1287 ; FAST-NEXT: [[SELECT:%[0-9]+]]:sgpr(s32) = G_SELECT [[ZEXT1]](s32), [[C]], [[COPY]]
1288 ; FAST-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31, implicit [[SELECT]](s32)
1289 ; GREEDY-LABEL: name: phi_s1_scc_s_sbranch
1291 ; GREEDY-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
1292 ; GREEDY-NEXT: liveins: $sgpr0, $sgpr1, $sgpr2
1293 ; GREEDY-NEXT: {{ $}}
1294 ; GREEDY-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
1295 ; GREEDY-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
1296 ; GREEDY-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr2
1297 ; GREEDY-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
1298 ; GREEDY-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY]](s32), [[C]]
1299 ; GREEDY-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
1300 ; GREEDY-NEXT: [[ICMP1:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
1301 ; GREEDY-NEXT: [[TRUNC1:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP1]](s32)
1302 ; GREEDY-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC1]](s1)
1303 ; GREEDY-NEXT: [[ANYEXT:%[0-9]+]]:sgpr(s32) = G_ANYEXT [[TRUNC]](s1)
1304 ; GREEDY-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
1305 ; GREEDY-NEXT: G_BR %bb.2
1306 ; GREEDY-NEXT: {{ $}}
1307 ; GREEDY-NEXT: bb.1:
1308 ; GREEDY-NEXT: successors: %bb.2(0x80000000)
1309 ; GREEDY-NEXT: {{ $}}
1310 ; GREEDY-NEXT: [[TRUNC2:%[0-9]+]]:sgpr(s1) = G_TRUNC [[COPY1]](s32)
1311 ; GREEDY-NEXT: [[ANYEXT1:%[0-9]+]]:sgpr(s32) = G_ANYEXT [[TRUNC2]](s1)
1312 ; GREEDY-NEXT: G_BR %bb.2
1313 ; GREEDY-NEXT: {{ $}}
1314 ; GREEDY-NEXT: bb.2:
1315 ; GREEDY-NEXT: [[PHI:%[0-9]+]]:sgpr(s32) = G_PHI [[ANYEXT]](s32), %bb.0, [[ANYEXT1]](s32), %bb.1
1316 ; GREEDY-NEXT: [[TRUNC3:%[0-9]+]]:sgpr(s1) = G_TRUNC [[PHI]](s32)
1317 ; GREEDY-NEXT: [[ZEXT1:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC3]](s1)
1318 ; GREEDY-NEXT: [[SELECT:%[0-9]+]]:sgpr(s32) = G_SELECT [[ZEXT1]](s32), [[C]], [[COPY]]
1319 ; GREEDY-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31, implicit [[SELECT]](s32)
1321 successors: %bb.1, %bb.2
1322 liveins: $sgpr0, $sgpr1, $sgpr2
1324 %0:_(s32) = COPY $sgpr0
1325 %1:_(s32) = COPY $sgpr1
1326 %2:_(s32) = COPY $sgpr2
1327 %3:_(s32) = G_CONSTANT i32 0
1328 %4:_(s1) = G_ICMP intpred(eq), %0, %3
1329 %5:_(s1) = G_ICMP intpred(eq), %2, %3
1336 %6:_(s1) = G_TRUNC %1
1340 %7:_(s1) = G_PHI %4, %bb.0, %6, %bb.1
1341 %8:_(s32) = G_SELECT %7, %3, %0
1342 S_SETPC_B64 undef $sgpr30_sgpr31, implicit %8
1347 name: phi_s1_scc_v_sbranch
1349 tracksRegLiveness: true
1352 ; FAST-LABEL: name: phi_s1_scc_v_sbranch
1354 ; FAST-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
1355 ; FAST-NEXT: liveins: $vgpr0, $sgpr0, $sgpr1, $sgpr2
1357 ; FAST-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
1358 ; FAST-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
1359 ; FAST-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr2
1360 ; FAST-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
1361 ; FAST-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY]](s32), [[C]]
1362 ; FAST-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
1363 ; FAST-NEXT: [[ICMP1:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
1364 ; FAST-NEXT: [[TRUNC1:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP1]](s32)
1365 ; FAST-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC1]](s1)
1366 ; FAST-NEXT: [[ANYEXT:%[0-9]+]]:vgpr(s32) = G_ANYEXT [[TRUNC]](s1)
1367 ; FAST-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
1368 ; FAST-NEXT: G_BR %bb.2
1371 ; FAST-NEXT: successors: %bb.2(0x80000000)
1373 ; FAST-NEXT: [[TRUNC2:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY1]](s32)
1374 ; FAST-NEXT: [[ANYEXT1:%[0-9]+]]:vgpr(s32) = G_ANYEXT [[TRUNC2]](s1)
1375 ; FAST-NEXT: G_BR %bb.2
1378 ; FAST-NEXT: [[PHI:%[0-9]+]]:vgpr(s32) = G_PHI [[ANYEXT]](s32), %bb.0, [[ANYEXT1]](s32), %bb.1
1379 ; FAST-NEXT: [[TRUNC3:%[0-9]+]]:vgpr(s1) = G_TRUNC [[PHI]](s32)
1380 ; FAST-NEXT: [[COPY3:%[0-9]+]]:vcc(s1) = COPY [[TRUNC3]](s1)
1381 ; FAST-NEXT: [[COPY4:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
1382 ; FAST-NEXT: [[COPY5:%[0-9]+]]:vgpr(s32) = COPY [[COPY]](s32)
1383 ; FAST-NEXT: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[COPY3]](s1), [[COPY4]], [[COPY5]]
1384 ; FAST-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31, implicit [[SELECT]](s32)
1385 ; GREEDY-LABEL: name: phi_s1_scc_v_sbranch
1387 ; GREEDY-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
1388 ; GREEDY-NEXT: liveins: $vgpr0, $sgpr0, $sgpr1, $sgpr2
1389 ; GREEDY-NEXT: {{ $}}
1390 ; GREEDY-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
1391 ; GREEDY-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
1392 ; GREEDY-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr2
1393 ; GREEDY-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
1394 ; GREEDY-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY]](s32), [[C]]
1395 ; GREEDY-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
1396 ; GREEDY-NEXT: [[ICMP1:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
1397 ; GREEDY-NEXT: [[TRUNC1:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP1]](s32)
1398 ; GREEDY-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC1]](s1)
1399 ; GREEDY-NEXT: [[ANYEXT:%[0-9]+]]:vgpr(s32) = G_ANYEXT [[TRUNC]](s1)
1400 ; GREEDY-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
1401 ; GREEDY-NEXT: G_BR %bb.2
1402 ; GREEDY-NEXT: {{ $}}
1403 ; GREEDY-NEXT: bb.1:
1404 ; GREEDY-NEXT: successors: %bb.2(0x80000000)
1405 ; GREEDY-NEXT: {{ $}}
1406 ; GREEDY-NEXT: [[TRUNC2:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY1]](s32)
1407 ; GREEDY-NEXT: [[ANYEXT1:%[0-9]+]]:vgpr(s32) = G_ANYEXT [[TRUNC2]](s1)
1408 ; GREEDY-NEXT: G_BR %bb.2
1409 ; GREEDY-NEXT: {{ $}}
1410 ; GREEDY-NEXT: bb.2:
1411 ; GREEDY-NEXT: [[PHI:%[0-9]+]]:vgpr(s32) = G_PHI [[ANYEXT]](s32), %bb.0, [[ANYEXT1]](s32), %bb.1
1412 ; GREEDY-NEXT: [[TRUNC3:%[0-9]+]]:vgpr(s1) = G_TRUNC [[PHI]](s32)
1413 ; GREEDY-NEXT: [[COPY3:%[0-9]+]]:vcc(s1) = COPY [[TRUNC3]](s1)
1414 ; GREEDY-NEXT: [[COPY4:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
1415 ; GREEDY-NEXT: [[COPY5:%[0-9]+]]:vgpr(s32) = COPY [[COPY]](s32)
1416 ; GREEDY-NEXT: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[COPY3]](s1), [[COPY4]], [[COPY5]]
1417 ; GREEDY-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31, implicit [[SELECT]](s32)
1419 successors: %bb.1, %bb.2
1420 liveins: $vgpr0, $sgpr0, $sgpr1, $sgpr2
1422 %0:_(s32) = COPY $sgpr0
1423 %1:_(s32) = COPY $vgpr0
1424 %2:_(s32) = COPY $sgpr2
1425 %3:_(s32) = G_CONSTANT i32 0
1426 %4:_(s1) = G_ICMP intpred(eq), %0, %3
1427 %5:_(s1) = G_ICMP intpred(eq), %2, %3
1434 %6:_(s1) = G_TRUNC %1
1438 %7:_(s1) = G_PHI %4, %bb.0, %6, %bb.1
1439 %8:_(s32) = G_SELECT %7, %3, %0
1440 S_SETPC_B64 undef $sgpr30_sgpr31, implicit %8
1445 name: phi_s1_v_scc_sbranch
1447 tracksRegLiveness: true
1450 ; FAST-LABEL: name: phi_s1_v_scc_sbranch
1452 ; FAST-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
1453 ; FAST-NEXT: liveins: $vgpr0, $sgpr0, $sgpr1
1455 ; FAST-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
1456 ; FAST-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
1457 ; FAST-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
1458 ; FAST-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
1459 ; FAST-NEXT: [[TRUNC:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY]](s32)
1460 ; FAST-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
1461 ; FAST-NEXT: [[TRUNC1:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
1462 ; FAST-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC1]](s1)
1463 ; FAST-NEXT: [[ANYEXT:%[0-9]+]]:vgpr(s32) = G_ANYEXT [[TRUNC]](s1)
1464 ; FAST-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
1465 ; FAST-NEXT: G_BR %bb.2
1468 ; FAST-NEXT: successors: %bb.2(0x80000000)
1470 ; FAST-NEXT: [[ICMP1:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY1]](s32), [[C]]
1471 ; FAST-NEXT: [[TRUNC2:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP1]](s32)
1472 ; FAST-NEXT: [[ANYEXT1:%[0-9]+]]:vgpr(s32) = G_ANYEXT [[TRUNC2]](s1)
1473 ; FAST-NEXT: G_BR %bb.2
1476 ; FAST-NEXT: [[PHI:%[0-9]+]]:vgpr(s32) = G_PHI [[ANYEXT]](s32), %bb.0, [[ANYEXT1]](s32), %bb.1
1477 ; FAST-NEXT: [[TRUNC3:%[0-9]+]]:vgpr(s1) = G_TRUNC [[PHI]](s32)
1478 ; FAST-NEXT: [[COPY3:%[0-9]+]]:vcc(s1) = COPY [[TRUNC3]](s1)
1479 ; FAST-NEXT: [[COPY4:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
1480 ; FAST-NEXT: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[COPY3]](s1), [[COPY4]], [[COPY]]
1481 ; FAST-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31, implicit [[SELECT]](s32)
1482 ; GREEDY-LABEL: name: phi_s1_v_scc_sbranch
1484 ; GREEDY-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
1485 ; GREEDY-NEXT: liveins: $vgpr0, $sgpr0, $sgpr1
1486 ; GREEDY-NEXT: {{ $}}
1487 ; GREEDY-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
1488 ; GREEDY-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
1489 ; GREEDY-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
1490 ; GREEDY-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
1491 ; GREEDY-NEXT: [[TRUNC:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY]](s32)
1492 ; GREEDY-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
1493 ; GREEDY-NEXT: [[TRUNC1:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
1494 ; GREEDY-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC1]](s1)
1495 ; GREEDY-NEXT: [[ANYEXT:%[0-9]+]]:vgpr(s32) = G_ANYEXT [[TRUNC]](s1)
1496 ; GREEDY-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
1497 ; GREEDY-NEXT: G_BR %bb.2
1498 ; GREEDY-NEXT: {{ $}}
1499 ; GREEDY-NEXT: bb.1:
1500 ; GREEDY-NEXT: successors: %bb.2(0x80000000)
1501 ; GREEDY-NEXT: {{ $}}
1502 ; GREEDY-NEXT: [[ICMP1:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY1]](s32), [[C]]
1503 ; GREEDY-NEXT: [[TRUNC2:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP1]](s32)
1504 ; GREEDY-NEXT: [[ANYEXT1:%[0-9]+]]:vgpr(s32) = G_ANYEXT [[TRUNC2]](s1)
1505 ; GREEDY-NEXT: G_BR %bb.2
1506 ; GREEDY-NEXT: {{ $}}
1507 ; GREEDY-NEXT: bb.2:
1508 ; GREEDY-NEXT: [[PHI:%[0-9]+]]:vgpr(s32) = G_PHI [[ANYEXT]](s32), %bb.0, [[ANYEXT1]](s32), %bb.1
1509 ; GREEDY-NEXT: [[TRUNC3:%[0-9]+]]:vgpr(s1) = G_TRUNC [[PHI]](s32)
1510 ; GREEDY-NEXT: [[COPY3:%[0-9]+]]:vcc(s1) = COPY [[TRUNC3]](s1)
1511 ; GREEDY-NEXT: [[COPY4:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
1512 ; GREEDY-NEXT: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[COPY3]](s1), [[COPY4]], [[COPY]]
1513 ; GREEDY-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31, implicit [[SELECT]](s32)
1515 successors: %bb.1, %bb.2
1516 liveins: $vgpr0, $sgpr0, $sgpr1
1518 %0:_(s32) = COPY $vgpr0
1519 %1:_(s32) = COPY $sgpr0
1520 %2:_(s32) = COPY $sgpr1
1521 %3:_(s32) = G_CONSTANT i32 0
1522 %4:_(s1) = G_TRUNC %0
1523 %5:_(s1) = G_ICMP intpred(eq), %2, %3
1530 %6:_(s1) = G_ICMP intpred(eq), %1, %3
1534 %7:_(s1) = G_PHI %4, %bb.0, %6, %bb.1
1535 %8:_(s32) = G_SELECT %7, %3, %0
1536 S_SETPC_B64 undef $sgpr30_sgpr31, implicit %8
1541 name: phi_s1_vcc_s_sbranch
1543 tracksRegLiveness: true
1546 ; FAST-LABEL: name: phi_s1_vcc_s_sbranch
1548 ; FAST-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
1549 ; FAST-NEXT: liveins: $vgpr0, $sgpr0, $sgpr1
1551 ; FAST-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
1552 ; FAST-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
1553 ; FAST-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
1554 ; FAST-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
1555 ; FAST-NEXT: [[COPY3:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
1556 ; FAST-NEXT: [[ICMP:%[0-9]+]]:vcc(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY3]]
1557 ; FAST-NEXT: [[ICMP1:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
1558 ; FAST-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP1]](s32)
1559 ; FAST-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s1)
1560 ; FAST-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
1561 ; FAST-NEXT: G_BR %bb.2
1564 ; FAST-NEXT: successors: %bb.2(0x80000000)
1566 ; FAST-NEXT: [[TRUNC1:%[0-9]+]]:sgpr(s1) = G_TRUNC [[COPY1]](s32)
1567 ; FAST-NEXT: [[COPY4:%[0-9]+]]:vcc(s1) = COPY [[TRUNC1]](s1)
1568 ; FAST-NEXT: G_BR %bb.2
1571 ; FAST-NEXT: [[PHI:%[0-9]+]]:vcc(s1) = G_PHI [[ICMP]](s1), %bb.0, [[COPY4]](s1), %bb.1
1572 ; FAST-NEXT: [[COPY5:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
1573 ; FAST-NEXT: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[PHI]](s1), [[COPY5]], [[COPY]]
1574 ; FAST-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31, implicit [[SELECT]](s32)
1575 ; GREEDY-LABEL: name: phi_s1_vcc_s_sbranch
1577 ; GREEDY-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
1578 ; GREEDY-NEXT: liveins: $vgpr0, $sgpr0, $sgpr1
1579 ; GREEDY-NEXT: {{ $}}
1580 ; GREEDY-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
1581 ; GREEDY-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
1582 ; GREEDY-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
1583 ; GREEDY-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
1584 ; GREEDY-NEXT: [[COPY3:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
1585 ; GREEDY-NEXT: [[ICMP:%[0-9]+]]:vcc(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY3]]
1586 ; GREEDY-NEXT: [[ICMP1:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
1587 ; GREEDY-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP1]](s32)
1588 ; GREEDY-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s1)
1589 ; GREEDY-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
1590 ; GREEDY-NEXT: G_BR %bb.2
1591 ; GREEDY-NEXT: {{ $}}
1592 ; GREEDY-NEXT: bb.1:
1593 ; GREEDY-NEXT: successors: %bb.2(0x80000000)
1594 ; GREEDY-NEXT: {{ $}}
1595 ; GREEDY-NEXT: [[TRUNC1:%[0-9]+]]:sgpr(s1) = G_TRUNC [[COPY1]](s32)
1596 ; GREEDY-NEXT: [[COPY4:%[0-9]+]]:vcc(s1) = COPY [[TRUNC1]](s1)
1597 ; GREEDY-NEXT: G_BR %bb.2
1598 ; GREEDY-NEXT: {{ $}}
1599 ; GREEDY-NEXT: bb.2:
1600 ; GREEDY-NEXT: [[PHI:%[0-9]+]]:vcc(s1) = G_PHI [[ICMP]](s1), %bb.0, [[COPY4]](s1), %bb.1
1601 ; GREEDY-NEXT: [[COPY5:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
1602 ; GREEDY-NEXT: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[PHI]](s1), [[COPY5]], [[COPY]]
1603 ; GREEDY-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31, implicit [[SELECT]](s32)
1605 successors: %bb.1, %bb.2
1606 liveins: $vgpr0, $sgpr0, $sgpr1
1608 %0:_(s32) = COPY $vgpr0
1609 %1:_(s32) = COPY $sgpr0
1610 %2:_(s32) = COPY $sgpr1
1611 %3:_(s32) = G_CONSTANT i32 0
1612 %4:_(s1) = G_ICMP intpred(eq), %0, %3
1613 %5:_(s1) = G_ICMP intpred(eq), %2, %3
1620 %6:_(s1) = G_TRUNC %1
1624 %7:_(s1) = G_PHI %4, %bb.0, %6, %bb.1
1625 %8:_(s32) = G_SELECT %7, %3, %0
1626 S_SETPC_B64 undef $sgpr30_sgpr31, implicit %8
1631 name: phi_s1_s_vcc_sbranch
1633 tracksRegLiveness: true
1636 ; FAST-LABEL: name: phi_s1_s_vcc_sbranch
1638 ; FAST-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
1639 ; FAST-NEXT: liveins: $vgpr0, $sgpr0, $sgpr1
1641 ; FAST-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
1642 ; FAST-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
1643 ; FAST-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
1644 ; FAST-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
1645 ; FAST-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[COPY]](s32)
1646 ; FAST-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
1647 ; FAST-NEXT: [[TRUNC1:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
1648 ; FAST-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC1]](s1)
1649 ; FAST-NEXT: [[COPY3:%[0-9]+]]:vcc(s1) = COPY [[TRUNC]](s1)
1650 ; FAST-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
1651 ; FAST-NEXT: G_BR %bb.2
1654 ; FAST-NEXT: successors: %bb.2(0x80000000)
1656 ; FAST-NEXT: [[COPY4:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
1657 ; FAST-NEXT: [[ICMP1:%[0-9]+]]:vcc(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[COPY4]]
1658 ; FAST-NEXT: G_BR %bb.2
1661 ; FAST-NEXT: [[PHI:%[0-9]+]]:vcc(s1) = G_PHI [[COPY3]](s1), %bb.0, [[ICMP1]](s1), %bb.1
1662 ; FAST-NEXT: [[COPY5:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
1663 ; FAST-NEXT: [[COPY6:%[0-9]+]]:vgpr(s32) = COPY [[COPY]](s32)
1664 ; FAST-NEXT: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[PHI]](s1), [[COPY5]], [[COPY6]]
1665 ; FAST-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31, implicit [[SELECT]](s32)
1666 ; GREEDY-LABEL: name: phi_s1_s_vcc_sbranch
1668 ; GREEDY-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
1669 ; GREEDY-NEXT: liveins: $vgpr0, $sgpr0, $sgpr1
1670 ; GREEDY-NEXT: {{ $}}
1671 ; GREEDY-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
1672 ; GREEDY-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
1673 ; GREEDY-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
1674 ; GREEDY-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
1675 ; GREEDY-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[COPY]](s32)
1676 ; GREEDY-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
1677 ; GREEDY-NEXT: [[TRUNC1:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
1678 ; GREEDY-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC1]](s1)
1679 ; GREEDY-NEXT: [[COPY3:%[0-9]+]]:vcc(s1) = COPY [[TRUNC]](s1)
1680 ; GREEDY-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
1681 ; GREEDY-NEXT: G_BR %bb.2
1682 ; GREEDY-NEXT: {{ $}}
1683 ; GREEDY-NEXT: bb.1:
1684 ; GREEDY-NEXT: successors: %bb.2(0x80000000)
1685 ; GREEDY-NEXT: {{ $}}
1686 ; GREEDY-NEXT: [[COPY4:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
1687 ; GREEDY-NEXT: [[ICMP1:%[0-9]+]]:vcc(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[COPY4]]
1688 ; GREEDY-NEXT: G_BR %bb.2
1689 ; GREEDY-NEXT: {{ $}}
1690 ; GREEDY-NEXT: bb.2:
1691 ; GREEDY-NEXT: [[PHI:%[0-9]+]]:vcc(s1) = G_PHI [[COPY3]](s1), %bb.0, [[ICMP1]](s1), %bb.1
1692 ; GREEDY-NEXT: [[COPY5:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
1693 ; GREEDY-NEXT: [[COPY6:%[0-9]+]]:vgpr(s32) = COPY [[COPY]](s32)
1694 ; GREEDY-NEXT: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[PHI]](s1), [[COPY5]], [[COPY6]]
1695 ; GREEDY-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31, implicit [[SELECT]](s32)
1697 successors: %bb.1, %bb.2
1698 liveins: $vgpr0, $sgpr0, $sgpr1
1700 %0:_(s32) = COPY $sgpr0
1701 %1:_(s32) = COPY $vgpr0
1702 %2:_(s32) = COPY $sgpr1
1703 %3:_(s32) = G_CONSTANT i32 0
1704 %4:_(s1) = G_TRUNC %0
1705 %5:_(s1) = G_ICMP intpred(eq), %2, %3
1712 %6:_(s1) = G_ICMP intpred(eq), %1, %3
1716 %7:_(s1) = G_PHI %4, %bb.0, %6, %bb.1
1717 %8:_(s32) = G_SELECT %7, %3, %0
1718 S_SETPC_B64 undef $sgpr30_sgpr31, implicit %8
1723 name: phi_s1_vcc_v_sbranch
1725 tracksRegLiveness: true
1728 ; FAST-LABEL: name: phi_s1_vcc_v_sbranch
1730 ; FAST-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
1731 ; FAST-NEXT: liveins: $vgpr0, $vgpr1, $sgpr0
1733 ; FAST-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
1734 ; FAST-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
1735 ; FAST-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
1736 ; FAST-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
1737 ; FAST-NEXT: [[COPY3:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
1738 ; FAST-NEXT: [[ICMP:%[0-9]+]]:vcc(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY3]]
1739 ; FAST-NEXT: [[ICMP1:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
1740 ; FAST-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP1]](s32)
1741 ; FAST-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s1)
1742 ; FAST-NEXT: [[C1:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 1
1743 ; FAST-NEXT: [[C2:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 0
1744 ; FAST-NEXT: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[ICMP]](s1), [[C1]], [[C2]]
1745 ; FAST-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
1746 ; FAST-NEXT: G_BR %bb.2
1749 ; FAST-NEXT: successors: %bb.2(0x80000000)
1751 ; FAST-NEXT: [[TRUNC1:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY1]](s32)
1752 ; FAST-NEXT: [[ANYEXT:%[0-9]+]]:vgpr(s32) = G_ANYEXT [[TRUNC1]](s1)
1753 ; FAST-NEXT: G_BR %bb.2
1756 ; FAST-NEXT: [[PHI:%[0-9]+]]:vgpr(s32) = G_PHI [[SELECT]](s32), %bb.0, [[ANYEXT]](s32), %bb.1
1757 ; FAST-NEXT: [[TRUNC2:%[0-9]+]]:vgpr(s1) = G_TRUNC [[PHI]](s32)
1758 ; FAST-NEXT: [[COPY4:%[0-9]+]]:vcc(s1) = COPY [[TRUNC2]](s1)
1759 ; FAST-NEXT: [[COPY5:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
1760 ; FAST-NEXT: [[SELECT1:%[0-9]+]]:vgpr(s32) = G_SELECT [[COPY4]](s1), [[COPY5]], [[COPY]]
1761 ; FAST-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31, implicit [[SELECT1]](s32)
1762 ; GREEDY-LABEL: name: phi_s1_vcc_v_sbranch
1764 ; GREEDY-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
1765 ; GREEDY-NEXT: liveins: $vgpr0, $vgpr1, $sgpr0
1766 ; GREEDY-NEXT: {{ $}}
1767 ; GREEDY-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
1768 ; GREEDY-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
1769 ; GREEDY-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
1770 ; GREEDY-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
1771 ; GREEDY-NEXT: [[COPY3:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
1772 ; GREEDY-NEXT: [[ICMP:%[0-9]+]]:vcc(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY3]]
1773 ; GREEDY-NEXT: [[ICMP1:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
1774 ; GREEDY-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP1]](s32)
1775 ; GREEDY-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s1)
1776 ; GREEDY-NEXT: [[C1:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 1
1777 ; GREEDY-NEXT: [[C2:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 0
1778 ; GREEDY-NEXT: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[ICMP]](s1), [[C1]], [[C2]]
1779 ; GREEDY-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
1780 ; GREEDY-NEXT: G_BR %bb.2
1781 ; GREEDY-NEXT: {{ $}}
1782 ; GREEDY-NEXT: bb.1:
1783 ; GREEDY-NEXT: successors: %bb.2(0x80000000)
1784 ; GREEDY-NEXT: {{ $}}
1785 ; GREEDY-NEXT: [[TRUNC1:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY1]](s32)
1786 ; GREEDY-NEXT: [[ANYEXT:%[0-9]+]]:vgpr(s32) = G_ANYEXT [[TRUNC1]](s1)
1787 ; GREEDY-NEXT: G_BR %bb.2
1788 ; GREEDY-NEXT: {{ $}}
1789 ; GREEDY-NEXT: bb.2:
1790 ; GREEDY-NEXT: [[PHI:%[0-9]+]]:vgpr(s32) = G_PHI [[SELECT]](s32), %bb.0, [[ANYEXT]](s32), %bb.1
1791 ; GREEDY-NEXT: [[TRUNC2:%[0-9]+]]:vgpr(s1) = G_TRUNC [[PHI]](s32)
1792 ; GREEDY-NEXT: [[COPY4:%[0-9]+]]:vcc(s1) = COPY [[TRUNC2]](s1)
1793 ; GREEDY-NEXT: [[COPY5:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
1794 ; GREEDY-NEXT: [[SELECT1:%[0-9]+]]:vgpr(s32) = G_SELECT [[COPY4]](s1), [[COPY5]], [[COPY]]
1795 ; GREEDY-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31, implicit [[SELECT1]](s32)
1797 successors: %bb.1, %bb.2
1798 liveins: $vgpr0, $vgpr1, $sgpr0
1800 %0:_(s32) = COPY $vgpr0
1801 %1:_(s32) = COPY $vgpr1
1802 %2:_(s32) = COPY $sgpr0
1803 %3:_(s32) = G_CONSTANT i32 0
1804 %4:_(s1) = G_ICMP intpred(eq), %0, %3
1805 %5:_(s1) = G_ICMP intpred(eq), %2, %3
1812 %6:_(s1) = G_TRUNC %1
1816 %7:_(s1) = G_PHI %4, %bb.0, %6, %bb.1
1817 %8:_(s32) = G_SELECT %7, %3, %0
1818 S_SETPC_B64 undef $sgpr30_sgpr31, implicit %8
1823 name: phi_s1_v_vcc_sbranch
1825 tracksRegLiveness: true
1828 ; FAST-LABEL: name: phi_s1_v_vcc_sbranch
1830 ; FAST-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
1831 ; FAST-NEXT: liveins: $vgpr0, $vgpr1, $sgpr0
1833 ; FAST-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
1834 ; FAST-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
1835 ; FAST-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
1836 ; FAST-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
1837 ; FAST-NEXT: [[TRUNC:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY]](s32)
1838 ; FAST-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
1839 ; FAST-NEXT: [[TRUNC1:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
1840 ; FAST-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC1]](s1)
1841 ; FAST-NEXT: [[ANYEXT:%[0-9]+]]:vgpr(s32) = G_ANYEXT [[TRUNC]](s1)
1842 ; FAST-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
1843 ; FAST-NEXT: G_BR %bb.2
1846 ; FAST-NEXT: successors: %bb.2(0x80000000)
1848 ; FAST-NEXT: [[COPY3:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
1849 ; FAST-NEXT: [[ICMP1:%[0-9]+]]:vcc(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[COPY3]]
1850 ; FAST-NEXT: [[C1:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 1
1851 ; FAST-NEXT: [[C2:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 0
1852 ; FAST-NEXT: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[ICMP1]](s1), [[C1]], [[C2]]
1853 ; FAST-NEXT: G_BR %bb.2
1856 ; FAST-NEXT: [[PHI:%[0-9]+]]:vgpr(s32) = G_PHI [[ANYEXT]](s32), %bb.0, [[SELECT]](s32), %bb.1
1857 ; FAST-NEXT: [[TRUNC2:%[0-9]+]]:vgpr(s1) = G_TRUNC [[PHI]](s32)
1858 ; FAST-NEXT: [[COPY4:%[0-9]+]]:vcc(s1) = COPY [[TRUNC2]](s1)
1859 ; FAST-NEXT: [[COPY5:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
1860 ; FAST-NEXT: [[SELECT1:%[0-9]+]]:vgpr(s32) = G_SELECT [[COPY4]](s1), [[COPY5]], [[COPY]]
1861 ; FAST-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31, implicit [[SELECT1]](s32)
1862 ; GREEDY-LABEL: name: phi_s1_v_vcc_sbranch
1864 ; GREEDY-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
1865 ; GREEDY-NEXT: liveins: $vgpr0, $vgpr1, $sgpr0
1866 ; GREEDY-NEXT: {{ $}}
1867 ; GREEDY-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
1868 ; GREEDY-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
1869 ; GREEDY-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
1870 ; GREEDY-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
1871 ; GREEDY-NEXT: [[TRUNC:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY]](s32)
1872 ; GREEDY-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
1873 ; GREEDY-NEXT: [[TRUNC1:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
1874 ; GREEDY-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC1]](s1)
1875 ; GREEDY-NEXT: [[ANYEXT:%[0-9]+]]:vgpr(s32) = G_ANYEXT [[TRUNC]](s1)
1876 ; GREEDY-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
1877 ; GREEDY-NEXT: G_BR %bb.2
1878 ; GREEDY-NEXT: {{ $}}
1879 ; GREEDY-NEXT: bb.1:
1880 ; GREEDY-NEXT: successors: %bb.2(0x80000000)
1881 ; GREEDY-NEXT: {{ $}}
1882 ; GREEDY-NEXT: [[COPY3:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
1883 ; GREEDY-NEXT: [[ICMP1:%[0-9]+]]:vcc(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[COPY3]]
1884 ; GREEDY-NEXT: [[C1:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 1
1885 ; GREEDY-NEXT: [[C2:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 0
1886 ; GREEDY-NEXT: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[ICMP1]](s1), [[C1]], [[C2]]
1887 ; GREEDY-NEXT: G_BR %bb.2
1888 ; GREEDY-NEXT: {{ $}}
1889 ; GREEDY-NEXT: bb.2:
1890 ; GREEDY-NEXT: [[PHI:%[0-9]+]]:vgpr(s32) = G_PHI [[ANYEXT]](s32), %bb.0, [[SELECT]](s32), %bb.1
1891 ; GREEDY-NEXT: [[TRUNC2:%[0-9]+]]:vgpr(s1) = G_TRUNC [[PHI]](s32)
1892 ; GREEDY-NEXT: [[COPY4:%[0-9]+]]:vcc(s1) = COPY [[TRUNC2]](s1)
1893 ; GREEDY-NEXT: [[COPY5:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
1894 ; GREEDY-NEXT: [[SELECT1:%[0-9]+]]:vgpr(s32) = G_SELECT [[COPY4]](s1), [[COPY5]], [[COPY]]
1895 ; GREEDY-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31, implicit [[SELECT1]](s32)
1897 successors: %bb.1, %bb.2
1898 liveins: $vgpr0, $vgpr1, $sgpr0
1900 %0:_(s32) = COPY $vgpr0
1901 %1:_(s32) = COPY $vgpr1
1902 %2:_(s32) = COPY $sgpr0
1903 %3:_(s32) = G_CONSTANT i32 0
1904 %4:_(s1) = G_TRUNC %0
1905 %5:_(s1) = G_ICMP intpred(eq), %2, %3
1912 %6:_(s1) = G_ICMP intpred(eq), %1, %3
1916 %7:_(s1) = G_PHI %4, %bb.0, %6, %bb.1
1917 %8:_(s32) = G_SELECT %7, %3, %0
1918 S_SETPC_B64 undef $sgpr30_sgpr31, implicit %8
1923 name: phi_s1_v_s_sbranch
1925 tracksRegLiveness: true
1928 ; FAST-LABEL: name: phi_s1_v_s_sbranch
1930 ; FAST-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
1931 ; FAST-NEXT: liveins: $vgpr0, $sgpr0, $sgpr1
1933 ; FAST-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
1934 ; FAST-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
1935 ; FAST-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
1936 ; FAST-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
1937 ; FAST-NEXT: [[TRUNC:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY]](s32)
1938 ; FAST-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
1939 ; FAST-NEXT: [[TRUNC1:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
1940 ; FAST-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC1]](s1)
1941 ; FAST-NEXT: [[ANYEXT:%[0-9]+]]:vgpr(s32) = G_ANYEXT [[TRUNC]](s1)
1942 ; FAST-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
1943 ; FAST-NEXT: G_BR %bb.2
1946 ; FAST-NEXT: successors: %bb.2(0x80000000)
1948 ; FAST-NEXT: [[TRUNC2:%[0-9]+]]:sgpr(s1) = G_TRUNC [[COPY1]](s32)
1949 ; FAST-NEXT: [[ANYEXT1:%[0-9]+]]:vgpr(s32) = G_ANYEXT [[TRUNC2]](s1)
1950 ; FAST-NEXT: G_BR %bb.2
1953 ; FAST-NEXT: [[PHI:%[0-9]+]]:vgpr(s32) = G_PHI [[ANYEXT]](s32), %bb.0, [[ANYEXT1]](s32), %bb.1
1954 ; FAST-NEXT: [[TRUNC3:%[0-9]+]]:vgpr(s1) = G_TRUNC [[PHI]](s32)
1955 ; FAST-NEXT: [[COPY3:%[0-9]+]]:vcc(s1) = COPY [[TRUNC3]](s1)
1956 ; FAST-NEXT: [[COPY4:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
1957 ; FAST-NEXT: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[COPY3]](s1), [[COPY4]], [[COPY]]
1958 ; FAST-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31, implicit [[SELECT]](s32)
1959 ; GREEDY-LABEL: name: phi_s1_v_s_sbranch
1961 ; GREEDY-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
1962 ; GREEDY-NEXT: liveins: $vgpr0, $sgpr0, $sgpr1
1963 ; GREEDY-NEXT: {{ $}}
1964 ; GREEDY-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
1965 ; GREEDY-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
1966 ; GREEDY-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
1967 ; GREEDY-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
1968 ; GREEDY-NEXT: [[TRUNC:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY]](s32)
1969 ; GREEDY-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
1970 ; GREEDY-NEXT: [[TRUNC1:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
1971 ; GREEDY-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC1]](s1)
1972 ; GREEDY-NEXT: [[ANYEXT:%[0-9]+]]:vgpr(s32) = G_ANYEXT [[TRUNC]](s1)
1973 ; GREEDY-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
1974 ; GREEDY-NEXT: G_BR %bb.2
1975 ; GREEDY-NEXT: {{ $}}
1976 ; GREEDY-NEXT: bb.1:
1977 ; GREEDY-NEXT: successors: %bb.2(0x80000000)
1978 ; GREEDY-NEXT: {{ $}}
1979 ; GREEDY-NEXT: [[TRUNC2:%[0-9]+]]:sgpr(s1) = G_TRUNC [[COPY1]](s32)
1980 ; GREEDY-NEXT: [[ANYEXT1:%[0-9]+]]:vgpr(s32) = G_ANYEXT [[TRUNC2]](s1)
1981 ; GREEDY-NEXT: G_BR %bb.2
1982 ; GREEDY-NEXT: {{ $}}
1983 ; GREEDY-NEXT: bb.2:
1984 ; GREEDY-NEXT: [[PHI:%[0-9]+]]:vgpr(s32) = G_PHI [[ANYEXT]](s32), %bb.0, [[ANYEXT1]](s32), %bb.1
1985 ; GREEDY-NEXT: [[TRUNC3:%[0-9]+]]:vgpr(s1) = G_TRUNC [[PHI]](s32)
1986 ; GREEDY-NEXT: [[COPY3:%[0-9]+]]:vcc(s1) = COPY [[TRUNC3]](s1)
1987 ; GREEDY-NEXT: [[COPY4:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
1988 ; GREEDY-NEXT: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[COPY3]](s1), [[COPY4]], [[COPY]]
1989 ; GREEDY-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31, implicit [[SELECT]](s32)
1991 successors: %bb.1, %bb.2
1992 liveins: $vgpr0, $sgpr0, $sgpr1
1994 %0:_(s32) = COPY $vgpr0
1995 %1:_(s32) = COPY $sgpr0
1996 %2:_(s32) = COPY $sgpr1
1997 %3:_(s32) = G_CONSTANT i32 0
1998 %4:_(s1) = G_TRUNC %0
1999 %5:_(s1) = G_ICMP intpred(eq), %2, %3
2006 %6:_(s1) = G_TRUNC %1
2010 %7:_(s1) = G_PHI %4, %bb.0, %6, %bb.1
2011 %8:_(s32) = G_SELECT %7, %3, %0
2012 S_SETPC_B64 undef $sgpr30_sgpr31, implicit %8
2017 name: phi_s1_s_v_sbranch
2019 tracksRegLiveness: true
2022 ; FAST-LABEL: name: phi_s1_s_v_sbranch
2024 ; FAST-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
2025 ; FAST-NEXT: liveins: $vgpr0, $sgpr0, $sgpr1
2027 ; FAST-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
2028 ; FAST-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
2029 ; FAST-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
2030 ; FAST-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
2031 ; FAST-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[COPY]](s32)
2032 ; FAST-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
2033 ; FAST-NEXT: [[TRUNC1:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
2034 ; FAST-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC1]](s1)
2035 ; FAST-NEXT: [[ANYEXT:%[0-9]+]]:vgpr(s32) = G_ANYEXT [[TRUNC]](s1)
2036 ; FAST-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
2037 ; FAST-NEXT: G_BR %bb.2
2040 ; FAST-NEXT: successors: %bb.2(0x80000000)
2042 ; FAST-NEXT: [[TRUNC2:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY1]](s32)
2043 ; FAST-NEXT: [[ANYEXT1:%[0-9]+]]:vgpr(s32) = G_ANYEXT [[TRUNC2]](s1)
2044 ; FAST-NEXT: G_BR %bb.2
2047 ; FAST-NEXT: [[PHI:%[0-9]+]]:vgpr(s32) = G_PHI [[ANYEXT]](s32), %bb.0, [[ANYEXT1]](s32), %bb.1
2048 ; FAST-NEXT: [[TRUNC3:%[0-9]+]]:vgpr(s1) = G_TRUNC [[PHI]](s32)
2049 ; FAST-NEXT: [[COPY3:%[0-9]+]]:vcc(s1) = COPY [[TRUNC3]](s1)
2050 ; FAST-NEXT: [[COPY4:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
2051 ; FAST-NEXT: [[COPY5:%[0-9]+]]:vgpr(s32) = COPY [[COPY]](s32)
2052 ; FAST-NEXT: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[COPY3]](s1), [[COPY4]], [[COPY5]]
2053 ; FAST-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31, implicit [[SELECT]](s32)
2054 ; GREEDY-LABEL: name: phi_s1_s_v_sbranch
2056 ; GREEDY-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
2057 ; GREEDY-NEXT: liveins: $vgpr0, $sgpr0, $sgpr1
2058 ; GREEDY-NEXT: {{ $}}
2059 ; GREEDY-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
2060 ; GREEDY-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
2061 ; GREEDY-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
2062 ; GREEDY-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
2063 ; GREEDY-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[COPY]](s32)
2064 ; GREEDY-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
2065 ; GREEDY-NEXT: [[TRUNC1:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
2066 ; GREEDY-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC1]](s1)
2067 ; GREEDY-NEXT: [[ANYEXT:%[0-9]+]]:vgpr(s32) = G_ANYEXT [[TRUNC]](s1)
2068 ; GREEDY-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
2069 ; GREEDY-NEXT: G_BR %bb.2
2070 ; GREEDY-NEXT: {{ $}}
2071 ; GREEDY-NEXT: bb.1:
2072 ; GREEDY-NEXT: successors: %bb.2(0x80000000)
2073 ; GREEDY-NEXT: {{ $}}
2074 ; GREEDY-NEXT: [[TRUNC2:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY1]](s32)
2075 ; GREEDY-NEXT: [[ANYEXT1:%[0-9]+]]:vgpr(s32) = G_ANYEXT [[TRUNC2]](s1)
2076 ; GREEDY-NEXT: G_BR %bb.2
2077 ; GREEDY-NEXT: {{ $}}
2078 ; GREEDY-NEXT: bb.2:
2079 ; GREEDY-NEXT: [[PHI:%[0-9]+]]:vgpr(s32) = G_PHI [[ANYEXT]](s32), %bb.0, [[ANYEXT1]](s32), %bb.1
2080 ; GREEDY-NEXT: [[TRUNC3:%[0-9]+]]:vgpr(s1) = G_TRUNC [[PHI]](s32)
2081 ; GREEDY-NEXT: [[COPY3:%[0-9]+]]:vcc(s1) = COPY [[TRUNC3]](s1)
2082 ; GREEDY-NEXT: [[COPY4:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
2083 ; GREEDY-NEXT: [[COPY5:%[0-9]+]]:vgpr(s32) = COPY [[COPY]](s32)
2084 ; GREEDY-NEXT: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[COPY3]](s1), [[COPY4]], [[COPY5]]
2085 ; GREEDY-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31, implicit [[SELECT]](s32)
2087 successors: %bb.1, %bb.2
2088 liveins: $vgpr0, $sgpr0, $sgpr1
2090 %0:_(s32) = COPY $sgpr0
2091 %1:_(s32) = COPY $vgpr0
2092 %2:_(s32) = COPY $sgpr1
2093 %3:_(s32) = G_CONSTANT i32 0
2094 %4:_(s1) = G_TRUNC %0
2095 %5:_(s1) = G_ICMP intpred(eq), %2, %3
2102 %6:_(s1) = G_TRUNC %1
2106 %7:_(s1) = G_PHI %4, %bb.0, %6, %bb.1
2107 %8:_(s32) = G_SELECT %7, %3, %0
2108 S_SETPC_B64 undef $sgpr30_sgpr31, implicit %8
2113 name: phi_s1_v_v_sbranch
2115 tracksRegLiveness: true
2118 ; FAST-LABEL: name: phi_s1_v_v_sbranch
2120 ; FAST-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
2121 ; FAST-NEXT: liveins: $vgpr0, $vgpr1, $sgpr0
2123 ; FAST-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
2124 ; FAST-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
2125 ; FAST-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
2126 ; FAST-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
2127 ; FAST-NEXT: [[TRUNC:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY]](s32)
2128 ; FAST-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
2129 ; FAST-NEXT: [[TRUNC1:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
2130 ; FAST-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC1]](s1)
2131 ; FAST-NEXT: [[ANYEXT:%[0-9]+]]:vgpr(s32) = G_ANYEXT [[TRUNC]](s1)
2132 ; FAST-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
2133 ; FAST-NEXT: G_BR %bb.2
2136 ; FAST-NEXT: successors: %bb.2(0x80000000)
2138 ; FAST-NEXT: [[TRUNC2:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY1]](s32)
2139 ; FAST-NEXT: [[ANYEXT1:%[0-9]+]]:vgpr(s32) = G_ANYEXT [[TRUNC2]](s1)
2140 ; FAST-NEXT: G_BR %bb.2
2143 ; FAST-NEXT: [[PHI:%[0-9]+]]:vgpr(s32) = G_PHI [[ANYEXT]](s32), %bb.0, [[ANYEXT1]](s32), %bb.1
2144 ; FAST-NEXT: [[TRUNC3:%[0-9]+]]:vgpr(s1) = G_TRUNC [[PHI]](s32)
2145 ; FAST-NEXT: [[COPY3:%[0-9]+]]:vcc(s1) = COPY [[TRUNC3]](s1)
2146 ; FAST-NEXT: [[COPY4:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
2147 ; FAST-NEXT: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[COPY3]](s1), [[COPY4]], [[COPY]]
2148 ; FAST-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31, implicit [[SELECT]](s32)
2149 ; GREEDY-LABEL: name: phi_s1_v_v_sbranch
2151 ; GREEDY-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
2152 ; GREEDY-NEXT: liveins: $vgpr0, $vgpr1, $sgpr0
2153 ; GREEDY-NEXT: {{ $}}
2154 ; GREEDY-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
2155 ; GREEDY-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
2156 ; GREEDY-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
2157 ; GREEDY-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
2158 ; GREEDY-NEXT: [[TRUNC:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY]](s32)
2159 ; GREEDY-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
2160 ; GREEDY-NEXT: [[TRUNC1:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
2161 ; GREEDY-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC1]](s1)
2162 ; GREEDY-NEXT: [[ANYEXT:%[0-9]+]]:vgpr(s32) = G_ANYEXT [[TRUNC]](s1)
2163 ; GREEDY-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
2164 ; GREEDY-NEXT: G_BR %bb.2
2165 ; GREEDY-NEXT: {{ $}}
2166 ; GREEDY-NEXT: bb.1:
2167 ; GREEDY-NEXT: successors: %bb.2(0x80000000)
2168 ; GREEDY-NEXT: {{ $}}
2169 ; GREEDY-NEXT: [[TRUNC2:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY1]](s32)
2170 ; GREEDY-NEXT: [[ANYEXT1:%[0-9]+]]:vgpr(s32) = G_ANYEXT [[TRUNC2]](s1)
2171 ; GREEDY-NEXT: G_BR %bb.2
2172 ; GREEDY-NEXT: {{ $}}
2173 ; GREEDY-NEXT: bb.2:
2174 ; GREEDY-NEXT: [[PHI:%[0-9]+]]:vgpr(s32) = G_PHI [[ANYEXT]](s32), %bb.0, [[ANYEXT1]](s32), %bb.1
2175 ; GREEDY-NEXT: [[TRUNC3:%[0-9]+]]:vgpr(s1) = G_TRUNC [[PHI]](s32)
2176 ; GREEDY-NEXT: [[COPY3:%[0-9]+]]:vcc(s1) = COPY [[TRUNC3]](s1)
2177 ; GREEDY-NEXT: [[COPY4:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
2178 ; GREEDY-NEXT: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[COPY3]](s1), [[COPY4]], [[COPY]]
2179 ; GREEDY-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31, implicit [[SELECT]](s32)
2181 successors: %bb.1, %bb.2
2182 liveins: $vgpr0, $vgpr1, $sgpr0
2184 %0:_(s32) = COPY $vgpr0
2185 %1:_(s32) = COPY $vgpr1
2186 %2:_(s32) = COPY $sgpr0
2187 %3:_(s32) = G_CONSTANT i32 0
2188 %4:_(s1) = G_TRUNC %0
2189 %5:_(s1) = G_ICMP intpred(eq), %2, %3
2196 %6:_(s1) = G_TRUNC %1
2200 %7:_(s1) = G_PHI %4, %bb.0, %6, %bb.1
2201 %8:_(s32) = G_SELECT %7, %3, %0
2202 S_SETPC_B64 undef $sgpr30_sgpr31, implicit %8
2207 name: phi_s1_s_s_sbranch
2209 tracksRegLiveness: true
2212 ; FAST-LABEL: name: phi_s1_s_s_sbranch
2214 ; FAST-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
2215 ; FAST-NEXT: liveins: $sgpr0, $sgpr1, $sgpr2
2217 ; FAST-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
2218 ; FAST-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
2219 ; FAST-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr2
2220 ; FAST-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
2221 ; FAST-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[COPY]](s32)
2222 ; FAST-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
2223 ; FAST-NEXT: [[TRUNC1:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
2224 ; FAST-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC1]](s1)
2225 ; FAST-NEXT: [[ANYEXT:%[0-9]+]]:sgpr(s32) = G_ANYEXT [[TRUNC]](s1)
2226 ; FAST-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
2227 ; FAST-NEXT: G_BR %bb.2
2230 ; FAST-NEXT: successors: %bb.2(0x80000000)
2232 ; FAST-NEXT: [[TRUNC2:%[0-9]+]]:sgpr(s1) = G_TRUNC [[COPY1]](s32)
2233 ; FAST-NEXT: [[ANYEXT1:%[0-9]+]]:sgpr(s32) = G_ANYEXT [[TRUNC2]](s1)
2234 ; FAST-NEXT: G_BR %bb.2
2237 ; FAST-NEXT: [[PHI:%[0-9]+]]:sgpr(s32) = G_PHI [[ANYEXT]](s32), %bb.0, [[ANYEXT1]](s32), %bb.1
2238 ; FAST-NEXT: [[TRUNC3:%[0-9]+]]:sgpr(s1) = G_TRUNC [[PHI]](s32)
2239 ; FAST-NEXT: [[ZEXT1:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC3]](s1)
2240 ; FAST-NEXT: [[SELECT:%[0-9]+]]:sgpr(s32) = G_SELECT [[ZEXT1]](s32), [[C]], [[COPY]]
2241 ; FAST-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31, implicit [[SELECT]](s32)
2242 ; GREEDY-LABEL: name: phi_s1_s_s_sbranch
2244 ; GREEDY-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
2245 ; GREEDY-NEXT: liveins: $sgpr0, $sgpr1, $sgpr2
2246 ; GREEDY-NEXT: {{ $}}
2247 ; GREEDY-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
2248 ; GREEDY-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
2249 ; GREEDY-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr2
2250 ; GREEDY-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
2251 ; GREEDY-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[COPY]](s32)
2252 ; GREEDY-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
2253 ; GREEDY-NEXT: [[TRUNC1:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
2254 ; GREEDY-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC1]](s1)
2255 ; GREEDY-NEXT: [[ANYEXT:%[0-9]+]]:sgpr(s32) = G_ANYEXT [[TRUNC]](s1)
2256 ; GREEDY-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
2257 ; GREEDY-NEXT: G_BR %bb.2
2258 ; GREEDY-NEXT: {{ $}}
2259 ; GREEDY-NEXT: bb.1:
2260 ; GREEDY-NEXT: successors: %bb.2(0x80000000)
2261 ; GREEDY-NEXT: {{ $}}
2262 ; GREEDY-NEXT: [[TRUNC2:%[0-9]+]]:sgpr(s1) = G_TRUNC [[COPY1]](s32)
2263 ; GREEDY-NEXT: [[ANYEXT1:%[0-9]+]]:sgpr(s32) = G_ANYEXT [[TRUNC2]](s1)
2264 ; GREEDY-NEXT: G_BR %bb.2
2265 ; GREEDY-NEXT: {{ $}}
2266 ; GREEDY-NEXT: bb.2:
2267 ; GREEDY-NEXT: [[PHI:%[0-9]+]]:sgpr(s32) = G_PHI [[ANYEXT]](s32), %bb.0, [[ANYEXT1]](s32), %bb.1
2268 ; GREEDY-NEXT: [[TRUNC3:%[0-9]+]]:sgpr(s1) = G_TRUNC [[PHI]](s32)
2269 ; GREEDY-NEXT: [[ZEXT1:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC3]](s1)
2270 ; GREEDY-NEXT: [[SELECT:%[0-9]+]]:sgpr(s32) = G_SELECT [[ZEXT1]](s32), [[C]], [[COPY]]
2271 ; GREEDY-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31, implicit [[SELECT]](s32)
2273 successors: %bb.1, %bb.2
2274 liveins: $sgpr0, $sgpr1, $sgpr2
2276 %0:_(s32) = COPY $sgpr0
2277 %1:_(s32) = COPY $sgpr1
2278 %2:_(s32) = COPY $sgpr2
2279 %3:_(s32) = G_CONSTANT i32 0
2280 %4:_(s1) = G_TRUNC %0
2281 %5:_(s1) = G_ICMP intpred(eq), %2, %3
2288 %6:_(s1) = G_TRUNC %1
2292 %7:_(s1) = G_PHI %4, %bb.0, %6, %bb.1
2293 %8:_(s32) = G_SELECT %7, %3, %0
2294 S_SETPC_B64 undef $sgpr30_sgpr31, implicit %8
2298 # Test a phi where the VGPR input is after the phi itself
2300 name: phi_s32_s_loop_v_sbranch
2302 tracksRegLiveness: true
2305 ; FAST-LABEL: name: phi_s32_s_loop_v_sbranch
2307 ; FAST-NEXT: successors: %bb.1(0x80000000)
2308 ; FAST-NEXT: liveins: $sgpr0, $sgpr1, $vgpr0
2310 ; FAST-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
2311 ; FAST-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
2312 ; FAST-NEXT: [[COPY2:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
2313 ; FAST-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
2314 ; FAST-NEXT: G_BR %bb.1
2317 ; FAST-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
2319 ; FAST-NEXT: [[PHI:%[0-9]+]]:vgpr(s32) = G_PHI [[COPY]](s32), %bb.0, %5(s32), %bb.1
2320 ; FAST-NEXT: [[COPY3:%[0-9]+]]:vgpr(s32) = COPY [[COPY2]](s32)
2321 ; FAST-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY1]](s32), [[C]]
2322 ; FAST-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
2323 ; FAST-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s1)
2324 ; FAST-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
2325 ; FAST-NEXT: G_BR %bb.2
2328 ; FAST-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31, implicit [[PHI]](s32)
2329 ; GREEDY-LABEL: name: phi_s32_s_loop_v_sbranch
2331 ; GREEDY-NEXT: successors: %bb.1(0x80000000)
2332 ; GREEDY-NEXT: liveins: $sgpr0, $sgpr1, $vgpr0
2333 ; GREEDY-NEXT: {{ $}}
2334 ; GREEDY-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
2335 ; GREEDY-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
2336 ; GREEDY-NEXT: [[COPY2:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
2337 ; GREEDY-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
2338 ; GREEDY-NEXT: G_BR %bb.1
2339 ; GREEDY-NEXT: {{ $}}
2340 ; GREEDY-NEXT: bb.1:
2341 ; GREEDY-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
2342 ; GREEDY-NEXT: {{ $}}
2343 ; GREEDY-NEXT: [[PHI:%[0-9]+]]:vgpr(s32) = G_PHI [[COPY]](s32), %bb.0, %5(s32), %bb.1
2344 ; GREEDY-NEXT: [[COPY3:%[0-9]+]]:vgpr(s32) = COPY [[COPY2]](s32)
2345 ; GREEDY-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY1]](s32), [[C]]
2346 ; GREEDY-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
2347 ; GREEDY-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s1)
2348 ; GREEDY-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
2349 ; GREEDY-NEXT: G_BR %bb.2
2350 ; GREEDY-NEXT: {{ $}}
2351 ; GREEDY-NEXT: bb.2:
2352 ; GREEDY-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31, implicit [[PHI]](s32)
2355 liveins: $sgpr0, $sgpr1, $vgpr0
2357 %0:_(s32) = COPY $sgpr0
2358 %1:_(s32) = COPY $sgpr1
2359 %2:_(s32) = COPY $vgpr0
2360 %3:_(s32) = G_CONSTANT i32 0
2364 successors: %bb.1, %bb.2
2366 %4:_(s32) = G_PHI %0, %bb.0, %5, %bb.1
2368 %6:_(s1) = G_ICMP intpred(eq), %1, %3
2373 S_SETPC_B64 undef $sgpr30_sgpr31, implicit %4
2377 # Test a phi where an SGPR input is after the phi itself
2379 name: phi_s32_s_loop_s_sbranch
2381 tracksRegLiveness: true
2384 ; FAST-LABEL: name: phi_s32_s_loop_s_sbranch
2386 ; FAST-NEXT: successors: %bb.1(0x80000000)
2387 ; FAST-NEXT: liveins: $sgpr0, $sgpr1, $sgpr2
2389 ; FAST-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
2390 ; FAST-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
2391 ; FAST-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr2
2392 ; FAST-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
2393 ; FAST-NEXT: G_BR %bb.1
2396 ; FAST-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
2398 ; FAST-NEXT: [[PHI:%[0-9]+]]:vgpr(s32) = G_PHI [[COPY]](s32), %bb.0, %5(s32), %bb.1
2399 ; FAST-NEXT: [[COPY3:%[0-9]+]]:sgpr(s32) = COPY [[COPY2]](s32)
2400 ; FAST-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY1]](s32), [[C]]
2401 ; FAST-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
2402 ; FAST-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s1)
2403 ; FAST-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
2404 ; FAST-NEXT: G_BR %bb.2
2407 ; FAST-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31, implicit [[PHI]](s32)
2408 ; GREEDY-LABEL: name: phi_s32_s_loop_s_sbranch
2410 ; GREEDY-NEXT: successors: %bb.1(0x80000000)
2411 ; GREEDY-NEXT: liveins: $sgpr0, $sgpr1, $sgpr2
2412 ; GREEDY-NEXT: {{ $}}
2413 ; GREEDY-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
2414 ; GREEDY-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
2415 ; GREEDY-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr2
2416 ; GREEDY-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
2417 ; GREEDY-NEXT: G_BR %bb.1
2418 ; GREEDY-NEXT: {{ $}}
2419 ; GREEDY-NEXT: bb.1:
2420 ; GREEDY-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
2421 ; GREEDY-NEXT: {{ $}}
2422 ; GREEDY-NEXT: [[PHI:%[0-9]+]]:vgpr(s32) = G_PHI [[COPY]](s32), %bb.0, %5(s32), %bb.1
2423 ; GREEDY-NEXT: [[COPY3:%[0-9]+]]:sgpr(s32) = COPY [[COPY2]](s32)
2424 ; GREEDY-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY1]](s32), [[C]]
2425 ; GREEDY-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
2426 ; GREEDY-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s1)
2427 ; GREEDY-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
2428 ; GREEDY-NEXT: G_BR %bb.2
2429 ; GREEDY-NEXT: {{ $}}
2430 ; GREEDY-NEXT: bb.2:
2431 ; GREEDY-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31, implicit [[PHI]](s32)
2434 liveins: $sgpr0, $sgpr1, $sgpr2
2436 %0:_(s32) = COPY $sgpr0
2437 %1:_(s32) = COPY $sgpr1
2438 %2:_(s32) = COPY $sgpr2
2439 %3:_(s32) = G_CONSTANT i32 0
2443 successors: %bb.1, %bb.2
2445 %4:_(s32) = G_PHI %0, %bb.0, %5, %bb.1
2447 %6:_(s1) = G_ICMP intpred(eq), %1, %3
2452 S_SETPC_B64 undef $sgpr30_sgpr31, implicit %4
2457 name: phi_s32_ss_sbranch_cycle
2459 tracksRegLiveness: true
2462 ; FAST-LABEL: name: phi_s32_ss_sbranch_cycle
2464 ; FAST-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
2465 ; FAST-NEXT: liveins: $sgpr0, $sgpr1, $sgpr2
2467 ; FAST-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
2468 ; FAST-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
2469 ; FAST-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr2
2470 ; FAST-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
2471 ; FAST-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
2472 ; FAST-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
2473 ; FAST-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s1)
2474 ; FAST-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
2475 ; FAST-NEXT: G_BR %bb.2
2478 ; FAST-NEXT: successors: %bb.2(0x80000000)
2480 ; FAST-NEXT: [[PHI:%[0-9]+]]:vgpr(s32) = G_PHI [[COPY]](s32), %bb.0, %6(s32), %bb.2
2481 ; FAST-NEXT: G_BR %bb.2
2484 ; FAST-NEXT: successors: %bb.1(0x80000000)
2486 ; FAST-NEXT: [[PHI1:%[0-9]+]]:vgpr(s32) = G_PHI [[COPY]](s32), %bb.0, [[PHI]](s32), %bb.1
2487 ; FAST-NEXT: G_BR %bb.1
2488 ; GREEDY-LABEL: name: phi_s32_ss_sbranch_cycle
2490 ; GREEDY-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
2491 ; GREEDY-NEXT: liveins: $sgpr0, $sgpr1, $sgpr2
2492 ; GREEDY-NEXT: {{ $}}
2493 ; GREEDY-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
2494 ; GREEDY-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
2495 ; GREEDY-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr2
2496 ; GREEDY-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
2497 ; GREEDY-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
2498 ; GREEDY-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
2499 ; GREEDY-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s1)
2500 ; GREEDY-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
2501 ; GREEDY-NEXT: G_BR %bb.2
2502 ; GREEDY-NEXT: {{ $}}
2503 ; GREEDY-NEXT: bb.1:
2504 ; GREEDY-NEXT: successors: %bb.2(0x80000000)
2505 ; GREEDY-NEXT: {{ $}}
2506 ; GREEDY-NEXT: [[PHI:%[0-9]+]]:vgpr(s32) = G_PHI [[COPY]](s32), %bb.0, %6(s32), %bb.2
2507 ; GREEDY-NEXT: G_BR %bb.2
2508 ; GREEDY-NEXT: {{ $}}
2509 ; GREEDY-NEXT: bb.2:
2510 ; GREEDY-NEXT: successors: %bb.1(0x80000000)
2511 ; GREEDY-NEXT: {{ $}}
2512 ; GREEDY-NEXT: [[PHI1:%[0-9]+]]:vgpr(s32) = G_PHI [[COPY]](s32), %bb.0, [[PHI]](s32), %bb.1
2513 ; GREEDY-NEXT: G_BR %bb.1
2515 successors: %bb.1, %bb.2
2516 liveins: $sgpr0, $sgpr1, $sgpr2
2518 %0:_(s32) = COPY $sgpr0
2519 %1:_(s32) = COPY $sgpr1
2520 %2:_(s32) = COPY $sgpr2
2521 %3:_(s32) = G_CONSTANT i32 0
2522 %4:_(s1) = G_ICMP intpred(eq), %2, %3
2528 %5:_(s32) = G_PHI %0, %bb.0, %6, %bb.2
2533 %6:_(s32) = G_PHI %0, %bb.0, %5, %bb.1
2538 name: phi_s32_vs_sbranch_cycle
2540 tracksRegLiveness: true
2543 ; FAST-LABEL: name: phi_s32_vs_sbranch_cycle
2545 ; FAST-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
2546 ; FAST-NEXT: liveins: $vgpr0, $sgpr1, $sgpr2
2548 ; FAST-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
2549 ; FAST-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
2550 ; FAST-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr2
2551 ; FAST-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
2552 ; FAST-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
2553 ; FAST-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
2554 ; FAST-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s1)
2555 ; FAST-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
2556 ; FAST-NEXT: G_BR %bb.2
2559 ; FAST-NEXT: successors: %bb.2(0x80000000)
2561 ; FAST-NEXT: [[PHI:%[0-9]+]]:vgpr(s32) = G_PHI [[COPY]](s32), %bb.0, %6(s32), %bb.2
2562 ; FAST-NEXT: G_BR %bb.2
2565 ; FAST-NEXT: successors: %bb.1(0x80000000)
2567 ; FAST-NEXT: [[PHI1:%[0-9]+]]:vgpr(s32) = G_PHI [[COPY]](s32), %bb.0, [[PHI]](s32), %bb.1
2568 ; FAST-NEXT: G_BR %bb.1
2569 ; GREEDY-LABEL: name: phi_s32_vs_sbranch_cycle
2571 ; GREEDY-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
2572 ; GREEDY-NEXT: liveins: $vgpr0, $sgpr1, $sgpr2
2573 ; GREEDY-NEXT: {{ $}}
2574 ; GREEDY-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
2575 ; GREEDY-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
2576 ; GREEDY-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr2
2577 ; GREEDY-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
2578 ; GREEDY-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
2579 ; GREEDY-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
2580 ; GREEDY-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s1)
2581 ; GREEDY-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
2582 ; GREEDY-NEXT: G_BR %bb.2
2583 ; GREEDY-NEXT: {{ $}}
2584 ; GREEDY-NEXT: bb.1:
2585 ; GREEDY-NEXT: successors: %bb.2(0x80000000)
2586 ; GREEDY-NEXT: {{ $}}
2587 ; GREEDY-NEXT: [[PHI:%[0-9]+]]:vgpr(s32) = G_PHI [[COPY]](s32), %bb.0, %6(s32), %bb.2
2588 ; GREEDY-NEXT: G_BR %bb.2
2589 ; GREEDY-NEXT: {{ $}}
2590 ; GREEDY-NEXT: bb.2:
2591 ; GREEDY-NEXT: successors: %bb.1(0x80000000)
2592 ; GREEDY-NEXT: {{ $}}
2593 ; GREEDY-NEXT: [[PHI1:%[0-9]+]]:vgpr(s32) = G_PHI [[COPY]](s32), %bb.0, [[PHI]](s32), %bb.1
2594 ; GREEDY-NEXT: G_BR %bb.1
2596 successors: %bb.1, %bb.2
2597 liveins: $vgpr0, $sgpr1, $sgpr2
2599 %0:_(s32) = COPY $vgpr0
2600 %1:_(s32) = COPY $sgpr1
2601 %2:_(s32) = COPY $sgpr2
2602 %3:_(s32) = G_CONSTANT i32 0
2603 %4:_(s1) = G_ICMP intpred(eq), %2, %3
2609 %5:_(s32) = G_PHI %0, %bb.0, %6, %bb.2
2614 %6:_(s32) = G_PHI %0, %bb.0, %5, %bb.1
2619 name: phi_s32_aa_sbranch
2621 tracksRegLiveness: true
2624 ; FAST-LABEL: name: phi_s32_aa_sbranch
2626 ; FAST-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
2627 ; FAST-NEXT: liveins: $agpr0, $agpr1, $sgpr2
2629 ; FAST-NEXT: [[COPY:%[0-9]+]]:agpr(s32) = COPY $agpr0
2630 ; FAST-NEXT: [[COPY1:%[0-9]+]]:agpr(s32) = COPY $agpr1
2631 ; FAST-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr2
2632 ; FAST-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
2633 ; FAST-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
2634 ; FAST-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
2635 ; FAST-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s1)
2636 ; FAST-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
2637 ; FAST-NEXT: G_BR %bb.2
2640 ; FAST-NEXT: successors: %bb.2(0x80000000)
2642 ; FAST-NEXT: [[COPY3:%[0-9]+]]:agpr(s32) = COPY [[COPY1]](s32)
2643 ; FAST-NEXT: G_BR %bb.2
2646 ; FAST-NEXT: [[PHI:%[0-9]+]]:agpr(s32) = G_PHI [[COPY]](s32), %bb.0, [[COPY3]](s32), %bb.1
2647 ; FAST-NEXT: $agpr0 = COPY [[PHI]](s32)
2648 ; FAST-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31
2649 ; GREEDY-LABEL: name: phi_s32_aa_sbranch
2651 ; GREEDY-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
2652 ; GREEDY-NEXT: liveins: $agpr0, $agpr1, $sgpr2
2653 ; GREEDY-NEXT: {{ $}}
2654 ; GREEDY-NEXT: [[COPY:%[0-9]+]]:agpr(s32) = COPY $agpr0
2655 ; GREEDY-NEXT: [[COPY1:%[0-9]+]]:agpr(s32) = COPY $agpr1
2656 ; GREEDY-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr2
2657 ; GREEDY-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
2658 ; GREEDY-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
2659 ; GREEDY-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
2660 ; GREEDY-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s1)
2661 ; GREEDY-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
2662 ; GREEDY-NEXT: G_BR %bb.2
2663 ; GREEDY-NEXT: {{ $}}
2664 ; GREEDY-NEXT: bb.1:
2665 ; GREEDY-NEXT: successors: %bb.2(0x80000000)
2666 ; GREEDY-NEXT: {{ $}}
2667 ; GREEDY-NEXT: [[COPY3:%[0-9]+]]:agpr(s32) = COPY [[COPY1]](s32)
2668 ; GREEDY-NEXT: G_BR %bb.2
2669 ; GREEDY-NEXT: {{ $}}
2670 ; GREEDY-NEXT: bb.2:
2671 ; GREEDY-NEXT: [[PHI:%[0-9]+]]:agpr(s32) = G_PHI [[COPY]](s32), %bb.0, [[COPY3]](s32), %bb.1
2672 ; GREEDY-NEXT: $agpr0 = COPY [[PHI]](s32)
2673 ; GREEDY-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31
2675 successors: %bb.1, %bb.2
2676 liveins: $agpr0, $agpr1, $sgpr2
2678 %0:_(s32) = COPY $agpr0
2679 %1:_(s32) = COPY $agpr1
2680 %2:_(s32) = COPY $sgpr2
2681 %3:_(s32) = G_CONSTANT i32 0
2682 %4:_(s1) = G_ICMP intpred(eq), %2, %3
2693 %6:_(s32) = G_PHI %0, %bb.0, %5, %bb.1
2695 S_SETPC_B64 undef $sgpr30_sgpr31
2700 name: phi_s32_av_sbranch
2702 tracksRegLiveness: true
2705 ; FAST-LABEL: name: phi_s32_av_sbranch
2707 ; FAST-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
2708 ; FAST-NEXT: liveins: $agpr0, $vgpr0, $sgpr2
2710 ; FAST-NEXT: [[COPY:%[0-9]+]]:agpr(s32) = COPY $agpr0
2711 ; FAST-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
2712 ; FAST-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr2
2713 ; FAST-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
2714 ; FAST-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
2715 ; FAST-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
2716 ; FAST-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s1)
2717 ; FAST-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
2718 ; FAST-NEXT: G_BR %bb.2
2721 ; FAST-NEXT: successors: %bb.2(0x80000000)
2723 ; FAST-NEXT: [[COPY3:%[0-9]+]]:vgpr(s32) = COPY [[COPY1]](s32)
2724 ; FAST-NEXT: G_BR %bb.2
2727 ; FAST-NEXT: [[PHI:%[0-9]+]]:vgpr(s32) = G_PHI [[COPY]](s32), %bb.0, [[COPY3]](s32), %bb.1
2728 ; FAST-NEXT: $agpr0 = COPY [[PHI]](s32)
2729 ; FAST-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31
2730 ; GREEDY-LABEL: name: phi_s32_av_sbranch
2732 ; GREEDY-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
2733 ; GREEDY-NEXT: liveins: $agpr0, $vgpr0, $sgpr2
2734 ; GREEDY-NEXT: {{ $}}
2735 ; GREEDY-NEXT: [[COPY:%[0-9]+]]:agpr(s32) = COPY $agpr0
2736 ; GREEDY-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
2737 ; GREEDY-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr2
2738 ; GREEDY-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
2739 ; GREEDY-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
2740 ; GREEDY-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
2741 ; GREEDY-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s1)
2742 ; GREEDY-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
2743 ; GREEDY-NEXT: G_BR %bb.2
2744 ; GREEDY-NEXT: {{ $}}
2745 ; GREEDY-NEXT: bb.1:
2746 ; GREEDY-NEXT: successors: %bb.2(0x80000000)
2747 ; GREEDY-NEXT: {{ $}}
2748 ; GREEDY-NEXT: [[COPY3:%[0-9]+]]:vgpr(s32) = COPY [[COPY1]](s32)
2749 ; GREEDY-NEXT: G_BR %bb.2
2750 ; GREEDY-NEXT: {{ $}}
2751 ; GREEDY-NEXT: bb.2:
2752 ; GREEDY-NEXT: [[PHI:%[0-9]+]]:vgpr(s32) = G_PHI [[COPY]](s32), %bb.0, [[COPY3]](s32), %bb.1
2753 ; GREEDY-NEXT: $agpr0 = COPY [[PHI]](s32)
2754 ; GREEDY-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31
2756 successors: %bb.1, %bb.2
2757 liveins: $agpr0, $vgpr0, $sgpr2
2759 %0:_(s32) = COPY $agpr0
2760 %1:_(s32) = COPY $vgpr0
2761 %2:_(s32) = COPY $sgpr2
2762 %3:_(s32) = G_CONSTANT i32 0
2763 %4:_(s1) = G_ICMP intpred(eq), %2, %3
2774 %6:_(s32) = G_PHI %0, %bb.0, %5, %bb.1
2776 S_SETPC_B64 undef $sgpr30_sgpr31
2780 name: phi_s32_va_sbranch
2782 tracksRegLiveness: true
2785 ; FAST-LABEL: name: phi_s32_va_sbranch
2787 ; FAST-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
2788 ; FAST-NEXT: liveins: $agpr0, $vgpr0, $sgpr2
2790 ; FAST-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
2791 ; FAST-NEXT: [[COPY1:%[0-9]+]]:agpr(s32) = COPY $agpr0
2792 ; FAST-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr2
2793 ; FAST-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
2794 ; FAST-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
2795 ; FAST-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
2796 ; FAST-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s1)
2797 ; FAST-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
2798 ; FAST-NEXT: G_BR %bb.2
2801 ; FAST-NEXT: successors: %bb.2(0x80000000)
2803 ; FAST-NEXT: [[COPY3:%[0-9]+]]:agpr(s32) = COPY [[COPY1]](s32)
2804 ; FAST-NEXT: G_BR %bb.2
2807 ; FAST-NEXT: [[PHI:%[0-9]+]]:vgpr(s32) = G_PHI [[COPY]](s32), %bb.0, [[COPY3]](s32), %bb.1
2808 ; FAST-NEXT: $agpr0 = COPY [[PHI]](s32)
2809 ; FAST-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31
2810 ; GREEDY-LABEL: name: phi_s32_va_sbranch
2812 ; GREEDY-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
2813 ; GREEDY-NEXT: liveins: $agpr0, $vgpr0, $sgpr2
2814 ; GREEDY-NEXT: {{ $}}
2815 ; GREEDY-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
2816 ; GREEDY-NEXT: [[COPY1:%[0-9]+]]:agpr(s32) = COPY $agpr0
2817 ; GREEDY-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr2
2818 ; GREEDY-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
2819 ; GREEDY-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
2820 ; GREEDY-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
2821 ; GREEDY-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s1)
2822 ; GREEDY-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
2823 ; GREEDY-NEXT: G_BR %bb.2
2824 ; GREEDY-NEXT: {{ $}}
2825 ; GREEDY-NEXT: bb.1:
2826 ; GREEDY-NEXT: successors: %bb.2(0x80000000)
2827 ; GREEDY-NEXT: {{ $}}
2828 ; GREEDY-NEXT: [[COPY3:%[0-9]+]]:agpr(s32) = COPY [[COPY1]](s32)
2829 ; GREEDY-NEXT: G_BR %bb.2
2830 ; GREEDY-NEXT: {{ $}}
2831 ; GREEDY-NEXT: bb.2:
2832 ; GREEDY-NEXT: [[PHI:%[0-9]+]]:vgpr(s32) = G_PHI [[COPY]](s32), %bb.0, [[COPY3]](s32), %bb.1
2833 ; GREEDY-NEXT: $agpr0 = COPY [[PHI]](s32)
2834 ; GREEDY-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31
2836 successors: %bb.1, %bb.2
2837 liveins: $agpr0, $vgpr0, $sgpr2
2839 %0:_(s32) = COPY $vgpr0
2840 %1:_(s32) = COPY $agpr0
2841 %2:_(s32) = COPY $sgpr2
2842 %3:_(s32) = G_CONSTANT i32 0
2843 %4:_(s1) = G_ICMP intpred(eq), %2, %3
2854 %6:_(s32) = G_PHI %0, %bb.0, %5, %bb.1
2856 S_SETPC_B64 undef $sgpr30_sgpr31
2861 name: phi_s32_as_sbranch
2863 tracksRegLiveness: true
2866 ; FAST-LABEL: name: phi_s32_as_sbranch
2868 ; FAST-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
2869 ; FAST-NEXT: liveins: $agpr0, $sgpr0, $sgpr2
2871 ; FAST-NEXT: [[COPY:%[0-9]+]]:agpr(s32) = COPY $agpr0
2872 ; FAST-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
2873 ; FAST-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr2
2874 ; FAST-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
2875 ; FAST-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
2876 ; FAST-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
2877 ; FAST-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s1)
2878 ; FAST-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
2879 ; FAST-NEXT: G_BR %bb.2
2882 ; FAST-NEXT: successors: %bb.2(0x80000000)
2884 ; FAST-NEXT: [[COPY3:%[0-9]+]]:sgpr(s32) = COPY [[COPY1]](s32)
2885 ; FAST-NEXT: G_BR %bb.2
2888 ; FAST-NEXT: [[PHI:%[0-9]+]]:vgpr(s32) = G_PHI [[COPY]](s32), %bb.0, [[COPY3]](s32), %bb.1
2889 ; FAST-NEXT: $agpr0 = COPY [[PHI]](s32)
2890 ; FAST-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31
2891 ; GREEDY-LABEL: name: phi_s32_as_sbranch
2893 ; GREEDY-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
2894 ; GREEDY-NEXT: liveins: $agpr0, $sgpr0, $sgpr2
2895 ; GREEDY-NEXT: {{ $}}
2896 ; GREEDY-NEXT: [[COPY:%[0-9]+]]:agpr(s32) = COPY $agpr0
2897 ; GREEDY-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
2898 ; GREEDY-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr2
2899 ; GREEDY-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
2900 ; GREEDY-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
2901 ; GREEDY-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
2902 ; GREEDY-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s1)
2903 ; GREEDY-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
2904 ; GREEDY-NEXT: G_BR %bb.2
2905 ; GREEDY-NEXT: {{ $}}
2906 ; GREEDY-NEXT: bb.1:
2907 ; GREEDY-NEXT: successors: %bb.2(0x80000000)
2908 ; GREEDY-NEXT: {{ $}}
2909 ; GREEDY-NEXT: [[COPY3:%[0-9]+]]:sgpr(s32) = COPY [[COPY1]](s32)
2910 ; GREEDY-NEXT: G_BR %bb.2
2911 ; GREEDY-NEXT: {{ $}}
2912 ; GREEDY-NEXT: bb.2:
2913 ; GREEDY-NEXT: [[PHI:%[0-9]+]]:vgpr(s32) = G_PHI [[COPY]](s32), %bb.0, [[COPY3]](s32), %bb.1
2914 ; GREEDY-NEXT: $agpr0 = COPY [[PHI]](s32)
2915 ; GREEDY-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31
2917 successors: %bb.1, %bb.2
2918 liveins: $agpr0, $sgpr0, $sgpr2
2920 %0:_(s32) = COPY $agpr0
2921 %1:_(s32) = COPY $sgpr0
2922 %2:_(s32) = COPY $sgpr2
2923 %3:_(s32) = G_CONSTANT i32 0
2924 %4:_(s1) = G_ICMP intpred(eq), %2, %3
2935 %6:_(s32) = G_PHI %0, %bb.0, %5, %bb.1
2937 S_SETPC_B64 undef $sgpr30_sgpr31
2942 name: phi_s32_sa_sbranch
2944 tracksRegLiveness: true
2947 ; FAST-LABEL: name: phi_s32_sa_sbranch
2949 ; FAST-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
2950 ; FAST-NEXT: liveins: $agpr0, $sgpr0, $sgpr2
2952 ; FAST-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
2953 ; FAST-NEXT: [[COPY1:%[0-9]+]]:agpr(s32) = COPY $agpr0
2954 ; FAST-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr2
2955 ; FAST-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
2956 ; FAST-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
2957 ; FAST-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
2958 ; FAST-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s1)
2959 ; FAST-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
2960 ; FAST-NEXT: G_BR %bb.2
2963 ; FAST-NEXT: successors: %bb.2(0x80000000)
2965 ; FAST-NEXT: [[COPY3:%[0-9]+]]:agpr(s32) = COPY [[COPY1]](s32)
2966 ; FAST-NEXT: G_BR %bb.2
2969 ; FAST-NEXT: [[PHI:%[0-9]+]]:vgpr(s32) = G_PHI [[COPY]](s32), %bb.0, [[COPY3]](s32), %bb.1
2970 ; FAST-NEXT: $agpr0 = COPY [[PHI]](s32)
2971 ; FAST-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31
2972 ; GREEDY-LABEL: name: phi_s32_sa_sbranch
2974 ; GREEDY-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
2975 ; GREEDY-NEXT: liveins: $agpr0, $sgpr0, $sgpr2
2976 ; GREEDY-NEXT: {{ $}}
2977 ; GREEDY-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
2978 ; GREEDY-NEXT: [[COPY1:%[0-9]+]]:agpr(s32) = COPY $agpr0
2979 ; GREEDY-NEXT: [[COPY2:%[0-9]+]]:sgpr(s32) = COPY $sgpr2
2980 ; GREEDY-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
2981 ; GREEDY-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
2982 ; GREEDY-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
2983 ; GREEDY-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s1)
2984 ; GREEDY-NEXT: G_BRCOND [[ZEXT]](s32), %bb.1
2985 ; GREEDY-NEXT: G_BR %bb.2
2986 ; GREEDY-NEXT: {{ $}}
2987 ; GREEDY-NEXT: bb.1:
2988 ; GREEDY-NEXT: successors: %bb.2(0x80000000)
2989 ; GREEDY-NEXT: {{ $}}
2990 ; GREEDY-NEXT: [[COPY3:%[0-9]+]]:agpr(s32) = COPY [[COPY1]](s32)
2991 ; GREEDY-NEXT: G_BR %bb.2
2992 ; GREEDY-NEXT: {{ $}}
2993 ; GREEDY-NEXT: bb.2:
2994 ; GREEDY-NEXT: [[PHI:%[0-9]+]]:vgpr(s32) = G_PHI [[COPY]](s32), %bb.0, [[COPY3]](s32), %bb.1
2995 ; GREEDY-NEXT: $agpr0 = COPY [[PHI]](s32)
2996 ; GREEDY-NEXT: S_SETPC_B64 undef $sgpr30_sgpr31
2998 successors: %bb.1, %bb.2
2999 liveins: $agpr0, $sgpr0, $sgpr2
3001 %0:_(s32) = COPY $sgpr0
3002 %1:_(s32) = COPY $agpr0
3003 %2:_(s32) = COPY $sgpr2
3004 %3:_(s32) = G_CONSTANT i32 0
3005 %4:_(s1) = G_ICMP intpred(eq), %2, %3
3016 %6:_(s32) = G_PHI %0, %bb.0, %5, %bb.1
3018 S_SETPC_B64 undef $sgpr30_sgpr31