1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O0 -mtriple=aarch64-unknown-unknown -verify-machineinstrs -global-isel-abort=0 -run-pass=legalizer %s -o - | FileCheck %s
6 exposesReturnsTwice: false
10 tracksRegLiveness: true
12 - { id: 0, class: _, preferred-register: '' }
13 - { id: 1, class: _, preferred-register: '' }
14 - { id: 2, class: _, preferred-register: '' }
15 - { id: 3, class: _, preferred-register: '' }
16 - { id: 4, class: _, preferred-register: '' }
17 - { id: 5, class: _, preferred-register: '' }
18 - { id: 6, class: _, preferred-register: '' }
19 - { id: 7, class: _, preferred-register: '' }
20 - { id: 8, class: _, preferred-register: '' }
21 - { id: 9, class: _, preferred-register: '' }
22 - { id: 10, class: _, preferred-register: '' }
25 ; CHECK-LABEL: name: legalize_phi
27 ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
28 ; CHECK-NEXT: liveins: $w0
30 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
31 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
32 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
33 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 2
34 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ugt), [[COPY]](s32), [[C]]
35 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C1]]
36 ; CHECK-NEXT: G_BRCOND [[AND]](s32), %bb.1
37 ; CHECK-NEXT: G_BR %bb.2
40 ; CHECK-NEXT: successors: %bb.3(0x80000000)
42 ; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[C1]]
43 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[ADD]](s32)
44 ; CHECK-NEXT: G_BR %bb.3
47 ; CHECK-NEXT: successors: %bb.3(0x80000000)
49 ; CHECK-NEXT: [[ADD1:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[C2]]
50 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[ADD1]](s32)
53 ; CHECK-NEXT: [[PHI:%[0-9]+]]:_(s16) = G_PHI [[TRUNC]](s16), %bb.1, [[TRUNC1]](s16), %bb.2
54 ; CHECK-NEXT: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
55 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[PHI]](s16)
56 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[ANYEXT]], [[C3]]
57 ; CHECK-NEXT: $w0 = COPY [[AND1]](s32)
58 ; CHECK-NEXT: RET_ReallyLR implicit $w0
60 ; Test that we insert legalization artifacts(Truncs here) into the correct BBs
61 ; while legalizing the G_PHI to s16.
64 successors: %bb.1(0x40000000), %bb.2(0x40000000)
68 %1(s32) = G_CONSTANT i32 0
69 %3(s32) = G_CONSTANT i32 1
70 %6(s32) = G_CONSTANT i32 2
71 %2(s1) = G_ICMP intpred(ugt), %0(s32), %1
72 G_BRCOND %2(s1), %bb.1
76 successors: %bb.3(0x80000000)
78 %4(s32) = G_ADD %0, %3
79 %5(s1) = G_TRUNC %4(s32)
83 successors: %bb.3(0x80000000)
85 %7(s32) = G_ADD %0, %6
86 %8(s1) = G_TRUNC %7(s32)
89 %9(s1) = G_PHI %5(s1), %bb.1, %8(s1), %bb.2
90 %11:_(s1) = G_PHI %5(s1), %bb.1, %8(s1), %bb.2
91 %10(s32) = G_ZEXT %9(s1)
93 RET_ReallyLR implicit $w0
97 name: legalize_phi_ptr
99 exposesReturnsTwice: false
101 regBankSelected: false
103 tracksRegLiveness: true
105 - { id: 0, class: _, preferred-register: '' }
106 - { id: 1, class: _, preferred-register: '' }
107 - { id: 2, class: _, preferred-register: '' }
108 - { id: 3, class: _, preferred-register: '' }
109 - { id: 4, class: _, preferred-register: '' }
110 - { id: 5, class: _, preferred-register: '' }
113 ; CHECK-LABEL: name: legalize_phi_ptr
115 ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
116 ; CHECK-NEXT: liveins: $w2, $x0, $x1
118 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
119 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(p0) = COPY $x1
120 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $w2
121 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
122 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C]]
123 ; CHECK-NEXT: G_BRCOND [[AND]](s32), %bb.1
124 ; CHECK-NEXT: G_BR %bb.2
127 ; CHECK-NEXT: successors: %bb.2(0x80000000)
131 ; CHECK-NEXT: [[PHI:%[0-9]+]]:_(p0) = G_PHI [[COPY]](p0), %bb.0, [[COPY1]](p0), %bb.1
132 ; CHECK-NEXT: $x0 = COPY [[PHI]](p0)
133 ; CHECK-NEXT: RET_ReallyLR implicit $x0
136 successors: %bb.2, %bb.3
137 liveins: $w2, $x0, $x1
142 %2(s1) = G_TRUNC %4(s32)
143 G_BRCOND %2(s1), %bb.2
150 %3(p0) = G_PHI %0(p0), %bb.1, %1(p0), %bb.2
152 RET_ReallyLR implicit $x0
156 name: legalize_phi_empty
158 exposesReturnsTwice: false
160 regBankSelected: false
162 tracksRegLiveness: true
164 - { id: 0, class: _, preferred-register: '' }
165 - { id: 1, class: _, preferred-register: '' }
166 - { id: 2, class: _, preferred-register: '' }
167 - { id: 3, class: _, preferred-register: '' }
168 - { id: 4, class: _, preferred-register: '' }
169 - { id: 5, class: _, preferred-register: '' }
170 - { id: 6, class: _, preferred-register: '' }
171 - { id: 7, class: _, preferred-register: '' }
172 - { id: 8, class: _, preferred-register: '' }
173 - { id: 9, class: _, preferred-register: '' }
174 - { id: 10, class: _, preferred-register: '' }
177 ; CHECK-LABEL: name: legalize_phi_empty
179 ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
180 ; CHECK-NEXT: liveins: $w0
182 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
183 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
184 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 3
185 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
186 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ugt), [[COPY]](s32), [[C]]
187 ; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[C1]]
188 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C2]]
189 ; CHECK-NEXT: G_BRCOND [[AND]](s32), %bb.1
190 ; CHECK-NEXT: G_BR %bb.2
193 ; CHECK-NEXT: successors: %bb.3(0x80000000)
195 ; CHECK-NEXT: [[ADD1:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[C2]]
196 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[ADD1]](s32)
197 ; CHECK-NEXT: G_BR %bb.3
200 ; CHECK-NEXT: successors: %bb.3(0x80000000)
202 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[ADD]](s32)
205 ; CHECK-NEXT: [[PHI:%[0-9]+]]:_(s16) = G_PHI [[TRUNC]](s16), %bb.1, [[TRUNC1]](s16), %bb.2
206 ; CHECK-NEXT: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
207 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[PHI]](s16)
208 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[ANYEXT]], [[C3]]
209 ; CHECK-NEXT: $w0 = COPY [[AND1]](s32)
210 ; CHECK-NEXT: RET_ReallyLR implicit $w0
212 successors: %bb.1(0x40000000), %bb.2(0x40000000)
214 ; Test that we properly legalize a phi with a predecessor that's empty
220 %1(s32) = G_CONSTANT i32 0
221 %3(s32) = G_CONSTANT i32 3
222 %6(s32) = G_CONSTANT i32 1
223 %2(s1) = G_ICMP intpred(ugt), %0(s32), %1
224 %4(s32) = G_ADD %0, %3
225 %5(s1) = G_TRUNC %4(s32)
226 G_BRCOND %2(s1), %bb.1
230 successors: %bb.3(0x80000000)
232 %7(s32) = G_ADD %0, %6
233 %8(s1) = G_TRUNC %7(s32)
237 successors: %bb.3(0x80000000)
241 %9(s1) = G_PHI %8(s1), %bb.1, %5(s1), %bb.2
242 %10(s32) = G_ZEXT %9(s1)
244 RET_ReallyLR implicit $w0
248 name: legalize_phi_loop
250 exposesReturnsTwice: false
252 regBankSelected: false
254 tracksRegLiveness: true
256 - { id: 0, class: _, preferred-register: '' }
257 - { id: 1, class: _, preferred-register: '' }
258 - { id: 2, class: _, preferred-register: '' }
259 - { id: 3, class: _, preferred-register: '' }
260 - { id: 4, class: _, preferred-register: '' }
261 - { id: 5, class: _, preferred-register: '' }
262 - { id: 6, class: _, preferred-register: '' }
263 - { id: 7, class: _, preferred-register: '' }
266 ; CHECK-LABEL: name: legalize_phi_loop
268 ; CHECK-NEXT: successors: %bb.1(0x80000000)
269 ; CHECK-NEXT: liveins: $w0
271 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
272 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 0
275 ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
277 ; CHECK-NEXT: [[PHI:%[0-9]+]]:_(s16) = G_PHI [[C]](s16), %bb.0, %14(s16), %bb.1
278 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[PHI]](s16)
279 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
280 ; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[ANYEXT]], [[C1]]
281 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
282 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ADD]], [[C2]]
283 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ugt), [[AND]](s32), [[COPY]]
284 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C1]]
285 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[ADD]](s32)
286 ; CHECK-NEXT: G_BRCOND [[AND1]](s32), %bb.1
289 ; CHECK-NEXT: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
290 ; CHECK-NEXT: [[AND2:%[0-9]+]]:_(s32) = G_AND [[ADD]], [[C3]]
291 ; CHECK-NEXT: $w0 = COPY [[AND2]](s32)
292 ; CHECK-NEXT: RET_ReallyLR implicit $w0
294 successors: %bb.1(0x80000000)
296 ; Test that we properly legalize a phi that uses a value from the same BB
299 %2(s8) = G_CONSTANT i8 1
300 %7(s8) = G_CONSTANT i8 0
303 successors: %bb.1(0x40000000), %bb.3(0x40000000)
305 %1(s8) = G_PHI %7(s8), %bb.0, %3(s8), %bb.1
306 %3(s8) = G_ADD %1, %2
307 %4(s32) = G_ZEXT %3(s8)
308 %5(s1) = G_ICMP intpred(ugt), %4(s32), %0
309 G_BRCOND %5(s1), %bb.1
312 %6(s32) = G_ZEXT %3(s8)
314 RET_ReallyLR implicit $w0
318 name: legalize_phi_cycle
320 exposesReturnsTwice: false
322 regBankSelected: false
324 tracksRegLiveness: true
326 - { id: 0, class: _, preferred-register: '' }
327 - { id: 1, class: _, preferred-register: '' }
328 - { id: 2, class: _, preferred-register: '' }
329 - { id: 3, class: _, preferred-register: '' }
330 - { id: 4, class: _, preferred-register: '' }
333 ; CHECK-LABEL: name: legalize_phi_cycle
335 ; CHECK-NEXT: successors: %bb.1(0x80000000)
336 ; CHECK-NEXT: liveins: $w0
338 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
339 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 0
342 ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
344 ; CHECK-NEXT: [[PHI:%[0-9]+]]:_(s16) = G_PHI [[C]](s16), %bb.0, [[PHI]](s16), %bb.1
345 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
346 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[PHI]](s16)
347 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ANYEXT]], [[C1]]
348 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ugt), [[AND]](s32), [[COPY]]
349 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
350 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C2]]
351 ; CHECK-NEXT: G_BRCOND [[AND1]](s32), %bb.1
354 ; CHECK-NEXT: $w0 = COPY [[AND]](s32)
355 ; CHECK-NEXT: RET_ReallyLR implicit $w0
357 successors: %bb.1(0x80000000)
359 ; Test that we properly legalize a phi that uses itself
363 %4(s8) = G_CONSTANT i8 0
366 successors: %bb.1(0x40000000), %bb.3(0x40000000)
368 %1(s8) = G_PHI %4(s8), %bb.0, %1(s8), %bb.1
369 %2(s32) = G_ZEXT %1(s8)
370 %3(s1) = G_ICMP intpred(ugt), %2(s32), %0
371 G_BRCOND %3(s1), %bb.1
375 RET_ReallyLR implicit $w0
379 name: legalize_phi_same_bb
381 exposesReturnsTwice: false
383 regBankSelected: false
385 tracksRegLiveness: true
387 - { id: 0, class: _, preferred-register: '' }
388 - { id: 1, class: _, preferred-register: '' }
389 - { id: 2, class: _, preferred-register: '' }
390 - { id: 3, class: _, preferred-register: '' }
391 - { id: 4, class: _, preferred-register: '' }
392 - { id: 5, class: _, preferred-register: '' }
393 - { id: 6, class: _, preferred-register: '' }
394 - { id: 7, class: _, preferred-register: '' }
395 - { id: 8, class: _, preferred-register: '' }
396 - { id: 9, class: _, preferred-register: '' }
397 - { id: 10, class: _, preferred-register: '' }
398 - { id: 11, class: _, preferred-register: '' }
399 - { id: 12, class: _, preferred-register: '' }
400 - { id: 13, class: _, preferred-register: '' }
401 - { id: 14, class: _, preferred-register: '' }
404 ; CHECK-LABEL: name: legalize_phi_same_bb
406 ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
407 ; CHECK-NEXT: liveins: $w0
409 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
410 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
411 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 3
412 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
413 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ugt), [[COPY]](s32), [[C]]
414 ; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[C1]]
415 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C2]]
416 ; CHECK-NEXT: G_BRCOND [[AND]](s32), %bb.1
417 ; CHECK-NEXT: G_BR %bb.2
420 ; CHECK-NEXT: successors: %bb.3(0x80000000)
422 ; CHECK-NEXT: [[ADD1:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[C2]]
423 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[ADD1]](s32)
424 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[ADD1]](s32)
425 ; CHECK-NEXT: G_BR %bb.3
428 ; CHECK-NEXT: successors: %bb.3(0x80000000)
430 ; CHECK-NEXT: [[C3:%[0-9]+]]:_(s16) = G_CONSTANT i16 42
431 ; CHECK-NEXT: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[ADD]](s32)
434 ; CHECK-NEXT: [[PHI:%[0-9]+]]:_(s16) = G_PHI [[TRUNC1]](s16), %bb.1, [[TRUNC2]](s16), %bb.2
435 ; CHECK-NEXT: [[PHI1:%[0-9]+]]:_(s16) = G_PHI [[TRUNC]](s16), %bb.1, [[C3]](s16), %bb.2
436 ; CHECK-NEXT: [[C4:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
437 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[PHI]](s16)
438 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[ANYEXT]], [[C4]]
439 ; CHECK-NEXT: [[ANYEXT1:%[0-9]+]]:_(s32) = G_ANYEXT [[PHI1]](s16)
440 ; CHECK-NEXT: [[AND2:%[0-9]+]]:_(s32) = G_AND [[ANYEXT1]], [[C4]]
441 ; CHECK-NEXT: [[ADD2:%[0-9]+]]:_(s32) = G_ADD [[AND1]], [[AND2]]
442 ; CHECK-NEXT: $w0 = COPY [[ADD2]](s32)
443 ; CHECK-NEXT: RET_ReallyLR implicit $w0
445 successors: %bb.1(0x40000000), %bb.2(0x40000000)
447 ; Make sure that we correctly insert the new legalized G_PHI at the
448 ; correct location (ie make sure G_PHIs are the first insts in the BB).
454 %1(s32) = G_CONSTANT i32 0
455 %3(s32) = G_CONSTANT i32 3
456 %6(s32) = G_CONSTANT i32 1
457 %14(s8) = G_CONSTANT i8 42
458 %2(s1) = G_ICMP intpred(ugt), %0(s32), %1
459 %4(s32) = G_ADD %0, %3
460 %5(s8) = G_TRUNC %4(s32)
461 G_BRCOND %2(s1), %bb.1
465 successors: %bb.3(0x80000000)
467 %7(s32) = G_ADD %0, %6
468 %8(s8) = G_TRUNC %7(s32)
472 successors: %bb.3(0x80000000)
476 %9(s8) = G_PHI %8(s8), %bb.1, %5(s8), %bb.2
477 %10(s8) = G_PHI %8(s8), %bb.1, %14(s8), %bb.2
478 %11(s32) = G_ZEXT %9(s8)
479 %12(s32) = G_ZEXT %10(s8)
480 %13(s32) = G_ADD %11, %12
482 RET_ReallyLR implicit $w0
486 name: legalize_phi_diff_bb
488 exposesReturnsTwice: false
490 regBankSelected: false
492 tracksRegLiveness: true
494 - { id: 0, class: _, preferred-register: '' }
495 - { id: 1, class: _, preferred-register: '' }
496 - { id: 2, class: _, preferred-register: '' }
497 - { id: 3, class: _, preferred-register: '' }
498 - { id: 4, class: _, preferred-register: '' }
499 - { id: 5, class: _, preferred-register: '' }
500 - { id: 6, class: _, preferred-register: '' }
501 - { id: 7, class: _, preferred-register: '' }
502 - { id: 8, class: _, preferred-register: '' }
503 - { id: 9, class: _, preferred-register: '' }
504 - { id: 10, class: _, preferred-register: '' }
505 - { id: 11, class: _, preferred-register: '' }
506 - { id: 12, class: _, preferred-register: '' }
507 - { id: 13, class: _, preferred-register: '' }
508 - { id: 14, class: _, preferred-register: '' }
509 - { id: 15, class: _, preferred-register: '' }
512 ; CHECK-LABEL: name: legalize_phi_diff_bb
514 ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
515 ; CHECK-NEXT: liveins: $w0, $w1
517 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
518 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
519 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
520 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 3
521 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
522 ; CHECK-NEXT: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 44
523 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ugt), [[COPY]](s32), [[C]]
524 ; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[C1]]
525 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[ADD]](s32)
526 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[ADD]](s32)
527 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C2]]
528 ; CHECK-NEXT: G_BRCOND [[AND]](s32), %bb.1
529 ; CHECK-NEXT: G_BR %bb.2
532 ; CHECK-NEXT: successors: %bb.2(0x40000000), %bb.1(0x40000000)
534 ; CHECK-NEXT: [[PHI:%[0-9]+]]:_(s16) = G_PHI [[TRUNC1]](s16), %bb.0, %22(s16), %bb.1
535 ; CHECK-NEXT: [[C4:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
536 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[PHI]](s16)
537 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[ANYEXT]], [[C4]]
538 ; CHECK-NEXT: [[ADD1:%[0-9]+]]:_(s32) = G_ADD [[AND1]], [[C2]]
539 ; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(ugt), [[ADD1]](s32), [[C3]]
540 ; CHECK-NEXT: [[C5:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
541 ; CHECK-NEXT: [[AND2:%[0-9]+]]:_(s32) = G_AND [[ICMP1]], [[C5]]
542 ; CHECK-NEXT: [[C6:%[0-9]+]]:_(s16) = G_CONSTANT i16 43
543 ; CHECK-NEXT: G_BRCOND [[AND2]](s32), %bb.2
544 ; CHECK-NEXT: G_BR %bb.1
547 ; CHECK-NEXT: [[PHI1:%[0-9]+]]:_(s16) = G_PHI [[PHI]](s16), %bb.1, [[TRUNC]](s16), %bb.0
548 ; CHECK-NEXT: [[C7:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
549 ; CHECK-NEXT: [[ANYEXT1:%[0-9]+]]:_(s32) = G_ANYEXT [[PHI1]](s16)
550 ; CHECK-NEXT: [[AND3:%[0-9]+]]:_(s32) = G_AND [[ANYEXT1]], [[C7]]
551 ; CHECK-NEXT: $w0 = COPY [[AND3]](s32)
552 ; CHECK-NEXT: RET_ReallyLR implicit $w0
554 successors: %bb.1(0x40000000), %bb.3(0x40000000)
556 ; Make sure that we correctly legalize PHIs sharing common defs
563 %2(s32) = G_CONSTANT i32 0
564 %4(s32) = G_CONSTANT i32 3
565 %9(s32) = G_CONSTANT i32 1
566 %11(s32) = G_CONSTANT i32 44
567 %15(s8) = G_CONSTANT i8 43
568 %3(s1) = G_ICMP intpred(ugt), %0(s32), %2
569 %5(s32) = G_ADD %0, %4
570 %6(s8) = G_TRUNC %5(s32)
571 G_BRCOND %3(s1), %bb.1
575 successors: %bb.3(0x40000000), %bb.1(0x40000000)
577 %7(s8) = G_PHI %6(s8), %bb.0, %15(s8), %bb.1
578 %8(s32) = G_ZEXT %7(s8)
579 %10(s32) = G_ADD %8, %9
580 %12(s1) = G_ICMP intpred(ugt), %10(s32), %11
581 G_BRCOND %12(s1), %bb.3
585 %13(s8) = G_PHI %7(s8), %bb.1, %6(s8), %bb.0
586 %14(s32) = G_ZEXT %13(s8)
588 RET_ReallyLR implicit $w0
592 name: legalize_phi_check_insertpt
594 exposesReturnsTwice: false
596 regBankSelected: false
598 tracksRegLiveness: true
600 ; CHECK-LABEL: name: legalize_phi_check_insertpt
602 ; CHECK-NEXT: successors: %bb.1(0x80000000)
603 ; CHECK-NEXT: liveins: $x0, $x1
605 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
606 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(p0) = COPY $x1
607 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
608 ; CHECK-NEXT: G_BR %bb.1
611 ; CHECK-NEXT: [[PHI:%[0-9]+]]:_(s64) = G_PHI [[DEF]](s64), %bb.0
612 ; CHECK-NEXT: [[PHI1:%[0-9]+]]:_(s64) = G_PHI [[DEF]](s64), %bb.0
613 ; CHECK-NEXT: [[PHI2:%[0-9]+]]:_(s64) = G_PHI [[COPY]](s64), %bb.0
614 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s128) = G_MERGE_VALUES [[PHI]](s64), [[PHI1]](s64)
615 ; CHECK-NEXT: G_STORE [[MV]](s128), [[COPY1]](p0) :: (store (s128))
616 ; CHECK-NEXT: G_STORE [[PHI2]](s64), [[COPY1]](p0) :: (store (s64))
617 ; CHECK-NEXT: RET_ReallyLR
618 ; Check that the G_MERGE here gets inserted after all the PHIs.
620 successors: %bb.1(0x40000000)
625 %2:_(s128) = G_IMPLICIT_DEF
629 %3:_(s128) = G_PHI %2(s128), %bb.0
630 %4:_(s64) = G_PHI %0(s64), %bb.0
631 G_STORE %3(s128), %1(p0) :: (store (s128))
632 G_STORE %4(s64), %1(p0) :: (store (s64))
637 name: legalize_phi_vector
638 tracksRegLiveness: true
640 ; CHECK-LABEL: name: legalize_phi_vector
642 ; CHECK-NEXT: successors: %bb.1(0x80000000)
643 ; CHECK-NEXT: liveins: $q0, $x1
645 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<16 x s8>) = COPY $q0
646 ; CHECK-NEXT: G_BR %bb.1
649 ; CHECK-NEXT: [[PHI:%[0-9]+]]:_(<16 x s8>) = G_PHI [[COPY]](<16 x s8>), %bb.0
650 ; CHECK-NEXT: $q0 = COPY [[PHI]](<16 x s8>)
651 ; CHECK-NEXT: RET_ReallyLR
656 %0:_(<16 x s8>) = COPY $q0
660 %3:_(<16 x s8>) = G_PHI %0(<16 x s8>), %bb.0
661 $q0 = COPY %3(<16 x s8>)
666 tracksRegLiveness: true
669 ; CHECK-LABEL: name: s88
671 ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
672 ; CHECK-NEXT: liveins: $x0
674 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
675 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
676 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[DEF]], [[C]]
677 ; CHECK-NEXT: G_BRCOND [[AND]](s32), %bb.1
678 ; CHECK-NEXT: G_BR %bb.2
681 ; CHECK-NEXT: successors: %bb.3(0x80000000)
683 ; CHECK-NEXT: [[DEF1:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
684 ; CHECK-NEXT: G_BR %bb.3
687 ; CHECK-NEXT: successors: %bb.3(0x80000000)
689 ; CHECK-NEXT: [[DEF2:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
692 ; CHECK-NEXT: [[PHI:%[0-9]+]]:_(s64) = G_PHI [[DEF1]](s64), %bb.1, [[DEF2]](s64), %bb.2
693 ; CHECK-NEXT: $x0 = COPY [[PHI]](s64)
694 ; CHECK-NEXT: RET_ReallyLR implicit $x0
696 successors: %bb.1(0x40000000), %bb.2(0x40000000)
698 %cond:_(s1) = G_IMPLICIT_DEF
699 G_BRCOND %cond(s1), %bb.1
702 successors: %bb.3(0x80000000)
703 %imp_1:_(s88) = G_IMPLICIT_DEF
706 successors: %bb.3(0x80000000)
707 %imp_2:_(s88) = G_IMPLICIT_DEF
709 %phi:_(s88) = G_PHI %imp_1:_(s88), %bb.1, %imp_2:_(s88), %bb.2
710 %trunc:_(s64) = G_TRUNC %phi
712 RET_ReallyLR implicit $x0
717 tracksRegLiveness: true
719 ; CHECK-LABEL: name: v4s64
721 ; CHECK-NEXT: successors: %bb.1(0x50000000), %bb.2(0x30000000)
722 ; CHECK-NEXT: liveins: $x0, $x1
724 ; CHECK-NEXT: %ptr1:_(p0) = COPY $x1
725 ; CHECK-NEXT: %ptr2:_(p0) = COPY $x0
726 ; CHECK-NEXT: [[LOAD:%[0-9]+]]:_(<2 x s64>) = G_LOAD %ptr1(p0) :: (load (<2 x s64>), align 32)
727 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 16
728 ; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD %ptr1, [[C]](s64)
729 ; CHECK-NEXT: [[LOAD1:%[0-9]+]]:_(<2 x s64>) = G_LOAD [[PTR_ADD]](p0) :: (load (<2 x s64>) from unknown-address + 16)
730 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
731 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
732 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[DEF]], [[C1]]
733 ; CHECK-NEXT: G_BRCOND [[AND]](s32), %bb.2
734 ; CHECK-NEXT: G_BR %bb.1
737 ; CHECK-NEXT: successors: %bb.2(0x80000000)
739 ; CHECK-NEXT: [[LOAD2:%[0-9]+]]:_(<2 x s64>) = G_LOAD %ptr2(p0) :: (load (<2 x s64>), align 32)
740 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 16
741 ; CHECK-NEXT: [[PTR_ADD1:%[0-9]+]]:_(p0) = G_PTR_ADD %ptr2, [[C2]](s64)
742 ; CHECK-NEXT: [[LOAD3:%[0-9]+]]:_(<2 x s64>) = G_LOAD [[PTR_ADD1]](p0) :: (load (<2 x s64>) from unknown-address + 16)
745 ; CHECK-NEXT: [[PHI:%[0-9]+]]:_(<2 x s64>) = G_PHI [[LOAD2]](<2 x s64>), %bb.1, [[LOAD]](<2 x s64>), %bb.0
746 ; CHECK-NEXT: [[PHI1:%[0-9]+]]:_(<2 x s64>) = G_PHI [[LOAD3]](<2 x s64>), %bb.1, [[LOAD1]](<2 x s64>), %bb.0
747 ; CHECK-NEXT: $q0 = COPY [[PHI]](<2 x s64>)
748 ; CHECK-NEXT: $q1 = COPY [[PHI1]](<2 x s64>)
749 ; CHECK-NEXT: RET_ReallyLR implicit $q0, implicit $q1
751 successors: %bb.1(0x50000000), %bb.2(0x30000000)
754 %ptr1:_(p0) = COPY $x1
755 %ptr2:_(p0) = COPY $x0
756 %cond:_(s1) = G_IMPLICIT_DEF
757 %val_1:_(<4 x s64>) = G_LOAD %ptr1(p0) :: (load (<4 x s64>))
758 G_BRCOND %cond(s1), %bb.2
761 %val_2:_(<4 x s64>) = G_LOAD %ptr2(p0) :: (load (<4 x s64>))
763 %phi:_(<4 x s64>) = G_PHI %val_2(<4 x s64>), %bb.1, %val_1(<4 x s64>), %bb.0
764 %unmerge_1:_(<2 x s64>), %unmerge_2:_(<2 x s64>) = G_UNMERGE_VALUES %phi(<4 x s64>)
765 $q0 = COPY %unmerge_1(<2 x s64>)
766 $q1 = COPY %unmerge_2(<2 x s64>)
767 RET_ReallyLR implicit $q0, implicit $q1
772 tracksRegLiveness: true
774 ; CHECK-LABEL: name: v8s32
776 ; CHECK-NEXT: successors: %bb.1(0x50000000), %bb.2(0x30000000)
777 ; CHECK-NEXT: liveins: $x0, $x1
779 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
780 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[DEF]](s32), [[DEF]](s32), [[DEF]](s32), [[DEF]](s32)
781 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
782 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY [[DEF]](s32)
783 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]]
784 ; CHECK-NEXT: G_BRCOND [[AND]](s32), %bb.2
785 ; CHECK-NEXT: G_BR %bb.1
788 ; CHECK-NEXT: successors: %bb.2(0x80000000)
790 ; CHECK-NEXT: [[DEF1:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
791 ; CHECK-NEXT: [[BUILD_VECTOR1:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[DEF1]](s32), [[DEF1]](s32), [[DEF1]](s32), [[DEF1]](s32)
794 ; CHECK-NEXT: [[PHI:%[0-9]+]]:_(<4 x s32>) = G_PHI [[BUILD_VECTOR1]](<4 x s32>), %bb.1, [[BUILD_VECTOR]](<4 x s32>), %bb.0
795 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
796 ; CHECK-NEXT: %extract:_(s32) = G_EXTRACT_VECTOR_ELT [[PHI]](<4 x s32>), [[C1]](s64)
797 ; CHECK-NEXT: $w0 = COPY %extract(s32)
798 ; CHECK-NEXT: RET_ReallyLR implicit $w0
800 successors: %bb.1(0x50000000), %bb.2(0x30000000)
802 %cond:_(s1) = G_IMPLICIT_DEF
803 %val_1:_(<8 x s32>) = G_IMPLICIT_DEF
804 G_BRCOND %cond(s1), %bb.2
807 %val_2:_(<8 x s32>) = G_IMPLICIT_DEF
809 %phi:_(<8 x s32>) = G_PHI %val_2(<8 x s32>), %bb.1, %val_1(<8 x s32>), %bb.0
810 %one:_(s32) = G_CONSTANT i32 1
811 %extract:_(s32) = G_EXTRACT_VECTOR_ELT %phi(<8 x s32>), %one(s32)
813 RET_ReallyLR implicit $w0
818 tracksRegLiveness: true
820 ; CHECK-LABEL: name: v16s16
822 ; CHECK-NEXT: successors: %bb.1(0x50000000), %bb.2(0x30000000)
823 ; CHECK-NEXT: liveins: $x0, $x1
825 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s16) = G_IMPLICIT_DEF
826 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<8 x s16>) = G_BUILD_VECTOR [[DEF]](s16), [[DEF]](s16), [[DEF]](s16), [[DEF]](s16), [[DEF]](s16), [[DEF]](s16), [[DEF]](s16), [[DEF]](s16)
827 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
828 ; CHECK-NEXT: [[DEF1:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
829 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[DEF1]], [[C]]
830 ; CHECK-NEXT: G_BRCOND [[AND]](s32), %bb.2
831 ; CHECK-NEXT: G_BR %bb.1
834 ; CHECK-NEXT: successors: %bb.2(0x80000000)
836 ; CHECK-NEXT: [[DEF2:%[0-9]+]]:_(s16) = G_IMPLICIT_DEF
837 ; CHECK-NEXT: [[BUILD_VECTOR1:%[0-9]+]]:_(<8 x s16>) = G_BUILD_VECTOR [[DEF2]](s16), [[DEF2]](s16), [[DEF2]](s16), [[DEF2]](s16), [[DEF2]](s16), [[DEF2]](s16), [[DEF2]](s16), [[DEF2]](s16)
840 ; CHECK-NEXT: [[PHI:%[0-9]+]]:_(<8 x s16>) = G_PHI [[BUILD_VECTOR1]](<8 x s16>), %bb.1, [[BUILD_VECTOR]](<8 x s16>), %bb.0
841 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
842 ; CHECK-NEXT: %extract:_(s16) = G_EXTRACT_VECTOR_ELT [[PHI]](<8 x s16>), [[C1]](s64)
843 ; CHECK-NEXT: $h0 = COPY %extract(s16)
844 ; CHECK-NEXT: RET_ReallyLR implicit $h0
846 successors: %bb.1(0x50000000), %bb.2(0x30000000)
848 %cond:_(s1) = G_IMPLICIT_DEF
849 %val_1:_(<16 x s16>) = G_IMPLICIT_DEF
850 G_BRCOND %cond(s1), %bb.2
853 %val_2:_(<16 x s16>) = G_IMPLICIT_DEF
855 %phi:_(<16 x s16>) = G_PHI %val_2(<16 x s16>), %bb.1, %val_1(<16 x s16>), %bb.0
856 %one:_(s16) = G_CONSTANT i16 1
857 %extract:_(s16) = G_EXTRACT_VECTOR_ELT %phi(<16 x s16>), %one(s16)
859 RET_ReallyLR implicit $h0
864 tracksRegLiveness: true
866 ; CHECK-LABEL: name: v32s8
868 ; CHECK-NEXT: successors: %bb.1(0x50000000), %bb.2(0x30000000)
869 ; CHECK-NEXT: liveins: $x0, $x1
871 ; CHECK-NEXT: %cond:_(s1) = G_IMPLICIT_DEF
872 ; CHECK-NEXT: %val_1:_(<32 x s8>) = G_IMPLICIT_DEF
873 ; CHECK-NEXT: G_BRCOND %cond(s1), %bb.2
874 ; CHECK-NEXT: G_BR %bb.1
877 ; CHECK-NEXT: successors: %bb.2(0x80000000)
879 ; CHECK-NEXT: %val_2:_(<32 x s8>) = G_IMPLICIT_DEF
882 ; CHECK-NEXT: %phi:_(<32 x s8>) = G_PHI %val_2(<32 x s8>), %bb.1, %val_1(<32 x s8>), %bb.0
883 ; CHECK-NEXT: %one:_(s8) = G_CONSTANT i8 1
884 ; CHECK-NEXT: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT %one(s8)
885 ; CHECK-NEXT: %extract:_(s8) = G_EXTRACT_VECTOR_ELT %phi(<32 x s8>), [[SEXT]](s64)
886 ; CHECK-NEXT: $b0 = COPY %extract(s8)
887 ; CHECK-NEXT: RET_ReallyLR implicit $b0
889 successors: %bb.1(0x50000000), %bb.2(0x30000000)
891 %cond:_(s1) = G_IMPLICIT_DEF
892 %val_1:_(<32 x s8>) = G_IMPLICIT_DEF
893 G_BRCOND %cond(s1), %bb.2
896 %val_2:_(<32 x s8>) = G_IMPLICIT_DEF
898 %phi:_(<32 x s8>) = G_PHI %val_2(<32 x s8>), %bb.1, %val_1(<32 x s8>), %bb.0
899 %one:_(s8) = G_CONSTANT i8 1
900 %extract:_(s8) = G_EXTRACT_VECTOR_ELT %phi(<32 x s8>), %one(s8)
902 RET_ReallyLR implicit $b0
907 tracksRegLiveness: true
909 ; CHECK-LABEL: name: v4p0
911 ; CHECK-NEXT: successors: %bb.1(0x50000000), %bb.2(0x30000000)
912 ; CHECK-NEXT: liveins: $x0, $x1
914 ; CHECK-NEXT: %ptr1:_(p0) = COPY $x1
915 ; CHECK-NEXT: %ptr2:_(p0) = COPY $x0
916 ; CHECK-NEXT: [[LOAD:%[0-9]+]]:_(<2 x s64>) = G_LOAD %ptr1(p0) :: (load (<2 x s64>), align 32)
917 ; CHECK-NEXT: [[BITCAST:%[0-9]+]]:_(<2 x p0>) = G_BITCAST [[LOAD]](<2 x s64>)
918 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 16
919 ; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD %ptr1, [[C]](s64)
920 ; CHECK-NEXT: [[LOAD1:%[0-9]+]]:_(<2 x s64>) = G_LOAD [[PTR_ADD]](p0) :: (load (<2 x s64>) from unknown-address + 16)
921 ; CHECK-NEXT: [[BITCAST1:%[0-9]+]]:_(<2 x p0>) = G_BITCAST [[LOAD1]](<2 x s64>)
922 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
923 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
924 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[DEF]], [[C1]]
925 ; CHECK-NEXT: G_BRCOND [[AND]](s32), %bb.2
926 ; CHECK-NEXT: G_BR %bb.1
929 ; CHECK-NEXT: successors: %bb.2(0x80000000)
931 ; CHECK-NEXT: [[LOAD2:%[0-9]+]]:_(<2 x s64>) = G_LOAD %ptr2(p0) :: (load (<2 x s64>), align 32)
932 ; CHECK-NEXT: [[BITCAST2:%[0-9]+]]:_(<2 x p0>) = G_BITCAST [[LOAD2]](<2 x s64>)
933 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 16
934 ; CHECK-NEXT: [[PTR_ADD1:%[0-9]+]]:_(p0) = G_PTR_ADD %ptr2, [[C2]](s64)
935 ; CHECK-NEXT: [[LOAD3:%[0-9]+]]:_(<2 x s64>) = G_LOAD [[PTR_ADD1]](p0) :: (load (<2 x s64>) from unknown-address + 16)
936 ; CHECK-NEXT: [[BITCAST3:%[0-9]+]]:_(<2 x p0>) = G_BITCAST [[LOAD3]](<2 x s64>)
939 ; CHECK-NEXT: [[PHI:%[0-9]+]]:_(<2 x p0>) = G_PHI [[BITCAST2]](<2 x p0>), %bb.1, [[BITCAST]](<2 x p0>), %bb.0
940 ; CHECK-NEXT: [[PHI1:%[0-9]+]]:_(<2 x p0>) = G_PHI [[BITCAST3]](<2 x p0>), %bb.1, [[BITCAST1]](<2 x p0>), %bb.0
941 ; CHECK-NEXT: $q0 = COPY [[PHI]](<2 x p0>)
942 ; CHECK-NEXT: $q1 = COPY [[PHI1]](<2 x p0>)
943 ; CHECK-NEXT: RET_ReallyLR implicit $q0, implicit $q1
945 successors: %bb.1(0x50000000), %bb.2(0x30000000)
948 %ptr1:_(p0) = COPY $x1
949 %ptr2:_(p0) = COPY $x0
950 %cond:_(s1) = G_IMPLICIT_DEF
951 %val_1:_(<4 x p0>) = G_LOAD %ptr1(p0) :: (load (<4 x p0>))
952 G_BRCOND %cond(s1), %bb.2
955 %val_2:_(<4 x p0>) = G_LOAD %ptr2(p0) :: (load (<4 x p0>))
957 %phi:_(<4 x p0>) = G_PHI %val_2(<4 x p0>), %bb.1, %val_1(<4 x p0>), %bb.0
958 %unmerge_1:_(<2 x p0>), %unmerge_2:_(<2 x p0>) = G_UNMERGE_VALUES %phi(<4 x p0>)
959 $q0 = COPY %unmerge_1(<2 x p0>)
960 $q1 = COPY %unmerge_2(<2 x p0>)
961 RET_ReallyLR implicit $q0, implicit $q1