Debian Codegraph @

llvm/test/CodeGen/RISCV/GlobalISel/legalizer/legalize-addo-subo-rv32.mir

raw
1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=riscv32 -run-pass=legalizer %s -o - \
3 # RUN: | FileCheck %s
4
5 ---
6 name: saddo_i8
7 body: |
8 bb.1:
9 liveins: $x10, $x11
10
11 ; CHECK-LABEL: name: saddo_i8
12 ; CHECK: liveins: $x10, $x11
13 ; CHECK-NEXT: {{ $}}
14 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
15 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
16 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
17 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[C]](s32)
18 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
19 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
20 ; CHECK-NEXT: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C1]](s32)
21 ; CHECK-NEXT: [[ASHR1:%[0-9]+]]:_(s32) = G_ASHR [[SHL1]], [[C1]](s32)
22 ; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[ASHR]], [[ASHR1]]
23 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
24 ; CHECK-NEXT: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[ADD]], [[C2]](s32)
25 ; CHECK-NEXT: [[ASHR2:%[0-9]+]]:_(s32) = G_ASHR [[SHL2]], [[C2]](s32)
26 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[ADD]](s32), [[ASHR2]]
27 ; CHECK-NEXT: $x10 = COPY [[ADD]](s32)
28 ; CHECK-NEXT: $x11 = COPY [[ICMP]](s32)
29 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
30 %2:_(s32) = COPY $x10
31 %0:_(s8) = G_TRUNC %2(s32)
32 %3:_(s32) = COPY $x11
33 %1:_(s8) = G_TRUNC %3(s32)
34 %4:_(s8), %5:_(s1) = G_SADDO %0, %1
35 %6:_(s32) = G_ANYEXT %4(s8)
36 %7:_(s32) = G_ANYEXT %5(s1)
37 $x10 = COPY %6(s32)
38 $x11 = COPY %7(s32)
39 PseudoRET implicit $x10, implicit $x11
40
41 ...
42 ---
43 name: saddo_i16
44 body: |
45 bb.1:
46 liveins: $x10, $x11
47
48 ; CHECK-LABEL: name: saddo_i16
49 ; CHECK: liveins: $x10, $x11
50 ; CHECK-NEXT: {{ $}}
51 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
52 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
53 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
54 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[C]](s32)
55 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
56 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
57 ; CHECK-NEXT: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C1]](s32)
58 ; CHECK-NEXT: [[ASHR1:%[0-9]+]]:_(s32) = G_ASHR [[SHL1]], [[C1]](s32)
59 ; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[ASHR]], [[ASHR1]]
60 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
61 ; CHECK-NEXT: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[ADD]], [[C2]](s32)
62 ; CHECK-NEXT: [[ASHR2:%[0-9]+]]:_(s32) = G_ASHR [[SHL2]], [[C2]](s32)
63 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[ADD]](s32), [[ASHR2]]
64 ; CHECK-NEXT: $x10 = COPY [[ADD]](s32)
65 ; CHECK-NEXT: $x11 = COPY [[ICMP]](s32)
66 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
67 %2:_(s32) = COPY $x10
68 %0:_(s16) = G_TRUNC %2(s32)
69 %3:_(s32) = COPY $x11
70 %1:_(s16) = G_TRUNC %3(s32)
71 %4:_(s16), %5:_(s1) = G_SADDO %0, %1
72 %6:_(s32) = G_ANYEXT %4(s16)
73 %7:_(s32) = G_ANYEXT %5(s1)
74 $x10 = COPY %6(s32)
75 $x11 = COPY %7(s32)
76 PseudoRET implicit $x10, implicit $x11
77
78 ...
79 ---
80 name: saddo_i32
81 body: |
82 bb.1:
83 liveins: $x10, $x11
84
85 ; CHECK-LABEL: name: saddo_i32
86 ; CHECK: liveins: $x10, $x11
87 ; CHECK-NEXT: {{ $}}
88 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
89 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
90 ; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[COPY1]]
91 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
92 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(slt), [[ADD]](s32), [[COPY]]
93 ; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(slt), [[COPY1]](s32), [[C]]
94 ; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[ICMP1]], [[ICMP]]
95 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY [[ADD]](s32)
96 ; CHECK-NEXT: $x10 = COPY [[COPY2]](s32)
97 ; CHECK-NEXT: $x11 = COPY [[XOR]](s32)
98 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
99 %0:_(s32) = COPY $x10
100 %1:_(s32) = COPY $x11
101 %2:_(s32), %3:_(s1) = G_SADDO %0, %1
102 %4:_(s32) = G_ANYEXT %3(s1)
103 $x10 = COPY %2(s32)
104 $x11 = COPY %4(s32)
105 PseudoRET implicit $x10, implicit $x11
106
107 ...
108 ---
109 name: saddo_i64
110 body: |
111 bb.1:
112 liveins: $x10, $x11, $x12, $x13
113
114 ; CHECK-LABEL: name: saddo_i64
115 ; CHECK: liveins: $x10, $x11, $x12, $x13
116 ; CHECK-NEXT: {{ $}}
117 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
118 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
119 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $x12
120 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY $x13
121 ; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[COPY2]]
122 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[ADD]](s32), [[COPY2]]
123 ; CHECK-NEXT: [[COPY4:%[0-9]+]]:_(s32) = COPY [[ADD]](s32)
124 ; CHECK-NEXT: [[ADD1:%[0-9]+]]:_(s32) = G_ADD [[COPY1]], [[COPY3]]
125 ; CHECK-NEXT: [[ADD2:%[0-9]+]]:_(s32) = G_ADD [[ADD1]], [[ICMP]]
126 ; CHECK-NEXT: [[COPY5:%[0-9]+]]:_(s32) = COPY [[ADD2]](s32)
127 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
128 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
129 ; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(slt), [[COPY5]](s32), [[COPY1]]
130 ; CHECK-NEXT: [[ICMP2:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[COPY5]](s32), [[COPY1]]
131 ; CHECK-NEXT: [[ICMP3:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[COPY4]](s32), [[COPY]]
132 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP2]](s32), [[ICMP3]], [[ICMP1]]
133 ; CHECK-NEXT: [[ICMP4:%[0-9]+]]:_(s32) = G_ICMP intpred(slt), [[COPY3]](s32), [[C1]]
134 ; CHECK-NEXT: [[ICMP5:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[COPY3]](s32), [[C1]]
135 ; CHECK-NEXT: [[ICMP6:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[COPY2]](s32), [[C]]
136 ; CHECK-NEXT: [[SELECT1:%[0-9]+]]:_(s32) = G_SELECT [[ICMP5]](s32), [[ICMP6]], [[ICMP4]]
137 ; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[SELECT1]], [[SELECT]]
138 ; CHECK-NEXT: $x10 = COPY [[COPY4]](s32)
139 ; CHECK-NEXT: $x11 = COPY [[COPY5]](s32)
140 ; CHECK-NEXT: $x12 = COPY [[XOR]](s32)
141 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11, implicit $x12
142 %2:_(s32) = COPY $x10
143 %3:_(s32) = COPY $x11
144 %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32)
145 %4:_(s32) = COPY $x12
146 %5:_(s32) = COPY $x13
147 %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32)
148 %6:_(s64), %7:_(s1) = G_SADDO %0, %1
149 %8:_(s32), %9:_(s32) = G_UNMERGE_VALUES %6(s64)
150 %10:_(s32) = G_ANYEXT %7(s1)
151 $x10 = COPY %8(s32)
152 $x11 = COPY %9(s32)
153 $x12 = COPY %10(s32)
154 PseudoRET implicit $x10, implicit $x11, implicit $x12
155
156 ...
157 ---
158 name: ssubo_i8
159 body: |
160 bb.1:
161 liveins: $x10, $x11
162
163 ; CHECK-LABEL: name: ssubo_i8
164 ; CHECK: liveins: $x10, $x11
165 ; CHECK-NEXT: {{ $}}
166 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
167 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
168 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
169 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[C]](s32)
170 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
171 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
172 ; CHECK-NEXT: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C1]](s32)
173 ; CHECK-NEXT: [[ASHR1:%[0-9]+]]:_(s32) = G_ASHR [[SHL1]], [[C1]](s32)
174 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[ASHR]], [[ASHR1]]
175 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
176 ; CHECK-NEXT: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[SUB]], [[C2]](s32)
177 ; CHECK-NEXT: [[ASHR2:%[0-9]+]]:_(s32) = G_ASHR [[SHL2]], [[C2]](s32)
178 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[SUB]](s32), [[ASHR2]]
179 ; CHECK-NEXT: $x10 = COPY [[SUB]](s32)
180 ; CHECK-NEXT: $x11 = COPY [[ICMP]](s32)
181 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
182 %2:_(s32) = COPY $x10
183 %0:_(s8) = G_TRUNC %2(s32)
184 %3:_(s32) = COPY $x11
185 %1:_(s8) = G_TRUNC %3(s32)
186 %4:_(s8), %5:_(s1) = G_SSUBO %0, %1
187 %6:_(s32) = G_ANYEXT %4(s8)
188 %7:_(s32) = G_ANYEXT %5(s1)
189 $x10 = COPY %6(s32)
190 $x11 = COPY %7(s32)
191 PseudoRET implicit $x10, implicit $x11
192
193 ...
194 ---
195 name: ssubo_i16
196 body: |
197 bb.1:
198 liveins: $x10, $x11
199
200 ; CHECK-LABEL: name: ssubo_i16
201 ; CHECK: liveins: $x10, $x11
202 ; CHECK-NEXT: {{ $}}
203 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
204 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
205 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
206 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[C]](s32)
207 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
208 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
209 ; CHECK-NEXT: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C1]](s32)
210 ; CHECK-NEXT: [[ASHR1:%[0-9]+]]:_(s32) = G_ASHR [[SHL1]], [[C1]](s32)
211 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[ASHR]], [[ASHR1]]
212 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
213 ; CHECK-NEXT: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[SUB]], [[C2]](s32)
214 ; CHECK-NEXT: [[ASHR2:%[0-9]+]]:_(s32) = G_ASHR [[SHL2]], [[C2]](s32)
215 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[SUB]](s32), [[ASHR2]]
216 ; CHECK-NEXT: $x10 = COPY [[SUB]](s32)
217 ; CHECK-NEXT: $x11 = COPY [[ICMP]](s32)
218 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
219 %2:_(s32) = COPY $x10
220 %0:_(s16) = G_TRUNC %2(s32)
221 %3:_(s32) = COPY $x11
222 %1:_(s16) = G_TRUNC %3(s32)
223 %4:_(s16), %5:_(s1) = G_SSUBO %0, %1
224 %6:_(s32) = G_ANYEXT %4(s16)
225 %7:_(s32) = G_ANYEXT %5(s1)
226 $x10 = COPY %6(s32)
227 $x11 = COPY %7(s32)
228 PseudoRET implicit $x10, implicit $x11
229
230 ...
231 ---
232 name: ssubo_i32
233 body: |
234 bb.1:
235 liveins: $x10, $x11
236
237 ; CHECK-LABEL: name: ssubo_i32
238 ; CHECK: liveins: $x10, $x11
239 ; CHECK-NEXT: {{ $}}
240 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
241 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
242 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[COPY]], [[COPY1]]
243 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
244 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(slt), [[SUB]](s32), [[COPY]]
245 ; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(sgt), [[COPY1]](s32), [[C]]
246 ; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[ICMP1]], [[ICMP]]
247 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY [[SUB]](s32)
248 ; CHECK-NEXT: $x10 = COPY [[COPY2]](s32)
249 ; CHECK-NEXT: $x11 = COPY [[XOR]](s32)
250 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
251 %0:_(s32) = COPY $x10
252 %1:_(s32) = COPY $x11
253 %2:_(s32), %3:_(s1) = G_SSUBO %0, %1
254 %4:_(s32) = G_ANYEXT %3(s1)
255 $x10 = COPY %2(s32)
256 $x11 = COPY %4(s32)
257 PseudoRET implicit $x10, implicit $x11
258
259 ...
260 ---
261 name: ssubo_i64
262 body: |
263 bb.1:
264 liveins: $x10, $x11, $x12, $x13
265
266 ; CHECK-LABEL: name: ssubo_i64
267 ; CHECK: liveins: $x10, $x11, $x12, $x13
268 ; CHECK-NEXT: {{ $}}
269 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
270 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
271 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $x12
272 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY $x13
273 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[COPY]], [[COPY2]]
274 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[COPY]](s32), [[COPY2]]
275 ; CHECK-NEXT: [[SUB1:%[0-9]+]]:_(s32) = G_SUB [[COPY1]], [[COPY3]]
276 ; CHECK-NEXT: [[SUB2:%[0-9]+]]:_(s32) = G_SUB [[SUB1]], [[ICMP]]
277 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
278 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
279 ; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(slt), [[SUB2]](s32), [[COPY1]]
280 ; CHECK-NEXT: [[ICMP2:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[SUB2]](s32), [[COPY1]]
281 ; CHECK-NEXT: [[ICMP3:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[SUB]](s32), [[COPY]]
282 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP2]](s32), [[ICMP3]], [[ICMP1]]
283 ; CHECK-NEXT: [[ICMP4:%[0-9]+]]:_(s32) = G_ICMP intpred(sgt), [[COPY3]](s32), [[C1]]
284 ; CHECK-NEXT: [[ICMP5:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[COPY3]](s32), [[C1]]
285 ; CHECK-NEXT: [[ICMP6:%[0-9]+]]:_(s32) = G_ICMP intpred(ugt), [[COPY2]](s32), [[C]]
286 ; CHECK-NEXT: [[SELECT1:%[0-9]+]]:_(s32) = G_SELECT [[ICMP5]](s32), [[ICMP6]], [[ICMP4]]
287 ; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[SELECT1]], [[SELECT]]
288 ; CHECK-NEXT: $x10 = COPY [[SUB]](s32)
289 ; CHECK-NEXT: $x11 = COPY [[SUB2]](s32)
290 ; CHECK-NEXT: $x12 = COPY [[XOR]](s32)
291 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11, implicit $x12
292 %2:_(s32) = COPY $x10
293 %3:_(s32) = COPY $x11
294 %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32)
295 %4:_(s32) = COPY $x12
296 %5:_(s32) = COPY $x13
297 %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32)
298 %6:_(s64), %7:_(s1) = G_SSUBO %0, %1
299 %8:_(s32), %9:_(s32) = G_UNMERGE_VALUES %6(s64)
300 %10:_(s32) = G_ANYEXT %7(s1)
301 $x10 = COPY %8(s32)
302 $x11 = COPY %9(s32)
303 $x12 = COPY %10(s32)
304 PseudoRET implicit $x10, implicit $x11, implicit $x12
305
306 ...
307 ---
308 name: uaddo_i8
309 body: |
310 bb.1:
311 liveins: $x10, $x11
312
313 ; CHECK-LABEL: name: uaddo_i8
314 ; CHECK: liveins: $x10, $x11
315 ; CHECK-NEXT: {{ $}}
316 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
317 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
318 ; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[COPY1]]
319 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
320 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ADD]], [[C]]
321 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
322 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C1]]
323 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[AND]](s32), [[AND1]]
324 ; CHECK-NEXT: $x10 = COPY [[ADD]](s32)
325 ; CHECK-NEXT: $x11 = COPY [[ICMP]](s32)
326 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
327 %2:_(s32) = COPY $x10
328 %0:_(s8) = G_TRUNC %2(s32)
329 %3:_(s32) = COPY $x11
330 %1:_(s8) = G_TRUNC %3(s32)
331 %4:_(s8), %5:_(s1) = G_UADDO %0, %1
332 %6:_(s32) = G_ANYEXT %4(s8)
333 %7:_(s32) = G_ANYEXT %5(s1)
334 $x10 = COPY %6(s32)
335 $x11 = COPY %7(s32)
336 PseudoRET implicit $x10, implicit $x11
337
338 ...
339 ---
340 name: uaddo_i16
341 body: |
342 bb.1:
343 liveins: $x10, $x11
344
345 ; CHECK-LABEL: name: uaddo_i16
346 ; CHECK: liveins: $x10, $x11
347 ; CHECK-NEXT: {{ $}}
348 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
349 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
350 ; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[COPY1]]
351 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
352 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ADD]], [[C]]
353 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
354 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C1]]
355 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[AND]](s32), [[AND1]]
356 ; CHECK-NEXT: $x10 = COPY [[ADD]](s32)
357 ; CHECK-NEXT: $x11 = COPY [[ICMP]](s32)
358 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
359 %2:_(s32) = COPY $x10
360 %0:_(s16) = G_TRUNC %2(s32)
361 %3:_(s32) = COPY $x11
362 %1:_(s16) = G_TRUNC %3(s32)
363 %4:_(s16), %5:_(s1) = G_UADDO %0, %1
364 %6:_(s32) = G_ANYEXT %4(s16)
365 %7:_(s32) = G_ANYEXT %5(s1)
366 $x10 = COPY %6(s32)
367 $x11 = COPY %7(s32)
368 PseudoRET implicit $x10, implicit $x11
369
370 ...
371 ---
372 name: uaddo_i32
373 body: |
374 bb.1:
375 liveins: $x10, $x11
376
377 ; CHECK-LABEL: name: uaddo_i32
378 ; CHECK: liveins: $x10, $x11
379 ; CHECK-NEXT: {{ $}}
380 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
381 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
382 ; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[COPY1]]
383 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[ADD]](s32), [[COPY1]]
384 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY [[ADD]](s32)
385 ; CHECK-NEXT: $x10 = COPY [[COPY2]](s32)
386 ; CHECK-NEXT: $x11 = COPY [[ICMP]](s32)
387 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
388 %0:_(s32) = COPY $x10
389 %1:_(s32) = COPY $x11
390 %2:_(s32), %3:_(s1) = G_UADDO %0, %1
391 %4:_(s32) = G_ANYEXT %3(s1)
392 $x10 = COPY %2(s32)
393 $x11 = COPY %4(s32)
394 PseudoRET implicit $x10, implicit $x11
395
396 ...
397 ---
398 name: uaddo_i64
399 body: |
400 bb.1:
401 liveins: $x10, $x11, $x12, $x13
402
403 ; CHECK-LABEL: name: uaddo_i64
404 ; CHECK: liveins: $x10, $x11, $x12, $x13
405 ; CHECK-NEXT: {{ $}}
406 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
407 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
408 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $x12
409 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY $x13
410 ; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[COPY2]]
411 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[ADD]](s32), [[COPY2]]
412 ; CHECK-NEXT: [[COPY4:%[0-9]+]]:_(s32) = COPY [[ADD]](s32)
413 ; CHECK-NEXT: [[ADD1:%[0-9]+]]:_(s32) = G_ADD [[COPY1]], [[COPY3]]
414 ; CHECK-NEXT: [[ADD2:%[0-9]+]]:_(s32) = G_ADD [[ADD1]], [[ICMP]]
415 ; CHECK-NEXT: [[COPY5:%[0-9]+]]:_(s32) = COPY [[ADD2]](s32)
416 ; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[COPY5]](s32), [[COPY3]]
417 ; CHECK-NEXT: [[ICMP2:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[COPY5]](s32), [[COPY3]]
418 ; CHECK-NEXT: [[ICMP3:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[COPY4]](s32), [[COPY2]]
419 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP2]](s32), [[ICMP3]], [[ICMP1]]
420 ; CHECK-NEXT: $x10 = COPY [[COPY4]](s32)
421 ; CHECK-NEXT: $x11 = COPY [[COPY5]](s32)
422 ; CHECK-NEXT: $x12 = COPY [[SELECT]](s32)
423 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11, implicit $x12
424 %2:_(s32) = COPY $x10
425 %3:_(s32) = COPY $x11
426 %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32)
427 %4:_(s32) = COPY $x12
428 %5:_(s32) = COPY $x13
429 %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32)
430 %6:_(s64), %7:_(s1) = G_UADDO %0, %1
431 %8:_(s32), %9:_(s32) = G_UNMERGE_VALUES %6(s64)
432 %10:_(s32) = G_ANYEXT %7(s1)
433 $x10 = COPY %8(s32)
434 $x11 = COPY %9(s32)
435 $x12 = COPY %10(s32)
436 PseudoRET implicit $x10, implicit $x11, implicit $x12
437
438 ...
439 ---
440 name: usubo_i8
441 body: |
442 bb.1:
443 liveins: $x10, $x11
444
445 ; CHECK-LABEL: name: usubo_i8
446 ; CHECK: liveins: $x10, $x11
447 ; CHECK-NEXT: {{ $}}
448 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
449 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
450 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[COPY]], [[COPY1]]
451 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
452 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]]
453 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
454 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C1]]
455 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[AND]](s32), [[AND1]]
456 ; CHECK-NEXT: $x10 = COPY [[SUB]](s32)
457 ; CHECK-NEXT: $x11 = COPY [[ICMP]](s32)
458 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
459 %2:_(s32) = COPY $x10
460 %0:_(s8) = G_TRUNC %2(s32)
461 %3:_(s32) = COPY $x11
462 %1:_(s8) = G_TRUNC %3(s32)
463 %4:_(s8), %5:_(s1) = G_USUBO %0, %1
464 %6:_(s32) = G_ANYEXT %4(s8)
465 %7:_(s32) = G_ANYEXT %5(s1)
466 $x10 = COPY %6(s32)
467 $x11 = COPY %7(s32)
468 PseudoRET implicit $x10, implicit $x11
469
470 ...
471 ---
472 name: usubo_i16
473 body: |
474 bb.1:
475 liveins: $x10, $x11
476
477 ; CHECK-LABEL: name: usubo_i16
478 ; CHECK: liveins: $x10, $x11
479 ; CHECK-NEXT: {{ $}}
480 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
481 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
482 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[COPY]], [[COPY1]]
483 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
484 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]]
485 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
486 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C1]]
487 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[AND]](s32), [[AND1]]
488 ; CHECK-NEXT: $x10 = COPY [[SUB]](s32)
489 ; CHECK-NEXT: $x11 = COPY [[ICMP]](s32)
490 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
491 %2:_(s32) = COPY $x10
492 %0:_(s16) = G_TRUNC %2(s32)
493 %3:_(s32) = COPY $x11
494 %1:_(s16) = G_TRUNC %3(s32)
495 %4:_(s16), %5:_(s1) = G_USUBO %0, %1
496 %6:_(s32) = G_ANYEXT %4(s16)
497 %7:_(s32) = G_ANYEXT %5(s1)
498 $x10 = COPY %6(s32)
499 $x11 = COPY %7(s32)
500 PseudoRET implicit $x10, implicit $x11
501
502 ...
503 ---
504 name: usubo_i32
505 body: |
506 bb.1:
507 liveins: $x10, $x11
508
509 ; CHECK-LABEL: name: usubo_i32
510 ; CHECK: liveins: $x10, $x11
511 ; CHECK-NEXT: {{ $}}
512 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
513 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
514 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[COPY]], [[COPY1]]
515 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[COPY]](s32), [[COPY1]]
516 ; CHECK-NEXT: $x10 = COPY [[SUB]](s32)
517 ; CHECK-NEXT: $x11 = COPY [[ICMP]](s32)
518 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
519 %0:_(s32) = COPY $x10
520 %1:_(s32) = COPY $x11
521 %2:_(s32), %3:_(s1) = G_USUBO %0, %1
522 %4:_(s32) = G_ANYEXT %3(s1)
523 $x10 = COPY %2(s32)
524 $x11 = COPY %4(s32)
525 PseudoRET implicit $x10, implicit $x11
526
527 ...
528 ---
529 name: usubo_i64
530 body: |
531 bb.1:
532 liveins: $x10, $x11, $x12, $x13
533
534 ; CHECK-LABEL: name: usubo_i64
535 ; CHECK: liveins: $x10, $x11, $x12, $x13
536 ; CHECK-NEXT: {{ $}}
537 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
538 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
539 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $x12
540 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY $x13
541 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[COPY]], [[COPY2]]
542 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[COPY]](s32), [[COPY2]]
543 ; CHECK-NEXT: [[SUB1:%[0-9]+]]:_(s32) = G_SUB [[COPY1]], [[COPY3]]
544 ; CHECK-NEXT: [[SUB2:%[0-9]+]]:_(s32) = G_SUB [[SUB1]], [[ICMP]]
545 ; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[COPY1]](s32), [[COPY3]]
546 ; CHECK-NEXT: [[ICMP2:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[COPY1]](s32), [[COPY3]]
547 ; CHECK-NEXT: [[ICMP3:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[COPY]](s32), [[COPY2]]
548 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP2]](s32), [[ICMP3]], [[ICMP1]]
549 ; CHECK-NEXT: $x10 = COPY [[SUB]](s32)
550 ; CHECK-NEXT: $x11 = COPY [[SUB2]](s32)
551 ; CHECK-NEXT: $x12 = COPY [[SELECT]](s32)
552 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11, implicit $x12
553 %2:_(s32) = COPY $x10
554 %3:_(s32) = COPY $x11
555 %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32)
556 %4:_(s32) = COPY $x12
557 %5:_(s32) = COPY $x13
558 %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32)
559 %6:_(s64), %7:_(s1) = G_USUBO %0, %1
560 %8:_(s32), %9:_(s32) = G_UNMERGE_VALUES %6(s64)
561 %10:_(s32) = G_ANYEXT %7(s1)
562 $x10 = COPY %8(s32)
563 $x11 = COPY %9(s32)
564 $x12 = COPY %10(s32)
565 PseudoRET implicit $x10, implicit $x11, implicit $x12
566
567 ...