1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=riscv64 -run-pass=instruction-select %s -o - \
9 tracksRegLiveness: true
12 liveins: $x10, $x11, $x12
14 ; CHECK-LABEL: name: select_s32
15 ; CHECK: liveins: $x10, $x11, $x12
17 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
18 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
19 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gpr = COPY $x12
20 ; CHECK-NEXT: [[Select_GPR_Using_CC_GPR:%[0-9]+]]:gpr = Select_GPR_Using_CC_GPR [[COPY]], $x0, 1, [[COPY1]], [[COPY2]]
21 ; CHECK-NEXT: $x10 = COPY [[Select_GPR_Using_CC_GPR]]
22 ; CHECK-NEXT: PseudoRET implicit $x10
23 %0:gprb(s64) = COPY $x10
24 %1:gprb(s64) = COPY $x11
25 %2:gprb(s64) = COPY $x12
26 %3:gprb(s32) = G_TRUNC %1
27 %4:gprb(s32) = G_TRUNC %2
28 %5:gprb(s32) = G_SELECT %0, %3, %4
29 %6:gprb(s64) = G_ANYEXT %5
31 PseudoRET implicit $x10
38 tracksRegLiveness: true
41 liveins: $x10, $x11, $x12
43 ; CHECK-LABEL: name: select_s64
44 ; CHECK: liveins: $x10, $x11, $x12
46 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
47 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
48 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gpr = COPY $x12
49 ; CHECK-NEXT: [[Select_GPR_Using_CC_GPR:%[0-9]+]]:gpr = Select_GPR_Using_CC_GPR [[COPY]], $x0, 1, [[COPY1]], [[COPY2]]
50 ; CHECK-NEXT: $x10 = COPY [[Select_GPR_Using_CC_GPR]]
51 ; CHECK-NEXT: PseudoRET implicit $x10
52 %0:gprb(s64) = COPY $x10
53 %1:gprb(s64) = COPY $x11
54 %2:gprb(s64) = COPY $x12
55 %3:gprb(s64) = G_SELECT %0, %1, %2
57 PseudoRET implicit $x10
64 tracksRegLiveness: true
67 liveins: $x10, $x11, $x12
69 ; CHECK-LABEL: name: select_p0
70 ; CHECK: liveins: $x10, $x11, $x12
72 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
73 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
74 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gpr = COPY $x12
75 ; CHECK-NEXT: [[Select_GPR_Using_CC_GPR:%[0-9]+]]:gpr = Select_GPR_Using_CC_GPR [[COPY]], $x0, 1, [[COPY1]], [[COPY2]]
76 ; CHECK-NEXT: $x10 = COPY [[Select_GPR_Using_CC_GPR]]
77 ; CHECK-NEXT: PseudoRET implicit $x10
78 %0:gprb(s64) = COPY $x10
79 %1:gprb(p0) = COPY $x11
80 %2:gprb(p0) = COPY $x12
81 %3:gprb(p0) = G_SELECT %0, %1, %2
83 PseudoRET implicit $x10
90 tracksRegLiveness: true
93 liveins: $x10, $x11, $x12, $x13, $x14
95 ; CHECK-LABEL: name: select_icmp_ult
96 ; CHECK: liveins: $x10, $x11, $x12, $x13, $x14
98 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
99 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
100 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gpr = COPY $x12
101 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:gpr = COPY $x13
102 ; CHECK-NEXT: [[Select_GPR_Using_CC_GPR:%[0-9]+]]:gpr = Select_GPR_Using_CC_GPR [[COPY2]], [[COPY3]], 4, [[COPY]], [[COPY1]]
103 ; CHECK-NEXT: $x10 = COPY [[Select_GPR_Using_CC_GPR]]
104 ; CHECK-NEXT: PseudoRET implicit $x10
105 %0:gprb(s64) = COPY $x10
106 %1:gprb(s64) = COPY $x11
107 %2:gprb(s64) = COPY $x12
108 %3:gprb(s64) = COPY $x13
109 %4:gprb(s64) = COPY $x14
110 %5:gprb(s64) = G_ICMP intpred(ult), %2, %3
111 %6:gprb(s64) = G_SELECT %5, %0, %1
113 PseudoRET implicit $x10
117 name: select_icmp_ugt
119 regBankSelected: true
120 tracksRegLiveness: true
123 liveins: $x10, $x11, $x12, $x13, $x14
125 ; CHECK-LABEL: name: select_icmp_ugt
126 ; CHECK: liveins: $x10, $x11, $x12, $x13, $x14
128 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
129 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
130 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gpr = COPY $x12
131 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:gpr = COPY $x13
132 ; CHECK-NEXT: [[Select_GPR_Using_CC_GPR:%[0-9]+]]:gpr = Select_GPR_Using_CC_GPR [[COPY3]], [[COPY2]], 4, [[COPY]], [[COPY1]]
133 ; CHECK-NEXT: $x10 = COPY [[Select_GPR_Using_CC_GPR]]
134 ; CHECK-NEXT: PseudoRET implicit $x10
135 %0:gprb(s64) = COPY $x10
136 %1:gprb(s64) = COPY $x11
137 %2:gprb(s64) = COPY $x12
138 %3:gprb(s64) = COPY $x13
139 %4:gprb(s64) = COPY $x14
140 %5:gprb(s64) = G_ICMP intpred(ugt), %2, %3
141 %6:gprb(s64) = G_SELECT %5, %0, %1
143 PseudoRET implicit $x10
147 name: select_icmp_sgtneg1
149 regBankSelected: true
150 tracksRegLiveness: true
153 liveins: $x10, $x11, $x12, $x13, $x14
155 ; CHECK-LABEL: name: select_icmp_sgtneg1
156 ; CHECK: liveins: $x10, $x11, $x12, $x13, $x14
158 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
159 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
160 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gpr = COPY $x12
161 ; CHECK-NEXT: [[Select_GPR_Using_CC_GPR:%[0-9]+]]:gpr = Select_GPR_Using_CC_GPR [[COPY2]], $x0, 3, [[COPY]], [[COPY1]]
162 ; CHECK-NEXT: $x10 = COPY [[Select_GPR_Using_CC_GPR]]
163 ; CHECK-NEXT: PseudoRET implicit $x10
164 %0:gprb(s64) = COPY $x10
165 %1:gprb(s64) = COPY $x11
166 %2:gprb(s64) = COPY $x12
167 %3:gprb(s64) = COPY $x13
168 %4:gprb(s64) = COPY $x14
169 %5:gprb(s64) = G_CONSTANT i64 -1
170 %6:gprb(s64) = G_ICMP intpred(sgt), %2, %5
171 %7:gprb(s64) = G_SELECT %6, %0, %1
173 PseudoRET implicit $x10
177 name: select_icmp_slt1
179 regBankSelected: true
180 tracksRegLiveness: true
183 liveins: $x10, $x11, $x12, $x13, $x14
185 ; CHECK-LABEL: name: select_icmp_slt1
186 ; CHECK: liveins: $x10, $x11, $x12, $x13, $x14
188 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
189 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
190 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gpr = COPY $x12
191 ; CHECK-NEXT: [[Select_GPR_Using_CC_GPR:%[0-9]+]]:gpr = Select_GPR_Using_CC_GPR $x0, [[COPY2]], 3, [[COPY]], [[COPY1]]
192 ; CHECK-NEXT: $x10 = COPY [[Select_GPR_Using_CC_GPR]]
193 ; CHECK-NEXT: PseudoRET implicit $x10
194 %0:gprb(s64) = COPY $x10
195 %1:gprb(s64) = COPY $x11
196 %2:gprb(s64) = COPY $x12
197 %3:gprb(s64) = COPY $x13
198 %4:gprb(s64) = COPY $x14
199 %5:gprb(s64) = G_CONSTANT i64 1
200 %6:gprb(s64) = G_ICMP intpred(slt), %2, %5
201 %7:gprb(s64) = G_SELECT %6, %0, %1
203 PseudoRET implicit $x10