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: brcond
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: [[LD:%[0-9]+]]:gpr = LD [[COPY1]], 0 :: (volatile load (s64))
19 ; RV64I-NEXT: BEQ [[LD]], [[COPY]], %bb.14
20 ; RV64I-NEXT: PseudoBR %bb.1
23 ; RV64I-NEXT: [[LD1:%[0-9]+]]:gpr = LD [[COPY1]], 0 :: (volatile load (s64))
24 ; RV64I-NEXT: BNE [[LD1]], [[COPY]], %bb.14
25 ; RV64I-NEXT: PseudoBR %bb.2
28 ; RV64I-NEXT: [[LD2:%[0-9]+]]:gpr = LD [[COPY1]], 0 :: (volatile load (s64))
29 ; RV64I-NEXT: BLT [[LD2]], [[COPY]], %bb.14
30 ; RV64I-NEXT: PseudoBR %bb.3
33 ; RV64I-NEXT: [[LD3:%[0-9]+]]:gpr = LD [[COPY1]], 0 :: (volatile load (s64))
34 ; RV64I-NEXT: BGE [[LD3]], [[COPY]], %bb.14
35 ; RV64I-NEXT: PseudoBR %bb.4
38 ; RV64I-NEXT: [[LD4:%[0-9]+]]:gpr = LD [[COPY1]], 0 :: (volatile load (s64))
39 ; RV64I-NEXT: BLTU [[LD4]], [[COPY]], %bb.14
40 ; RV64I-NEXT: PseudoBR %bb.5
43 ; RV64I-NEXT: [[LD5:%[0-9]+]]:gpr = LD [[COPY1]], 0 :: (volatile load (s64))
44 ; RV64I-NEXT: BGEU [[LD5]], [[COPY]], %bb.14
45 ; RV64I-NEXT: PseudoBR %bb.6
48 ; RV64I-NEXT: [[LD6:%[0-9]+]]:gpr = LD [[COPY1]], 0 :: (volatile load (s64))
49 ; RV64I-NEXT: BLT [[COPY]], [[LD6]], %bb.14
50 ; RV64I-NEXT: PseudoBR %bb.7
53 ; RV64I-NEXT: [[LD7:%[0-9]+]]:gpr = LD [[COPY1]], 0 :: (volatile load (s64))
54 ; RV64I-NEXT: BGE [[COPY]], [[LD7]], %bb.14
55 ; RV64I-NEXT: PseudoBR %bb.8
58 ; RV64I-NEXT: [[LD8:%[0-9]+]]:gpr = LD [[COPY1]], 0 :: (volatile load (s64))
59 ; RV64I-NEXT: BLTU [[COPY]], [[LD8]], %bb.14
60 ; RV64I-NEXT: PseudoBR %bb.9
63 ; RV64I-NEXT: [[LD9:%[0-9]+]]:gpr = LD [[COPY1]], 0 :: (volatile load (s64))
64 ; RV64I-NEXT: BGEU [[COPY]], [[LD9]], %bb.14
65 ; RV64I-NEXT: PseudoBR %bb.10
68 ; RV64I-NEXT: [[LD10:%[0-9]+]]:gpr = LD [[COPY1]], 0 :: (volatile load (s64))
69 ; RV64I-NEXT: [[ANDI:%[0-9]+]]:gpr = ANDI [[COPY2]], 1
70 ; RV64I-NEXT: BNE [[ANDI]], $x0, %bb.14
71 ; RV64I-NEXT: PseudoBR %bb.11
74 ; RV64I-NEXT: successors: %bb.14(0x50000000), %bb.12(0x30000000)
76 ; RV64I-NEXT: [[LD11:%[0-9]+]]:gpr = LD [[COPY1]], 0 :: (volatile load (s64))
77 ; RV64I-NEXT: BGE [[LD11]], $x0, %bb.14
78 ; RV64I-NEXT: PseudoBR %bb.12
81 ; RV64I-NEXT: successors: %bb.14(0x30000000), %bb.13(0x50000000)
83 ; RV64I-NEXT: [[LD12:%[0-9]+]]:gpr = LD [[COPY1]], 0 :: (volatile load (s64))
84 ; RV64I-NEXT: BGE $x0, [[LD12]], %bb.14
85 ; RV64I-NEXT: PseudoBR %bb.13
88 ; RV64I-NEXT: [[LD13:%[0-9]+]]:gpr = LD [[COPY1]], 0 :: (volatile load (s64))
91 ; RV64I-NEXT: PseudoRET
93 liveins: $x10, $x11, $x12
95 %0:gprb(s64) = COPY $x10
96 %1:gprb(p0) = COPY $x11
97 %3:gprb(s64) = COPY $x12
98 %26:gprb(s64) = G_CONSTANT i64 -1
99 %29:gprb(s64) = G_CONSTANT i64 1
100 %4:gprb(s64) = G_LOAD %1(p0) :: (volatile load (s64))
101 %56:gprb(s64) = G_ICMP intpred(eq), %4(s64), %0
102 G_BRCOND %56(s64), %bb.15
106 %6:gprb(s64) = G_LOAD %1(p0) :: (volatile load (s64))
107 %54:gprb(s64) = G_ICMP intpred(ne), %6(s64), %0
108 G_BRCOND %54(s64), %bb.15
112 %8:gprb(s64) = G_LOAD %1(p0) :: (volatile load (s64))
113 %52:gprb(s64) = G_ICMP intpred(slt), %8(s64), %0
114 G_BRCOND %52(s64), %bb.15
118 %10:gprb(s64) = G_LOAD %1(p0) :: (volatile load (s64))
119 %50:gprb(s64) = G_ICMP intpred(sge), %10(s64), %0
120 G_BRCOND %50(s64), %bb.15
124 %12:gprb(s64) = G_LOAD %1(p0) :: (volatile load (s64))
125 %48:gprb(s64) = G_ICMP intpred(ult), %12(s64), %0
126 G_BRCOND %48(s64), %bb.15
130 %14:gprb(s64) = G_LOAD %1(p0) :: (volatile load (s64))
131 %46:gprb(s64) = G_ICMP intpred(uge), %14(s64), %0
132 G_BRCOND %46(s64), %bb.15
136 %16:gprb(s64) = G_LOAD %1(p0) :: (volatile load (s64))
137 %44:gprb(s64) = G_ICMP intpred(sgt), %16(s64), %0
138 G_BRCOND %44(s64), %bb.15
142 %18:gprb(s64) = G_LOAD %1(p0) :: (volatile load (s64))
143 %42:gprb(s64) = G_ICMP intpred(sle), %18(s64), %0
144 G_BRCOND %42(s64), %bb.15
148 %20:gprb(s64) = G_LOAD %1(p0) :: (volatile load (s64))
149 %40:gprb(s64) = G_ICMP intpred(ugt), %20(s64), %0
150 G_BRCOND %40(s64), %bb.15
154 %22:gprb(s64) = G_LOAD %1(p0) :: (volatile load (s64))
155 %38:gprb(s64) = G_ICMP intpred(ule), %22(s64), %0
156 G_BRCOND %38(s64), %bb.15
160 %24:gprb(s64) = G_LOAD %1(p0) :: (volatile load (s64))
161 %57:gprb(s64) = G_CONSTANT i64 1
162 %36:gprb(s64) = G_AND %3, %57
163 G_BRCOND %36(s64), %bb.15
167 successors: %bb.15(0x50000000), %bb.13(0x30000000)
169 %25:gprb(s64) = G_LOAD %1(p0) :: (volatile load (s64))
170 %35:gprb(s64) = G_ICMP intpred(sgt), %25(s64), %26
171 G_BRCOND %35(s64), %bb.15
175 successors: %bb.15(0x30000000), %bb.14(0x50000000)
177 %28:gprb(s64) = G_LOAD %1(p0) :: (volatile load (s64))
178 %33:gprb(s64) = G_ICMP intpred(slt), %28(s64), %29
179 G_BRCOND %33(s64), %bb.15
183 %31:gprb(s64) = G_LOAD %1(p0) :: (volatile load (s64))