[MIPS GlobalISel] NarrowScalar G_MUL
[llvm-complete.git] / test / CodeGen / Mips / GlobalISel / legalizer / mul.mir
blob6d2d2fedc0db2a4b1382452877c53889f130c0b0
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
3 --- |
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 @umul_with_overflow(i32 %lhs, i32 %rhs, i32* %pmul, i1* %pcarry_flag) { ret void }
16 ...
17 ---
18 name:            mul_i32
19 alignment:       2
20 tracksRegLiveness: true
21 body:             |
22   bb.0.entry:
23     liveins: $a0, $a1
25     ; MIPS32-LABEL: name: mul_i32
26     ; MIPS32: liveins: $a0, $a1
27     ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
28     ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
29     ; MIPS32: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[COPY]], [[COPY1]]
30     ; MIPS32: $v0 = COPY [[MUL]](s32)
31     ; MIPS32: RetRA implicit $v0
32     %0:_(s32) = COPY $a0
33     %1:_(s32) = COPY $a1
34     %2:_(s32) = G_MUL %0, %1
35     $v0 = COPY %2(s32)
36     RetRA implicit $v0
38 ...
39 ---
40 name:            mul_i8_sext
41 alignment:       2
42 tracksRegLiveness: true
43 body:             |
44   bb.1.entry:
45     liveins: $a0, $a1
47     ; MIPS32-LABEL: name: mul_i8_sext
48     ; MIPS32: liveins: $a0, $a1
49     ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
50     ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
51     ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
52     ; MIPS32: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
53     ; MIPS32: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[COPY2]], [[COPY3]]
54     ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
55     ; MIPS32: [[COPY4:%[0-9]+]]:_(s32) = COPY [[MUL]](s32)
56     ; MIPS32: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY4]], [[C]](s32)
57     ; MIPS32: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
58     ; MIPS32: $v0 = COPY [[ASHR]](s32)
59     ; MIPS32: RetRA implicit $v0
60     %2:_(s32) = COPY $a0
61     %0:_(s8) = G_TRUNC %2(s32)
62     %3:_(s32) = COPY $a1
63     %1:_(s8) = G_TRUNC %3(s32)
64     %4:_(s8) = G_MUL %1, %0
65     %5:_(s32) = G_SEXT %4(s8)
66     $v0 = COPY %5(s32)
67     RetRA implicit $v0
69 ...
70 ---
71 name:            mul_i8_zext
72 alignment:       2
73 tracksRegLiveness: true
74 body:             |
75   bb.1.entry:
76     liveins: $a0, $a1
78     ; MIPS32-LABEL: name: mul_i8_zext
79     ; MIPS32: liveins: $a0, $a1
80     ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
81     ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
82     ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
83     ; MIPS32: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
84     ; MIPS32: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[COPY2]], [[COPY3]]
85     ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
86     ; MIPS32: [[COPY4:%[0-9]+]]:_(s32) = COPY [[MUL]](s32)
87     ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[C]]
88     ; MIPS32: $v0 = COPY [[AND]](s32)
89     ; MIPS32: RetRA implicit $v0
90     %2:_(s32) = COPY $a0
91     %0:_(s8) = G_TRUNC %2(s32)
92     %3:_(s32) = COPY $a1
93     %1:_(s8) = G_TRUNC %3(s32)
94     %4:_(s8) = G_MUL %1, %0
95     %5:_(s32) = G_ZEXT %4(s8)
96     $v0 = COPY %5(s32)
97     RetRA implicit $v0
99 ...
101 name:            mul_i8_aext
102 alignment:       2
103 tracksRegLiveness: true
104 body:             |
105   bb.1.entry:
106     liveins: $a0, $a1
108     ; MIPS32-LABEL: name: mul_i8_aext
109     ; MIPS32: liveins: $a0, $a1
110     ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
111     ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
112     ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
113     ; MIPS32: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
114     ; MIPS32: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[COPY2]], [[COPY3]]
115     ; MIPS32: [[COPY4:%[0-9]+]]:_(s32) = COPY [[MUL]](s32)
116     ; MIPS32: $v0 = COPY [[COPY4]](s32)
117     ; MIPS32: RetRA implicit $v0
118     %2:_(s32) = COPY $a0
119     %0:_(s8) = G_TRUNC %2(s32)
120     %3:_(s32) = COPY $a1
121     %1:_(s8) = G_TRUNC %3(s32)
122     %4:_(s8) = G_MUL %1, %0
123     %5:_(s32) = G_ANYEXT %4(s8)
124     $v0 = COPY %5(s32)
125     RetRA implicit $v0
129 name:            mul_i16_sext
130 alignment:       2
131 tracksRegLiveness: true
132 body:             |
133   bb.1.entry:
134     liveins: $a0, $a1
136     ; MIPS32-LABEL: name: mul_i16_sext
137     ; MIPS32: liveins: $a0, $a1
138     ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
139     ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
140     ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
141     ; MIPS32: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
142     ; MIPS32: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[COPY2]], [[COPY3]]
143     ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
144     ; MIPS32: [[COPY4:%[0-9]+]]:_(s32) = COPY [[MUL]](s32)
145     ; MIPS32: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY4]], [[C]](s32)
146     ; MIPS32: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
147     ; MIPS32: $v0 = COPY [[ASHR]](s32)
148     ; MIPS32: RetRA implicit $v0
149     %2:_(s32) = COPY $a0
150     %0:_(s16) = G_TRUNC %2(s32)
151     %3:_(s32) = COPY $a1
152     %1:_(s16) = G_TRUNC %3(s32)
153     %4:_(s16) = G_MUL %1, %0
154     %5:_(s32) = G_SEXT %4(s16)
155     $v0 = COPY %5(s32)
156     RetRA implicit $v0
160 name:            mul_i16_zext
161 alignment:       2
162 tracksRegLiveness: true
163 body:             |
164   bb.1.entry:
165     liveins: $a0, $a1
167     ; MIPS32-LABEL: name: mul_i16_zext
168     ; MIPS32: liveins: $a0, $a1
169     ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
170     ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
171     ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
172     ; MIPS32: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
173     ; MIPS32: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[COPY2]], [[COPY3]]
174     ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
175     ; MIPS32: [[COPY4:%[0-9]+]]:_(s32) = COPY [[MUL]](s32)
176     ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[C]]
177     ; MIPS32: $v0 = COPY [[AND]](s32)
178     ; MIPS32: RetRA implicit $v0
179     %2:_(s32) = COPY $a0
180     %0:_(s16) = G_TRUNC %2(s32)
181     %3:_(s32) = COPY $a1
182     %1:_(s16) = G_TRUNC %3(s32)
183     %4:_(s16) = G_MUL %1, %0
184     %5:_(s32) = G_ZEXT %4(s16)
185     $v0 = COPY %5(s32)
186     RetRA implicit $v0
190 name:            mul_i16_aext
191 alignment:       2
192 tracksRegLiveness: true
193 body:             |
194   bb.1.entry:
195     liveins: $a0, $a1
197     ; MIPS32-LABEL: name: mul_i16_aext
198     ; MIPS32: liveins: $a0, $a1
199     ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
200     ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
201     ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
202     ; MIPS32: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
203     ; MIPS32: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[COPY2]], [[COPY3]]
204     ; MIPS32: [[COPY4:%[0-9]+]]:_(s32) = COPY [[MUL]](s32)
205     ; MIPS32: $v0 = COPY [[COPY4]](s32)
206     ; MIPS32: RetRA implicit $v0
207     %2:_(s32) = COPY $a0
208     %0:_(s16) = G_TRUNC %2(s32)
209     %3:_(s32) = COPY $a1
210     %1:_(s16) = G_TRUNC %3(s32)
211     %4:_(s16) = G_MUL %1, %0
212     %5:_(s32) = G_ANYEXT %4(s16)
213     $v0 = COPY %5(s32)
214     RetRA implicit $v0
218 name:            mul_i64
219 alignment:       2
220 tracksRegLiveness: true
221 body:             |
222   bb.1.entry:
223     liveins: $a0, $a1, $a2, $a3
225     ; MIPS32-LABEL: name: mul_i64
226     ; MIPS32: liveins: $a0, $a1, $a2, $a3
227     ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
228     ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
229     ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY $a2
230     ; MIPS32: [[COPY3:%[0-9]+]]:_(s32) = COPY $a3
231     ; MIPS32: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[COPY2]], [[COPY]]
232     ; MIPS32: [[MUL1:%[0-9]+]]:_(s32) = G_MUL [[COPY3]], [[COPY]]
233     ; MIPS32: [[MUL2:%[0-9]+]]:_(s32) = G_MUL [[COPY2]], [[COPY1]]
234     ; MIPS32: [[UMULH:%[0-9]+]]:_(s32) = G_UMULH [[COPY2]], [[COPY]]
235     ; MIPS32: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[MUL1]], [[MUL2]]
236     ; MIPS32: [[ADD1:%[0-9]+]]:_(s32) = G_ADD [[ADD]], [[UMULH]]
237     ; MIPS32: $v0 = COPY [[MUL]](s32)
238     ; MIPS32: $v1 = COPY [[ADD1]](s32)
239     ; MIPS32: RetRA implicit $v0, implicit $v1
240     %2:_(s32) = COPY $a0
241     %3:_(s32) = COPY $a1
242     %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32)
243     %4:_(s32) = COPY $a2
244     %5:_(s32) = COPY $a3
245     %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32)
246     %6:_(s64) = G_MUL %1, %0
247     %7:_(s32), %8:_(s32) = G_UNMERGE_VALUES %6(s64)
248     $v0 = COPY %7(s32)
249     $v1 = COPY %8(s32)
250     RetRA implicit $v0, implicit $v1
254 name:            mul_i128
255 alignment:       2
256 tracksRegLiveness: true
257 fixedStack:
258   - { id: 0, offset: 28, size: 4, alignment: 4, stack-id: 0, isImmutable: true }
259   - { id: 1, offset: 24, size: 4, alignment: 8, stack-id: 0, isImmutable: true }
260   - { id: 2, offset: 20, size: 4, alignment: 4, stack-id: 0, isImmutable: true }
261   - { id: 3, offset: 16, size: 4, alignment: 8, stack-id: 0, isImmutable: true }
262 body:             |
263   bb.1.entry:
264     liveins: $a0, $a1, $a2, $a3
266     ; MIPS32-LABEL: name: mul_i128
267     ; MIPS32: liveins: $a0, $a1, $a2, $a3
268     ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
269     ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
270     ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY $a2
271     ; MIPS32: [[COPY3:%[0-9]+]]:_(s32) = COPY $a3
272     ; MIPS32: [[FRAME_INDEX:%[0-9]+]]:_(p0) = G_FRAME_INDEX %fixed-stack.0
273     ; MIPS32: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[FRAME_INDEX]](p0) :: (load 4 from %fixed-stack.0, align 8)
274     ; MIPS32: [[FRAME_INDEX1:%[0-9]+]]:_(p0) = G_FRAME_INDEX %fixed-stack.1
275     ; MIPS32: [[LOAD1:%[0-9]+]]:_(s32) = G_LOAD [[FRAME_INDEX1]](p0) :: (load 4 from %fixed-stack.1)
276     ; MIPS32: [[FRAME_INDEX2:%[0-9]+]]:_(p0) = G_FRAME_INDEX %fixed-stack.2
277     ; MIPS32: [[LOAD2:%[0-9]+]]:_(s32) = G_LOAD [[FRAME_INDEX2]](p0) :: (load 4 from %fixed-stack.2, align 8)
278     ; MIPS32: [[FRAME_INDEX3:%[0-9]+]]:_(p0) = G_FRAME_INDEX %fixed-stack.3
279     ; MIPS32: [[LOAD3:%[0-9]+]]:_(s32) = G_LOAD [[FRAME_INDEX3]](p0) :: (load 4 from %fixed-stack.3)
280     ; MIPS32: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[LOAD]], [[COPY]]
281     ; MIPS32: [[MUL1:%[0-9]+]]:_(s32) = G_MUL [[LOAD1]], [[COPY]]
282     ; MIPS32: [[MUL2:%[0-9]+]]:_(s32) = G_MUL [[LOAD]], [[COPY1]]
283     ; MIPS32: [[UMULH:%[0-9]+]]:_(s32) = G_UMULH [[LOAD]], [[COPY]]
284     ; MIPS32: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[MUL1]], [[MUL2]]
285     ; MIPS32: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[ADD]](s32), [[MUL2]]
286     ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
287     ; MIPS32: [[COPY4:%[0-9]+]]:_(s32) = COPY [[ICMP]](s32)
288     ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[C]]
289     ; MIPS32: [[ADD1:%[0-9]+]]:_(s32) = G_ADD [[ADD]], [[UMULH]]
290     ; MIPS32: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[ADD1]](s32), [[UMULH]]
291     ; MIPS32: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
292     ; MIPS32: [[COPY5:%[0-9]+]]:_(s32) = COPY [[ICMP1]](s32)
293     ; MIPS32: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY5]], [[C1]]
294     ; MIPS32: [[ADD2:%[0-9]+]]:_(s32) = G_ADD [[AND]], [[AND1]]
295     ; MIPS32: [[MUL3:%[0-9]+]]:_(s32) = G_MUL [[LOAD2]], [[COPY]]
296     ; MIPS32: [[MUL4:%[0-9]+]]:_(s32) = G_MUL [[LOAD1]], [[COPY1]]
297     ; MIPS32: [[MUL5:%[0-9]+]]:_(s32) = G_MUL [[LOAD]], [[COPY2]]
298     ; MIPS32: [[UMULH1:%[0-9]+]]:_(s32) = G_UMULH [[LOAD1]], [[COPY]]
299     ; MIPS32: [[UMULH2:%[0-9]+]]:_(s32) = G_UMULH [[LOAD]], [[COPY1]]
300     ; MIPS32: [[ADD3:%[0-9]+]]:_(s32) = G_ADD [[MUL3]], [[MUL4]]
301     ; MIPS32: [[ICMP2:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[ADD3]](s32), [[MUL4]]
302     ; MIPS32: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
303     ; MIPS32: [[COPY6:%[0-9]+]]:_(s32) = COPY [[ICMP2]](s32)
304     ; MIPS32: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY6]], [[C2]]
305     ; MIPS32: [[ADD4:%[0-9]+]]:_(s32) = G_ADD [[ADD3]], [[MUL5]]
306     ; MIPS32: [[ICMP3:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[ADD4]](s32), [[MUL5]]
307     ; MIPS32: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
308     ; MIPS32: [[COPY7:%[0-9]+]]:_(s32) = COPY [[ICMP3]](s32)
309     ; MIPS32: [[AND3:%[0-9]+]]:_(s32) = G_AND [[COPY7]], [[C3]]
310     ; MIPS32: [[ADD5:%[0-9]+]]:_(s32) = G_ADD [[AND2]], [[AND3]]
311     ; MIPS32: [[ADD6:%[0-9]+]]:_(s32) = G_ADD [[ADD4]], [[UMULH1]]
312     ; MIPS32: [[ICMP4:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[ADD6]](s32), [[UMULH1]]
313     ; MIPS32: [[C4:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
314     ; MIPS32: [[COPY8:%[0-9]+]]:_(s32) = COPY [[ICMP4]](s32)
315     ; MIPS32: [[AND4:%[0-9]+]]:_(s32) = G_AND [[COPY8]], [[C4]]
316     ; MIPS32: [[ADD7:%[0-9]+]]:_(s32) = G_ADD [[ADD5]], [[AND4]]
317     ; MIPS32: [[ADD8:%[0-9]+]]:_(s32) = G_ADD [[ADD6]], [[UMULH2]]
318     ; MIPS32: [[ICMP5:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[ADD8]](s32), [[UMULH2]]
319     ; MIPS32: [[C5:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
320     ; MIPS32: [[COPY9:%[0-9]+]]:_(s32) = COPY [[ICMP5]](s32)
321     ; MIPS32: [[AND5:%[0-9]+]]:_(s32) = G_AND [[COPY9]], [[C5]]
322     ; MIPS32: [[ADD9:%[0-9]+]]:_(s32) = G_ADD [[ADD7]], [[AND5]]
323     ; MIPS32: [[ADD10:%[0-9]+]]:_(s32) = G_ADD [[ADD8]], [[ADD2]]
324     ; MIPS32: [[ICMP6:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[ADD10]](s32), [[ADD2]]
325     ; MIPS32: [[C6:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
326     ; MIPS32: [[COPY10:%[0-9]+]]:_(s32) = COPY [[ICMP6]](s32)
327     ; MIPS32: [[AND6:%[0-9]+]]:_(s32) = G_AND [[COPY10]], [[C6]]
328     ; MIPS32: [[ADD11:%[0-9]+]]:_(s32) = G_ADD [[ADD9]], [[AND6]]
329     ; MIPS32: [[MUL6:%[0-9]+]]:_(s32) = G_MUL [[LOAD3]], [[COPY]]
330     ; MIPS32: [[MUL7:%[0-9]+]]:_(s32) = G_MUL [[LOAD2]], [[COPY1]]
331     ; MIPS32: [[MUL8:%[0-9]+]]:_(s32) = G_MUL [[LOAD1]], [[COPY2]]
332     ; MIPS32: [[MUL9:%[0-9]+]]:_(s32) = G_MUL [[LOAD]], [[COPY3]]
333     ; MIPS32: [[UMULH3:%[0-9]+]]:_(s32) = G_UMULH [[LOAD2]], [[COPY]]
334     ; MIPS32: [[UMULH4:%[0-9]+]]:_(s32) = G_UMULH [[LOAD1]], [[COPY1]]
335     ; MIPS32: [[UMULH5:%[0-9]+]]:_(s32) = G_UMULH [[LOAD]], [[COPY2]]
336     ; MIPS32: [[ADD12:%[0-9]+]]:_(s32) = G_ADD [[MUL6]], [[MUL7]]
337     ; MIPS32: [[ADD13:%[0-9]+]]:_(s32) = G_ADD [[ADD12]], [[MUL8]]
338     ; MIPS32: [[ADD14:%[0-9]+]]:_(s32) = G_ADD [[ADD13]], [[MUL9]]
339     ; MIPS32: [[ADD15:%[0-9]+]]:_(s32) = G_ADD [[ADD14]], [[UMULH3]]
340     ; MIPS32: [[ADD16:%[0-9]+]]:_(s32) = G_ADD [[ADD15]], [[UMULH4]]
341     ; MIPS32: [[ADD17:%[0-9]+]]:_(s32) = G_ADD [[ADD16]], [[UMULH5]]
342     ; MIPS32: [[ADD18:%[0-9]+]]:_(s32) = G_ADD [[ADD17]], [[ADD11]]
343     ; MIPS32: $v0 = COPY [[MUL]](s32)
344     ; MIPS32: $v1 = COPY [[ADD1]](s32)
345     ; MIPS32: $a0 = COPY [[ADD10]](s32)
346     ; MIPS32: $a1 = COPY [[ADD18]](s32)
347     ; MIPS32: RetRA implicit $v0, implicit $v1, implicit $a0, implicit $a1
348     %2:_(s32) = COPY $a0
349     %3:_(s32) = COPY $a1
350     %4:_(s32) = COPY $a2
351     %5:_(s32) = COPY $a3
352     %0:_(s128) = G_MERGE_VALUES %2(s32), %3(s32), %4(s32), %5(s32)
353     %10:_(p0) = G_FRAME_INDEX %fixed-stack.3
354     %6:_(s32) = G_LOAD %10(p0) :: (load 4 from %fixed-stack.3, align 8)
355     %11:_(p0) = G_FRAME_INDEX %fixed-stack.2
356     %7:_(s32) = G_LOAD %11(p0) :: (load 4 from %fixed-stack.2)
357     %12:_(p0) = G_FRAME_INDEX %fixed-stack.1
358     %8:_(s32) = G_LOAD %12(p0) :: (load 4 from %fixed-stack.1, align 8)
359     %13:_(p0) = G_FRAME_INDEX %fixed-stack.0
360     %9:_(s32) = G_LOAD %13(p0) :: (load 4 from %fixed-stack.0)
361     %1:_(s128) = G_MERGE_VALUES %6(s32), %7(s32), %8(s32), %9(s32)
362     %14:_(s128) = G_MUL %1, %0
363     %15:_(s32), %16:_(s32), %17:_(s32), %18:_(s32) = G_UNMERGE_VALUES %14(s128)
364     $v0 = COPY %15(s32)
365     $v1 = COPY %16(s32)
366     $a0 = COPY %17(s32)
367     $a1 = COPY %18(s32)
368     RetRA implicit $v0, implicit $v1, implicit $a0, implicit $a1
372 name:            umul_with_overflow
373 alignment:       2
374 tracksRegLiveness: true
375 body:             |
376   bb.1 (%ir-block.0):
377     liveins: $a0, $a1, $a2, $a3
379     ; MIPS32-LABEL: name: umul_with_overflow
380     ; MIPS32: liveins: $a0, $a1, $a2, $a3
381     ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
382     ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
383     ; MIPS32: [[COPY2:%[0-9]+]]:_(p0) = COPY $a2
384     ; MIPS32: [[COPY3:%[0-9]+]]:_(p0) = COPY $a3
385     ; MIPS32: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[COPY]], [[COPY1]]
386     ; MIPS32: [[UMULH:%[0-9]+]]:_(s32) = G_UMULH [[COPY]], [[COPY1]]
387     ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
388     ; MIPS32: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[UMULH]](s32), [[C]]
389     ; MIPS32: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
390     ; MIPS32: [[COPY4:%[0-9]+]]:_(s32) = COPY [[ICMP]](s32)
391     ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[C1]]
392     ; MIPS32: G_STORE [[AND]](s32), [[COPY3]](p0) :: (store 1 into %ir.pcarry_flag)
393     ; MIPS32: G_STORE [[MUL]](s32), [[COPY2]](p0) :: (store 4 into %ir.pmul)
394     ; MIPS32: RetRA
395     %0:_(s32) = COPY $a0
396     %1:_(s32) = COPY $a1
397     %2:_(p0) = COPY $a2
398     %3:_(p0) = COPY $a3
399     %4:_(s32), %5:_(s1) = G_UMULO %0, %1
400     G_STORE %5(s1), %3(p0) :: (store 1 into %ir.pcarry_flag)
401     G_STORE %4(s32), %2(p0) :: (store 4 into %ir.pmul)
402     RetRA