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