1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O0 -mtriple=mipsel-linux-gnu -run-pass=legalizer -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=MIPS32
5 define void @mul_i32() {entry: ret void}
6 define void @mul_i8_sext() {entry: ret void}
7 define void @mul_i8_zext() {entry: ret void}
8 define void @mul_i8_aext() {entry: ret void}
9 define void @mul_i16_sext() {entry: ret void}
10 define void @mul_i16_zext() {entry: ret void}
11 define void @mul_i16_aext() {entry: ret void}
12 define void @mul_i64() {entry: ret void}
13 define void @mul_i128() {entry: ret void}
14 define void @umulh_i64() {entry: ret void}
15 define void @umul_with_overflow(i32 %lhs, i32 %rhs, ptr %pmul, ptr %pcarry_flag) { ret void }
21 tracksRegLiveness: true
26 ; MIPS32-LABEL: name: mul_i32
27 ; MIPS32: liveins: $a0, $a1
28 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
29 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
30 ; MIPS32: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[COPY]], [[COPY1]]
31 ; MIPS32: $v0 = COPY [[MUL]](s32)
32 ; MIPS32: RetRA implicit $v0
35 %2:_(s32) = G_MUL %0, %1
43 tracksRegLiveness: true
48 ; MIPS32-LABEL: name: mul_i8_sext
49 ; MIPS32: liveins: $a0, $a1
50 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
51 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
52 ; MIPS32: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[COPY1]], [[COPY]]
53 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
54 ; MIPS32: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[MUL]], [[C]](s32)
55 ; MIPS32: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
56 ; MIPS32: $v0 = COPY [[ASHR]](s32)
57 ; MIPS32: RetRA implicit $v0
59 %0:_(s8) = G_TRUNC %2(s32)
61 %1:_(s8) = G_TRUNC %3(s32)
62 %4:_(s8) = G_MUL %1, %0
63 %5:_(s32) = G_SEXT %4(s8)
71 tracksRegLiveness: true
76 ; MIPS32-LABEL: name: mul_i8_zext
77 ; MIPS32: liveins: $a0, $a1
78 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
79 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
80 ; MIPS32: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[COPY1]], [[COPY]]
81 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
82 ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[MUL]], [[C]]
83 ; MIPS32: $v0 = COPY [[AND]](s32)
84 ; MIPS32: RetRA implicit $v0
86 %0:_(s8) = G_TRUNC %2(s32)
88 %1:_(s8) = G_TRUNC %3(s32)
89 %4:_(s8) = G_MUL %1, %0
90 %5:_(s32) = G_ZEXT %4(s8)
98 tracksRegLiveness: true
103 ; MIPS32-LABEL: name: mul_i8_aext
104 ; MIPS32: liveins: $a0, $a1
105 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
106 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
107 ; MIPS32: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[COPY1]], [[COPY]]
108 ; MIPS32: $v0 = COPY [[MUL]](s32)
109 ; MIPS32: RetRA implicit $v0
111 %0:_(s8) = G_TRUNC %2(s32)
113 %1:_(s8) = G_TRUNC %3(s32)
114 %4:_(s8) = G_MUL %1, %0
115 %5:_(s32) = G_ANYEXT %4(s8)
123 tracksRegLiveness: true
128 ; MIPS32-LABEL: name: mul_i16_sext
129 ; MIPS32: liveins: $a0, $a1
130 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
131 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
132 ; MIPS32: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[COPY1]], [[COPY]]
133 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
134 ; MIPS32: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[MUL]], [[C]](s32)
135 ; MIPS32: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
136 ; MIPS32: $v0 = COPY [[ASHR]](s32)
137 ; MIPS32: RetRA implicit $v0
139 %0:_(s16) = G_TRUNC %2(s32)
141 %1:_(s16) = G_TRUNC %3(s32)
142 %4:_(s16) = G_MUL %1, %0
143 %5:_(s32) = G_SEXT %4(s16)
151 tracksRegLiveness: true
156 ; MIPS32-LABEL: name: mul_i16_zext
157 ; MIPS32: liveins: $a0, $a1
158 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
159 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
160 ; MIPS32: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[COPY1]], [[COPY]]
161 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
162 ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[MUL]], [[C]]
163 ; MIPS32: $v0 = COPY [[AND]](s32)
164 ; MIPS32: RetRA implicit $v0
166 %0:_(s16) = G_TRUNC %2(s32)
168 %1:_(s16) = G_TRUNC %3(s32)
169 %4:_(s16) = G_MUL %1, %0
170 %5:_(s32) = G_ZEXT %4(s16)
178 tracksRegLiveness: true
183 ; MIPS32-LABEL: name: mul_i16_aext
184 ; MIPS32: liveins: $a0, $a1
185 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
186 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
187 ; MIPS32: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[COPY1]], [[COPY]]
188 ; MIPS32: $v0 = COPY [[MUL]](s32)
189 ; MIPS32: RetRA implicit $v0
191 %0:_(s16) = G_TRUNC %2(s32)
193 %1:_(s16) = G_TRUNC %3(s32)
194 %4:_(s16) = G_MUL %1, %0
195 %5:_(s32) = G_ANYEXT %4(s16)
203 tracksRegLiveness: true
206 liveins: $a0, $a1, $a2, $a3
208 ; MIPS32-LABEL: name: mul_i64
209 ; MIPS32: liveins: $a0, $a1, $a2, $a3
210 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
211 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
212 ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY $a2
213 ; MIPS32: [[COPY3:%[0-9]+]]:_(s32) = COPY $a3
214 ; MIPS32: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[COPY2]], [[COPY]]
215 ; MIPS32: [[MUL1:%[0-9]+]]:_(s32) = G_MUL [[COPY3]], [[COPY]]
216 ; MIPS32: [[MUL2:%[0-9]+]]:_(s32) = G_MUL [[COPY2]], [[COPY1]]
217 ; MIPS32: [[UMULH:%[0-9]+]]:_(s32) = G_UMULH [[COPY2]], [[COPY]]
218 ; MIPS32: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[MUL1]], [[MUL2]]
219 ; MIPS32: [[ADD1:%[0-9]+]]:_(s32) = G_ADD [[ADD]], [[UMULH]]
220 ; MIPS32: $v0 = COPY [[MUL]](s32)
221 ; MIPS32: $v1 = COPY [[ADD1]](s32)
222 ; MIPS32: RetRA implicit $v0, implicit $v1
225 %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32)
228 %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32)
229 %6:_(s64) = G_MUL %1, %0
230 %7:_(s32), %8:_(s32) = G_UNMERGE_VALUES %6(s64)
233 RetRA implicit $v0, implicit $v1
239 tracksRegLiveness: true
241 - { id: 0, offset: 28, size: 4, alignment: 4, stack-id: default, isImmutable: true }
242 - { id: 1, offset: 24, size: 4, alignment: 8, stack-id: default, isImmutable: true }
243 - { id: 2, offset: 20, size: 4, alignment: 4, stack-id: default, isImmutable: true }
244 - { id: 3, offset: 16, size: 4, alignment: 8, stack-id: default, isImmutable: true }
247 liveins: $a0, $a1, $a2, $a3
249 ; MIPS32-LABEL: name: mul_i128
250 ; MIPS32: liveins: $a0, $a1, $a2, $a3
251 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
252 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
253 ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY $a2
254 ; MIPS32: [[COPY3:%[0-9]+]]:_(s32) = COPY $a3
255 ; MIPS32: [[FRAME_INDEX:%[0-9]+]]:_(p0) = G_FRAME_INDEX %fixed-stack.0
256 ; MIPS32: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[FRAME_INDEX]](p0) :: (load (s32) from %fixed-stack.0, align 8)
257 ; MIPS32: [[FRAME_INDEX1:%[0-9]+]]:_(p0) = G_FRAME_INDEX %fixed-stack.1
258 ; MIPS32: [[LOAD1:%[0-9]+]]:_(s32) = G_LOAD [[FRAME_INDEX1]](p0) :: (load (s32) from %fixed-stack.1)
259 ; MIPS32: [[FRAME_INDEX2:%[0-9]+]]:_(p0) = G_FRAME_INDEX %fixed-stack.2
260 ; MIPS32: [[LOAD2:%[0-9]+]]:_(s32) = G_LOAD [[FRAME_INDEX2]](p0) :: (load (s32) from %fixed-stack.2, align 8)
261 ; MIPS32: [[FRAME_INDEX3:%[0-9]+]]:_(p0) = G_FRAME_INDEX %fixed-stack.3
262 ; MIPS32: [[LOAD3:%[0-9]+]]:_(s32) = G_LOAD [[FRAME_INDEX3]](p0) :: (load (s32) from %fixed-stack.3)
263 ; MIPS32: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[LOAD]], [[COPY]]
264 ; MIPS32: [[MUL1:%[0-9]+]]:_(s32) = G_MUL [[LOAD1]], [[COPY]]
265 ; MIPS32: [[MUL2:%[0-9]+]]:_(s32) = G_MUL [[LOAD]], [[COPY1]]
266 ; MIPS32: [[UMULH:%[0-9]+]]:_(s32) = G_UMULH [[LOAD]], [[COPY]]
267 ; MIPS32: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[MUL1]], [[MUL2]]
268 ; MIPS32: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[ADD]](s32), [[MUL2]]
269 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
270 ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C]]
271 ; MIPS32: [[ADD1:%[0-9]+]]:_(s32) = G_ADD [[ADD]], [[UMULH]]
272 ; MIPS32: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[ADD1]](s32), [[UMULH]]
273 ; MIPS32: [[AND1:%[0-9]+]]:_(s32) = G_AND [[ICMP1]], [[C]]
274 ; MIPS32: [[ADD2:%[0-9]+]]:_(s32) = G_ADD [[AND]], [[AND1]]
275 ; MIPS32: [[MUL3:%[0-9]+]]:_(s32) = G_MUL [[LOAD2]], [[COPY]]
276 ; MIPS32: [[MUL4:%[0-9]+]]:_(s32) = G_MUL [[LOAD1]], [[COPY1]]
277 ; MIPS32: [[MUL5:%[0-9]+]]:_(s32) = G_MUL [[LOAD]], [[COPY2]]
278 ; MIPS32: [[UMULH1:%[0-9]+]]:_(s32) = G_UMULH [[LOAD1]], [[COPY]]
279 ; MIPS32: [[UMULH2:%[0-9]+]]:_(s32) = G_UMULH [[LOAD]], [[COPY1]]
280 ; MIPS32: [[ADD3:%[0-9]+]]:_(s32) = G_ADD [[MUL3]], [[MUL4]]
281 ; MIPS32: [[ICMP2:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[ADD3]](s32), [[MUL4]]
282 ; MIPS32: [[AND2:%[0-9]+]]:_(s32) = G_AND [[ICMP2]], [[C]]
283 ; MIPS32: [[ADD4:%[0-9]+]]:_(s32) = G_ADD [[ADD3]], [[MUL5]]
284 ; MIPS32: [[ICMP3:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[ADD4]](s32), [[MUL5]]
285 ; MIPS32: [[AND3:%[0-9]+]]:_(s32) = G_AND [[ICMP3]], [[C]]
286 ; MIPS32: [[ADD5:%[0-9]+]]:_(s32) = G_ADD [[AND2]], [[AND3]]
287 ; MIPS32: [[ADD6:%[0-9]+]]:_(s32) = G_ADD [[ADD4]], [[UMULH1]]
288 ; MIPS32: [[ICMP4:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[ADD6]](s32), [[UMULH1]]
289 ; MIPS32: [[AND4:%[0-9]+]]:_(s32) = G_AND [[ICMP4]], [[C]]
290 ; MIPS32: [[ADD7:%[0-9]+]]:_(s32) = G_ADD [[ADD5]], [[AND4]]
291 ; MIPS32: [[ADD8:%[0-9]+]]:_(s32) = G_ADD [[ADD6]], [[UMULH2]]
292 ; MIPS32: [[ICMP5:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[ADD8]](s32), [[UMULH2]]
293 ; MIPS32: [[AND5:%[0-9]+]]:_(s32) = G_AND [[ICMP5]], [[C]]
294 ; MIPS32: [[ADD9:%[0-9]+]]:_(s32) = G_ADD [[ADD7]], [[AND5]]
295 ; MIPS32: [[ADD10:%[0-9]+]]:_(s32) = G_ADD [[ADD8]], [[ADD2]]
296 ; MIPS32: [[ICMP6:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[ADD10]](s32), [[ADD2]]
297 ; MIPS32: [[AND6:%[0-9]+]]:_(s32) = G_AND [[ICMP6]], [[C]]
298 ; MIPS32: [[ADD11:%[0-9]+]]:_(s32) = G_ADD [[ADD9]], [[AND6]]
299 ; MIPS32: [[MUL6:%[0-9]+]]:_(s32) = G_MUL [[LOAD3]], [[COPY]]
300 ; MIPS32: [[MUL7:%[0-9]+]]:_(s32) = G_MUL [[LOAD2]], [[COPY1]]
301 ; MIPS32: [[MUL8:%[0-9]+]]:_(s32) = G_MUL [[LOAD1]], [[COPY2]]
302 ; MIPS32: [[MUL9:%[0-9]+]]:_(s32) = G_MUL [[LOAD]], [[COPY3]]
303 ; MIPS32: [[UMULH3:%[0-9]+]]:_(s32) = G_UMULH [[LOAD2]], [[COPY]]
304 ; MIPS32: [[UMULH4:%[0-9]+]]:_(s32) = G_UMULH [[LOAD1]], [[COPY1]]
305 ; MIPS32: [[UMULH5:%[0-9]+]]:_(s32) = G_UMULH [[LOAD]], [[COPY2]]
306 ; MIPS32: [[ADD12:%[0-9]+]]:_(s32) = G_ADD [[MUL6]], [[MUL7]]
307 ; MIPS32: [[ADD13:%[0-9]+]]:_(s32) = G_ADD [[ADD12]], [[MUL8]]
308 ; MIPS32: [[ADD14:%[0-9]+]]:_(s32) = G_ADD [[ADD13]], [[MUL9]]
309 ; MIPS32: [[ADD15:%[0-9]+]]:_(s32) = G_ADD [[ADD14]], [[UMULH3]]
310 ; MIPS32: [[ADD16:%[0-9]+]]:_(s32) = G_ADD [[ADD15]], [[UMULH4]]
311 ; MIPS32: [[ADD17:%[0-9]+]]:_(s32) = G_ADD [[ADD16]], [[UMULH5]]
312 ; MIPS32: [[ADD18:%[0-9]+]]:_(s32) = G_ADD [[ADD17]], [[ADD11]]
313 ; MIPS32: $v0 = COPY [[MUL]](s32)
314 ; MIPS32: $v1 = COPY [[ADD1]](s32)
315 ; MIPS32: $a0 = COPY [[ADD10]](s32)
316 ; MIPS32: $a1 = COPY [[ADD18]](s32)
317 ; MIPS32: RetRA implicit $v0, implicit $v1, implicit $a0, implicit $a1
322 %0:_(s128) = G_MERGE_VALUES %2(s32), %3(s32), %4(s32), %5(s32)
323 %10:_(p0) = G_FRAME_INDEX %fixed-stack.3
324 %6:_(s32) = G_LOAD %10(p0) :: (load (s32) from %fixed-stack.3, align 8)
325 %11:_(p0) = G_FRAME_INDEX %fixed-stack.2
326 %7:_(s32) = G_LOAD %11(p0) :: (load (s32) from %fixed-stack.2)
327 %12:_(p0) = G_FRAME_INDEX %fixed-stack.1
328 %8:_(s32) = G_LOAD %12(p0) :: (load (s32) from %fixed-stack.1, align 8)
329 %13:_(p0) = G_FRAME_INDEX %fixed-stack.0
330 %9:_(s32) = G_LOAD %13(p0) :: (load (s32) from %fixed-stack.0)
331 %1:_(s128) = G_MERGE_VALUES %6(s32), %7(s32), %8(s32), %9(s32)
332 %14:_(s128) = G_MUL %1, %0
333 %15:_(s32), %16:_(s32), %17:_(s32), %18:_(s32) = G_UNMERGE_VALUES %14(s128)
338 RetRA implicit $v0, implicit $v1, implicit $a0, implicit $a1
344 tracksRegLiveness: true
347 liveins: $a0, $a1, $a2, $a3
349 ; MIPS32-LABEL: name: umulh_i64
350 ; MIPS32: liveins: $a0, $a1, $a2, $a3
351 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
352 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
353 ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY $a2
354 ; MIPS32: [[COPY3:%[0-9]+]]:_(s32) = COPY $a3
355 ; MIPS32: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[COPY3]], [[COPY]]
356 ; MIPS32: [[MUL1:%[0-9]+]]:_(s32) = G_MUL [[COPY2]], [[COPY1]]
357 ; MIPS32: [[UMULH:%[0-9]+]]:_(s32) = G_UMULH [[COPY2]], [[COPY]]
358 ; MIPS32: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[MUL]], [[MUL1]]
359 ; MIPS32: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[ADD]](s32), [[MUL1]]
360 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
361 ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C]]
362 ; MIPS32: [[ADD1:%[0-9]+]]:_(s32) = G_ADD [[ADD]], [[UMULH]]
363 ; MIPS32: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[ADD1]](s32), [[UMULH]]
364 ; MIPS32: [[AND1:%[0-9]+]]:_(s32) = G_AND [[ICMP1]], [[C]]
365 ; MIPS32: [[ADD2:%[0-9]+]]:_(s32) = G_ADD [[AND]], [[AND1]]
366 ; MIPS32: [[MUL2:%[0-9]+]]:_(s32) = G_MUL [[COPY3]], [[COPY1]]
367 ; MIPS32: [[UMULH1:%[0-9]+]]:_(s32) = G_UMULH [[COPY3]], [[COPY]]
368 ; MIPS32: [[UMULH2:%[0-9]+]]:_(s32) = G_UMULH [[COPY2]], [[COPY1]]
369 ; MIPS32: [[ADD3:%[0-9]+]]:_(s32) = G_ADD [[MUL2]], [[UMULH1]]
370 ; MIPS32: [[ICMP2:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[ADD3]](s32), [[UMULH1]]
371 ; MIPS32: [[AND2:%[0-9]+]]:_(s32) = G_AND [[ICMP2]], [[C]]
372 ; MIPS32: [[ADD4:%[0-9]+]]:_(s32) = G_ADD [[ADD3]], [[UMULH2]]
373 ; MIPS32: [[ICMP3:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[ADD4]](s32), [[UMULH2]]
374 ; MIPS32: [[AND3:%[0-9]+]]:_(s32) = G_AND [[ICMP3]], [[C]]
375 ; MIPS32: [[ADD5:%[0-9]+]]:_(s32) = G_ADD [[AND2]], [[AND3]]
376 ; MIPS32: [[ADD6:%[0-9]+]]:_(s32) = G_ADD [[ADD4]], [[ADD2]]
377 ; MIPS32: [[ICMP4:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[ADD6]](s32), [[ADD2]]
378 ; MIPS32: [[AND4:%[0-9]+]]:_(s32) = G_AND [[ICMP4]], [[C]]
379 ; MIPS32: [[ADD7:%[0-9]+]]:_(s32) = G_ADD [[ADD5]], [[AND4]]
380 ; MIPS32: [[UMULH3:%[0-9]+]]:_(s32) = G_UMULH [[COPY3]], [[COPY1]]
381 ; MIPS32: [[ADD8:%[0-9]+]]:_(s32) = G_ADD [[UMULH3]], [[ADD7]]
382 ; MIPS32: $v0 = COPY [[ADD6]](s32)
383 ; MIPS32: $v1 = COPY [[ADD8]](s32)
384 ; MIPS32: RetRA implicit $v0, implicit $v1
387 %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32)
390 %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32)
391 %6:_(s64) = G_UMULH %1, %0
392 %7:_(s32), %8:_(s32) = G_UNMERGE_VALUES %6(s64)
395 RetRA implicit $v0, implicit $v1
399 name: umul_with_overflow
401 tracksRegLiveness: true
404 liveins: $a0, $a1, $a2, $a3
406 ; MIPS32-LABEL: name: umul_with_overflow
407 ; MIPS32: liveins: $a0, $a1, $a2, $a3
408 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
409 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
410 ; MIPS32: [[COPY2:%[0-9]+]]:_(p0) = COPY $a2
411 ; MIPS32: [[COPY3:%[0-9]+]]:_(p0) = COPY $a3
412 ; MIPS32: [[UMULH:%[0-9]+]]:_(s32) = G_UMULH [[COPY]], [[COPY1]]
413 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
414 ; MIPS32: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[COPY]], [[COPY1]]
415 ; MIPS32: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[UMULH]](s32), [[C]]
416 ; MIPS32: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
417 ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C1]]
418 ; MIPS32: [[AND1:%[0-9]+]]:_(s32) = G_AND [[AND]], [[C1]]
419 ; MIPS32: G_STORE [[AND1]](s32), [[COPY3]](p0) :: (store (s8) into %ir.pcarry_flag)
420 ; MIPS32: G_STORE [[MUL]](s32), [[COPY2]](p0) :: (store (s32) into %ir.pmul)
426 %4:_(s32), %5:_(s1) = G_UMULO %0, %1
427 G_STORE %5(s1), %3(p0) :: (store (s1) into %ir.pcarry_flag)
428 G_STORE %4(s32), %2(p0) :: (store (s32) into %ir.pmul)