1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=riscv32 -run-pass=instruction-select --simplify-mir \
3 # RUN: -verify-machineinstrs %s -o - | FileCheck %s
8 tracksRegLiveness: true
11 liveins: $x10, $x11, $x12
13 ; CHECK-LABEL: name: select_s32
14 ; CHECK: liveins: $x10, $x11, $x12
16 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
17 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
18 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gpr = COPY $x12
19 ; CHECK-NEXT: [[Select_GPR_Using_CC_GPR:%[0-9]+]]:gpr = Select_GPR_Using_CC_GPR [[COPY]], $x0, 1, [[COPY1]], [[COPY2]]
20 ; CHECK-NEXT: $x10 = COPY [[Select_GPR_Using_CC_GPR]]
21 ; CHECK-NEXT: PseudoRET implicit $x10
22 %0:gprb(s32) = COPY $x10
23 %1:gprb(s32) = COPY $x11
24 %2:gprb(s32) = COPY $x12
25 %3:gprb(s32) = G_SELECT %0, %1, %2
27 PseudoRET implicit $x10
34 tracksRegLiveness: true
37 liveins: $x10, $x11, $x12
39 ; CHECK-LABEL: name: select_p0
40 ; CHECK: liveins: $x10, $x11, $x12
42 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
43 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
44 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gpr = COPY $x12
45 ; CHECK-NEXT: [[Select_GPR_Using_CC_GPR:%[0-9]+]]:gpr = Select_GPR_Using_CC_GPR [[COPY]], $x0, 1, [[COPY1]], [[COPY2]]
46 ; CHECK-NEXT: $x10 = COPY [[Select_GPR_Using_CC_GPR]]
47 ; CHECK-NEXT: PseudoRET implicit $x10
48 %0:gprb(s32) = COPY $x10
49 %1:gprb(p0) = COPY $x11
50 %2:gprb(p0) = COPY $x12
51 %3:gprb(p0) = G_SELECT %0, %1, %2
53 PseudoRET implicit $x10
60 tracksRegLiveness: true
63 liveins: $x10, $x11, $x12, $x13, $x14
65 ; CHECK-LABEL: name: select_icmp_ult
66 ; CHECK: liveins: $x10, $x11, $x12, $x13, $x14
68 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
69 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
70 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gpr = COPY $x12
71 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:gpr = COPY $x13
72 ; CHECK-NEXT: [[Select_GPR_Using_CC_GPR:%[0-9]+]]:gpr = Select_GPR_Using_CC_GPR [[COPY2]], [[COPY3]], 4, [[COPY]], [[COPY1]]
73 ; CHECK-NEXT: $x10 = COPY [[Select_GPR_Using_CC_GPR]]
74 ; CHECK-NEXT: PseudoRET implicit $x10
75 %0:gprb(s32) = COPY $x10
76 %1:gprb(s32) = COPY $x11
77 %2:gprb(s32) = COPY $x12
78 %3:gprb(s32) = COPY $x13
79 %4:gprb(s32) = COPY $x14
80 %5:gprb(s32) = G_ICMP intpred(ult), %2, %3
81 %6:gprb(s32) = G_SELECT %5, %0, %1
83 PseudoRET implicit $x10
90 tracksRegLiveness: true
93 liveins: $x10, $x11, $x12, $x13, $x14
95 ; CHECK-LABEL: name: select_icmp_ugt
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 [[COPY3]], [[COPY2]], 4, [[COPY]], [[COPY1]]
103 ; CHECK-NEXT: $x10 = COPY [[Select_GPR_Using_CC_GPR]]
104 ; CHECK-NEXT: PseudoRET implicit $x10
105 %0:gprb(s32) = COPY $x10
106 %1:gprb(s32) = COPY $x11
107 %2:gprb(s32) = COPY $x12
108 %3:gprb(s32) = COPY $x13
109 %4:gprb(s32) = COPY $x14
110 %5:gprb(s32) = G_ICMP intpred(ugt), %2, %3
111 %6:gprb(s32) = G_SELECT %5, %0, %1
113 PseudoRET implicit $x10
117 name: select_icmp_sgtneg1
119 regBankSelected: true
120 tracksRegLiveness: true
123 liveins: $x10, $x11, $x12, $x13, $x14
125 ; CHECK-LABEL: name: select_icmp_sgtneg1
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: [[Select_GPR_Using_CC_GPR:%[0-9]+]]:gpr = Select_GPR_Using_CC_GPR [[COPY2]], $x0, 3, [[COPY]], [[COPY1]]
132 ; CHECK-NEXT: $x10 = COPY [[Select_GPR_Using_CC_GPR]]
133 ; CHECK-NEXT: PseudoRET implicit $x10
134 %0:gprb(s32) = COPY $x10
135 %1:gprb(s32) = COPY $x11
136 %2:gprb(s32) = COPY $x12
137 %3:gprb(s32) = COPY $x13
138 %4:gprb(s32) = COPY $x14
139 %5:gprb(s32) = G_CONSTANT i32 -1
140 %6:gprb(s32) = G_ICMP intpred(sgt), %2, %5
141 %7:gprb(s32) = G_SELECT %6, %0, %1
143 PseudoRET implicit $x10
147 name: select_icmp_slt1
149 regBankSelected: true
150 tracksRegLiveness: true
153 liveins: $x10, $x11, $x12, $x13, $x14
155 ; CHECK-LABEL: name: select_icmp_slt1
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 $x0, [[COPY2]], 3, [[COPY]], [[COPY1]]
162 ; CHECK-NEXT: $x10 = COPY [[Select_GPR_Using_CC_GPR]]
163 ; CHECK-NEXT: PseudoRET implicit $x10
164 %0:gprb(s32) = COPY $x10
165 %1:gprb(s32) = COPY $x11
166 %2:gprb(s32) = COPY $x12
167 %3:gprb(s32) = COPY $x13
168 %4:gprb(s32) = COPY $x14
169 %5:gprb(s32) = G_CONSTANT i32 1
170 %6:gprb(s32) = G_ICMP intpred(slt), %2, %5
171 %7:gprb(s32) = G_SELECT %6, %0, %1
173 PseudoRET implicit $x10