1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=riscv64 -run-pass=regbankselect \
3 # RUN: -disable-gisel-legality-check -simplify-mir -verify-machineinstrs %s \
4 # RUN: -o - | FileCheck -check-prefix=RV64I %s
9 tracksRegLiveness: true
11 ; RV64I-LABEL: name: phi_i64
13 ; RV64I-NEXT: liveins: $x10, $x11, $x12
15 ; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(s64) = COPY $x10
16 ; RV64I-NEXT: [[COPY1:%[0-9]+]]:gprb(s64) = COPY $x11
17 ; RV64I-NEXT: [[COPY2:%[0-9]+]]:gprb(s64) = COPY $x12
18 ; RV64I-NEXT: [[C:%[0-9]+]]:gprb(s64) = G_CONSTANT i64 1
19 ; RV64I-NEXT: [[AND:%[0-9]+]]:gprb(s64) = G_AND [[COPY]], [[C]]
20 ; RV64I-NEXT: G_BRCOND [[AND]](s64), %bb.2
21 ; RV64I-NEXT: G_BR %bb.1
26 ; RV64I-NEXT: [[PHI:%[0-9]+]]:gprb(s64) = G_PHI [[COPY2]](s64), %bb.1, [[COPY1]](s64), %bb.0
27 ; RV64I-NEXT: $x10 = COPY [[PHI]](s64)
28 ; RV64I-NEXT: PseudoRET implicit $x10
30 liveins: $x10, $x11, $x12
35 %6:_(s64) = G_CONSTANT i64 1
36 %5:_(s64) = G_AND %3, %6
37 G_BRCOND %5(s64), %bb.2
43 %4:_(s64) = G_PHI %2(s64), %bb.1, %1(s64), %bb.0
45 PseudoRET implicit $x10
51 tracksRegLiveness: true
53 ; RV64I-LABEL: name: phi_ptr
55 ; RV64I-NEXT: liveins: $x10, $x11, $x12
57 ; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(s64) = COPY $x10
58 ; RV64I-NEXT: [[COPY1:%[0-9]+]]:gprb(p0) = COPY $x11
59 ; RV64I-NEXT: [[COPY2:%[0-9]+]]:gprb(p0) = COPY $x12
60 ; RV64I-NEXT: [[C:%[0-9]+]]:gprb(s64) = G_CONSTANT i64 1
61 ; RV64I-NEXT: [[AND:%[0-9]+]]:gprb(s64) = G_AND [[COPY]], [[C]]
62 ; RV64I-NEXT: G_BRCOND [[AND]](s64), %bb.2
63 ; RV64I-NEXT: G_BR %bb.1
68 ; RV64I-NEXT: [[PHI:%[0-9]+]]:gprb(p0) = G_PHI [[COPY2]](p0), %bb.1, [[COPY1]](p0), %bb.0
69 ; RV64I-NEXT: $x10 = COPY [[PHI]](p0)
70 ; RV64I-NEXT: PseudoRET implicit $x10
72 liveins: $x10, $x11, $x12
77 %6:_(s64) = G_CONSTANT i64 1
78 %5:_(s64) = G_AND %3, %6
79 G_BRCOND %5(s64), %bb.2
85 %4:_(p0) = G_PHI %2(p0), %bb.1, %1(p0), %bb.0
87 PseudoRET implicit $x10