1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=riscv32 -run-pass=instruction-select -simplify-mir -verify-machineinstrs %s -o - \
3 # RUN: | 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]+]]:gpr = COPY $x10
16 ; RV32I-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
17 ; RV32I-NEXT: [[COPY2:%[0-9]+]]:gpr = COPY $x12
18 ; RV32I-NEXT: [[ANDI:%[0-9]+]]:gpr = ANDI [[COPY]], 1
19 ; RV32I-NEXT: BNE [[ANDI]], $x0, %bb.2
20 ; RV32I-NEXT: PseudoBR %bb.1
25 ; RV32I-NEXT: [[PHI:%[0-9]+]]:gpr = PHI [[COPY2]], %bb.1, [[COPY1]], %bb.0
26 ; RV32I-NEXT: $x10 = COPY [[PHI]]
27 ; RV32I-NEXT: PseudoRET implicit $x10
29 liveins: $x10, $x11, $x12
31 %0:gprb(s32) = COPY $x10
32 %1:gprb(s32) = COPY $x11
33 %2:gprb(s32) = COPY $x12
34 %3:gprb(s32) = G_CONSTANT i32 1
35 %4:gprb(s32) = G_AND %0, %3
36 G_BRCOND %4(s32), %bb.2
42 %5:gprb(s32) = G_PHI %2(s32), %bb.1, %1(s32), %bb.0
44 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]+]]:gpr = COPY $x10
58 ; RV32I-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
59 ; RV32I-NEXT: [[COPY2:%[0-9]+]]:gpr = COPY $x12
60 ; RV32I-NEXT: [[ANDI:%[0-9]+]]:gpr = ANDI [[COPY]], 1
61 ; RV32I-NEXT: BNE [[ANDI]], $x0, %bb.2
62 ; RV32I-NEXT: PseudoBR %bb.1
67 ; RV32I-NEXT: [[PHI:%[0-9]+]]:gpr = PHI [[COPY2]], %bb.1, [[COPY1]], %bb.0
68 ; RV32I-NEXT: $x10 = COPY [[PHI]]
69 ; RV32I-NEXT: PseudoRET implicit $x10
71 liveins: $x10, $x11, $x12
73 %0:gprb(s32) = COPY $x10
74 %1:gprb(p0) = COPY $x11
75 %2:gprb(p0) = COPY $x12
76 %3:gprb(s32) = G_CONSTANT i32 1
77 %4:gprb(s32) = G_AND %0, %3
78 G_BRCOND %4(s32), %bb.2
84 %5:gprb(p0) = G_PHI %2(p0), %bb.1, %1(p0), %bb.0
86 PseudoRET implicit $x10