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