1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=riscv32 -mattr=+v,+m -run-pass=instruction-select \
3 # RUN: -simplify-mir -verify-machineinstrs %s -o - | FileCheck %s
9 tracksRegLiveness: true
12 ; CHECK-LABEL: name: test_1_s32
13 ; CHECK: [[PseudoReadVLENB:%[0-9]+]]:gpr = PseudoReadVLENB
14 ; CHECK-NEXT: [[SRLI:%[0-9]+]]:gpr = SRLI [[PseudoReadVLENB]], 3
15 ; CHECK-NEXT: $x10 = COPY [[SRLI]]
16 ; CHECK-NEXT: PseudoRET implicit $x10
17 %1:gprb(s32) = G_READ_VLENB
18 %2:gprb(s32) = G_CONSTANT i32 3
19 %0:gprb(s32) = G_LSHR %1, %2(s32)
21 PseudoRET implicit $x10
28 tracksRegLiveness: true
31 ; CHECK-LABEL: name: test_2_s32
32 ; CHECK: [[PseudoReadVLENB:%[0-9]+]]:gpr = PseudoReadVLENB
33 ; CHECK-NEXT: [[SRLI:%[0-9]+]]:gpr = SRLI [[PseudoReadVLENB]], 2
34 ; CHECK-NEXT: $x10 = COPY [[SRLI]]
35 ; CHECK-NEXT: PseudoRET implicit $x10
36 %1:gprb(s32) = G_READ_VLENB
37 %2:gprb(s32) = G_CONSTANT i32 2
38 %0:gprb(s32) = G_LSHR %1, %2(s32)
40 PseudoRET implicit $x10
47 tracksRegLiveness: true
50 ; CHECK-LABEL: name: test_3_s32
51 ; CHECK: [[PseudoReadVLENB:%[0-9]+]]:gpr = PseudoReadVLENB
52 ; CHECK-NEXT: [[SRLI:%[0-9]+]]:gpr = SRLI [[PseudoReadVLENB]], 3
53 ; CHECK-NEXT: [[ADDI:%[0-9]+]]:gpr = ADDI $x0, 3
54 ; CHECK-NEXT: [[MUL:%[0-9]+]]:gpr = MUL [[SRLI]], [[ADDI]]
55 ; CHECK-NEXT: $x10 = COPY [[MUL]]
56 ; CHECK-NEXT: PseudoRET implicit $x10
57 %1:gprb(s32) = G_READ_VLENB
58 %2:gprb(s32) = G_CONSTANT i32 3
59 %3:gprb(s32) = G_LSHR %1, %2(s32)
60 %4:gprb(s32) = G_CONSTANT i32 3
61 %0:gprb(s32) = G_MUL %3, %4
63 PseudoRET implicit $x10
70 tracksRegLiveness: true
73 ; CHECK-LABEL: name: test_4_s32
74 ; CHECK: [[PseudoReadVLENB:%[0-9]+]]:gpr = PseudoReadVLENB
75 ; CHECK-NEXT: [[SRLI:%[0-9]+]]:gpr = SRLI [[PseudoReadVLENB]], 1
76 ; CHECK-NEXT: $x10 = COPY [[SRLI]]
77 ; CHECK-NEXT: PseudoRET implicit $x10
78 %1:gprb(s32) = G_READ_VLENB
79 %2:gprb(s32) = G_CONSTANT i32 1
80 %0:gprb(s32) = G_LSHR %1, %2(s32)
82 PseudoRET implicit $x10
89 tracksRegLiveness: true
92 ; CHECK-LABEL: name: test_8_s32
93 ; CHECK: [[PseudoReadVLENB:%[0-9]+]]:gpr = PseudoReadVLENB
94 ; CHECK-NEXT: $x10 = COPY [[PseudoReadVLENB]]
95 ; CHECK-NEXT: PseudoRET implicit $x10
96 %0:gprb(s32) = G_READ_VLENB
98 PseudoRET implicit $x10
104 regBankSelected: true
105 tracksRegLiveness: true
108 ; CHECK-LABEL: name: test_16_s32
109 ; CHECK: [[PseudoReadVLENB:%[0-9]+]]:gpr = PseudoReadVLENB
110 ; CHECK-NEXT: [[SLLI:%[0-9]+]]:gpr = SLLI [[PseudoReadVLENB]], 1
111 ; CHECK-NEXT: $x10 = COPY [[SLLI]]
112 ; CHECK-NEXT: PseudoRET implicit $x10
113 %1:gprb(s32) = G_READ_VLENB
114 %2:gprb(s32) = G_CONSTANT i32 1
115 %0:gprb(s32) = G_SHL %1, %2(s32)
117 PseudoRET implicit $x10
123 regBankSelected: true
124 tracksRegLiveness: true
127 ; CHECK-LABEL: name: test_40_s32
128 ; CHECK: [[PseudoReadVLENB:%[0-9]+]]:gpr = PseudoReadVLENB
129 ; CHECK-NEXT: [[ADDI:%[0-9]+]]:gpr = ADDI $x0, 5
130 ; CHECK-NEXT: [[MUL:%[0-9]+]]:gpr = MUL [[PseudoReadVLENB]], [[ADDI]]
131 ; CHECK-NEXT: $x10 = COPY [[MUL]]
132 ; CHECK-NEXT: PseudoRET implicit $x10
133 %1:gprb(s32) = G_READ_VLENB
134 %2:gprb(s32) = G_CONSTANT i32 5
135 %0:gprb(s32) = G_MUL %1, %2
137 PseudoRET implicit $x10
143 regBankSelected: true
144 tracksRegLiveness: true
147 ; CHECK-LABEL: name: test_1_s64
148 ; CHECK: [[PseudoReadVLENB:%[0-9]+]]:gpr = PseudoReadVLENB
149 ; CHECK-NEXT: [[SRLI:%[0-9]+]]:gpr = SRLI [[PseudoReadVLENB]], 3
150 ; CHECK-NEXT: [[ADDI:%[0-9]+]]:gpr = ADDI $x0, 1
151 ; CHECK-NEXT: [[MUL:%[0-9]+]]:gpr = MUL [[SRLI]], [[ADDI]]
152 ; CHECK-NEXT: $x10 = COPY [[MUL]]
153 ; CHECK-NEXT: PseudoRET implicit $x10
154 %17:gprb(s32) = G_READ_VLENB
155 %18:gprb(s32) = G_CONSTANT i32 3
156 %2:gprb(s32) = G_LSHR %17, %18(s32)
157 %15:gprb(s32) = G_CONSTANT i32 1
158 %9:gprb(s32) = G_MUL %2, %15
160 PseudoRET implicit $x10
166 regBankSelected: true
167 tracksRegLiveness: true
170 ; CHECK-LABEL: name: test_2_s64
171 ; CHECK: [[PseudoReadVLENB:%[0-9]+]]:gpr = PseudoReadVLENB
172 ; CHECK-NEXT: [[SRLI:%[0-9]+]]:gpr = SRLI [[PseudoReadVLENB]], 3
173 ; CHECK-NEXT: [[ADDI:%[0-9]+]]:gpr = ADDI $x0, 2
174 ; CHECK-NEXT: [[MUL:%[0-9]+]]:gpr = MUL [[SRLI]], [[ADDI]]
175 ; CHECK-NEXT: $x10 = COPY [[MUL]]
176 ; CHECK-NEXT: PseudoRET implicit $x10
177 %17:gprb(s32) = G_READ_VLENB
178 %18:gprb(s32) = G_CONSTANT i32 3
179 %2:gprb(s32) = G_LSHR %17, %18(s32)
180 %15:gprb(s32) = G_CONSTANT i32 2
181 %9:gprb(s32) = G_MUL %2, %15
183 PseudoRET implicit $x10
189 regBankSelected: true
190 tracksRegLiveness: true
193 ; CHECK-LABEL: name: test_3_s64
194 ; CHECK: [[PseudoReadVLENB:%[0-9]+]]:gpr = PseudoReadVLENB
195 ; CHECK-NEXT: [[SRLI:%[0-9]+]]:gpr = SRLI [[PseudoReadVLENB]], 3
196 ; CHECK-NEXT: [[ADDI:%[0-9]+]]:gpr = ADDI $x0, 3
197 ; CHECK-NEXT: [[MUL:%[0-9]+]]:gpr = MUL [[SRLI]], [[ADDI]]
198 ; CHECK-NEXT: $x10 = COPY [[MUL]]
199 ; CHECK-NEXT: PseudoRET implicit $x10
200 %17:gprb(s32) = G_READ_VLENB
201 %18:gprb(s32) = G_CONSTANT i32 3
202 %2:gprb(s32) = G_LSHR %17, %18(s32)
203 %15:gprb(s32) = G_CONSTANT i32 3
204 %9:gprb(s32) = G_MUL %2, %15
206 PseudoRET implicit $x10
212 regBankSelected: true
213 tracksRegLiveness: true
216 ; CHECK-LABEL: name: test_4_s64
217 ; CHECK: [[PseudoReadVLENB:%[0-9]+]]:gpr = PseudoReadVLENB
218 ; CHECK-NEXT: [[SRLI:%[0-9]+]]:gpr = SRLI [[PseudoReadVLENB]], 3
219 ; CHECK-NEXT: [[ADDI:%[0-9]+]]:gpr = ADDI $x0, 4
220 ; CHECK-NEXT: [[MUL:%[0-9]+]]:gpr = MUL [[SRLI]], [[ADDI]]
221 ; CHECK-NEXT: $x10 = COPY [[MUL]]
222 ; CHECK-NEXT: PseudoRET implicit $x10
223 %17:gprb(s32) = G_READ_VLENB
224 %18:gprb(s32) = G_CONSTANT i32 3
225 %2:gprb(s32) = G_LSHR %17, %18(s32)
226 %15:gprb(s32) = G_CONSTANT i32 4
227 %9:gprb(s32) = G_MUL %2, %15
229 PseudoRET implicit $x10
235 regBankSelected: true
236 tracksRegLiveness: true
239 ; CHECK-LABEL: name: test_8_s64
240 ; CHECK: [[PseudoReadVLENB:%[0-9]+]]:gpr = PseudoReadVLENB
241 ; CHECK-NEXT: [[SRLI:%[0-9]+]]:gpr = SRLI [[PseudoReadVLENB]], 3
242 ; CHECK-NEXT: [[ADDI:%[0-9]+]]:gpr = ADDI $x0, 8
243 ; CHECK-NEXT: [[MUL:%[0-9]+]]:gpr = MUL [[SRLI]], [[ADDI]]
244 ; CHECK-NEXT: $x10 = COPY [[MUL]]
245 ; CHECK-NEXT: PseudoRET implicit $x10
246 %17:gprb(s32) = G_READ_VLENB
247 %18:gprb(s32) = G_CONSTANT i32 3
248 %2:gprb(s32) = G_LSHR %17, %18(s32)
249 %15:gprb(s32) = G_CONSTANT i32 8
250 %9:gprb(s32) = G_MUL %2, %15
252 PseudoRET implicit $x10
258 regBankSelected: true
259 tracksRegLiveness: true
262 ; CHECK-LABEL: name: test_16_s64
263 ; CHECK: [[PseudoReadVLENB:%[0-9]+]]:gpr = PseudoReadVLENB
264 ; CHECK-NEXT: [[SRLI:%[0-9]+]]:gpr = SRLI [[PseudoReadVLENB]], 3
265 ; CHECK-NEXT: [[ADDI:%[0-9]+]]:gpr = ADDI $x0, 16
266 ; CHECK-NEXT: [[MUL:%[0-9]+]]:gpr = MUL [[SRLI]], [[ADDI]]
267 ; CHECK-NEXT: $x10 = COPY [[MUL]]
268 ; CHECK-NEXT: PseudoRET implicit $x10
269 %17:gprb(s32) = G_READ_VLENB
270 %18:gprb(s32) = G_CONSTANT i32 3
271 %2:gprb(s32) = G_LSHR %17, %18(s32)
272 %15:gprb(s32) = G_CONSTANT i32 16
273 %9:gprb(s32) = G_MUL %2, %15
275 PseudoRET implicit $x10
281 regBankSelected: true
282 tracksRegLiveness: true
285 ; CHECK-LABEL: name: test_40_s64
286 ; CHECK: [[PseudoReadVLENB:%[0-9]+]]:gpr = PseudoReadVLENB
287 ; CHECK-NEXT: [[SRLI:%[0-9]+]]:gpr = SRLI [[PseudoReadVLENB]], 3
288 ; CHECK-NEXT: [[ADDI:%[0-9]+]]:gpr = ADDI $x0, 40
289 ; CHECK-NEXT: [[MUL:%[0-9]+]]:gpr = MUL [[SRLI]], [[ADDI]]
290 ; CHECK-NEXT: $x10 = COPY [[MUL]]
291 ; CHECK-NEXT: PseudoRET implicit $x10
292 %17:gprb(s32) = G_READ_VLENB
293 %18:gprb(s32) = G_CONSTANT i32 3
294 %2:gprb(s32) = G_LSHR %17, %18(s32)
295 %15:gprb(s32) = G_CONSTANT i32 40
296 %9:gprb(s32) = G_MUL %2, %15
298 PseudoRET implicit $x10