1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=riscv64 -run-pass=legalizer %s -o - \
3 # RUN: | FileCheck %s -check-prefix=CHECK-I
4 # RUN: llc -mattr=+m -mtriple=riscv64 -run-pass=legalizer %s -o - \
5 # RUN: | FileCheck %s -check-prefix=CHECK-M
10 ; CHECK-I-LABEL: name: sdiv_i8
11 ; CHECK-I: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
12 ; CHECK-I-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
13 ; CHECK-I-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 56
14 ; CHECK-I-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[COPY]], [[C]](s64)
15 ; CHECK-I-NEXT: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[SHL]], [[C]](s64)
16 ; CHECK-I-NEXT: [[SHL1:%[0-9]+]]:_(s64) = G_SHL [[COPY1]], [[C]](s64)
17 ; CHECK-I-NEXT: [[ASHR1:%[0-9]+]]:_(s64) = G_ASHR [[SHL1]], [[C]](s64)
18 ; CHECK-I-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
19 ; CHECK-I-NEXT: $x10 = COPY [[ASHR]](s64)
20 ; CHECK-I-NEXT: $x11 = COPY [[ASHR1]](s64)
21 ; CHECK-I-NEXT: PseudoCALL target-flags(riscv-call) &__divdi3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10
22 ; CHECK-I-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
23 ; CHECK-I-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x10
24 ; CHECK-I-NEXT: $x10 = COPY [[COPY2]](s64)
25 ; CHECK-I-NEXT: PseudoRET implicit $x10
27 ; CHECK-M-LABEL: name: sdiv_i8
28 ; CHECK-M: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
29 ; CHECK-M-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
30 ; CHECK-M-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 56
31 ; CHECK-M-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[COPY]], [[C]](s64)
32 ; CHECK-M-NEXT: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[SHL]], [[C]](s64)
33 ; CHECK-M-NEXT: [[SHL1:%[0-9]+]]:_(s64) = G_SHL [[COPY1]], [[C]](s64)
34 ; CHECK-M-NEXT: [[ASHR1:%[0-9]+]]:_(s64) = G_ASHR [[SHL1]], [[C]](s64)
35 ; CHECK-M-NEXT: [[DIVW:%[0-9]+]]:_(s64) = G_DIVW [[ASHR]], [[ASHR1]]
36 ; CHECK-M-NEXT: $x10 = COPY [[DIVW]](s64)
37 ; CHECK-M-NEXT: PseudoRET implicit $x10
40 %2:_(s8) = G_TRUNC %0(s64)
41 %3:_(s8) = G_TRUNC %1(s64)
42 %4:_(s8) = G_SDIV %2, %3
43 %5:_(s64) = G_ANYEXT %4(s8)
45 PseudoRET implicit $x10
52 ; CHECK-I-LABEL: name: sdiv_i15
53 ; CHECK-I: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
54 ; CHECK-I-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
55 ; CHECK-I-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 49
56 ; CHECK-I-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[COPY]], [[C]](s64)
57 ; CHECK-I-NEXT: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[SHL]], [[C]](s64)
58 ; CHECK-I-NEXT: [[SHL1:%[0-9]+]]:_(s64) = G_SHL [[COPY1]], [[C]](s64)
59 ; CHECK-I-NEXT: [[ASHR1:%[0-9]+]]:_(s64) = G_ASHR [[SHL1]], [[C]](s64)
60 ; CHECK-I-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
61 ; CHECK-I-NEXT: $x10 = COPY [[ASHR]](s64)
62 ; CHECK-I-NEXT: $x11 = COPY [[ASHR1]](s64)
63 ; CHECK-I-NEXT: PseudoCALL target-flags(riscv-call) &__divdi3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10
64 ; CHECK-I-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
65 ; CHECK-I-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x10
66 ; CHECK-I-NEXT: $x10 = COPY [[COPY2]](s64)
67 ; CHECK-I-NEXT: PseudoRET implicit $x10
69 ; CHECK-M-LABEL: name: sdiv_i15
70 ; CHECK-M: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
71 ; CHECK-M-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
72 ; CHECK-M-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 49
73 ; CHECK-M-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[COPY]], [[C]](s64)
74 ; CHECK-M-NEXT: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[SHL]], [[C]](s64)
75 ; CHECK-M-NEXT: [[SHL1:%[0-9]+]]:_(s64) = G_SHL [[COPY1]], [[C]](s64)
76 ; CHECK-M-NEXT: [[ASHR1:%[0-9]+]]:_(s64) = G_ASHR [[SHL1]], [[C]](s64)
77 ; CHECK-M-NEXT: [[DIVW:%[0-9]+]]:_(s64) = G_DIVW [[ASHR]], [[ASHR1]]
78 ; CHECK-M-NEXT: $x10 = COPY [[DIVW]](s64)
79 ; CHECK-M-NEXT: PseudoRET implicit $x10
82 %2:_(s15) = G_TRUNC %0(s64)
83 %3:_(s15) = G_TRUNC %1(s64)
84 %4:_(s15) = G_SDIV %2, %3
85 %5:_(s64) = G_ANYEXT %4(s15)
87 PseudoRET implicit $x10
94 ; CHECK-I-LABEL: name: sdiv_i16
95 ; CHECK-I: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
96 ; CHECK-I-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
97 ; CHECK-I-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 48
98 ; CHECK-I-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[COPY]], [[C]](s64)
99 ; CHECK-I-NEXT: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[SHL]], [[C]](s64)
100 ; CHECK-I-NEXT: [[SHL1:%[0-9]+]]:_(s64) = G_SHL [[COPY1]], [[C]](s64)
101 ; CHECK-I-NEXT: [[ASHR1:%[0-9]+]]:_(s64) = G_ASHR [[SHL1]], [[C]](s64)
102 ; CHECK-I-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
103 ; CHECK-I-NEXT: $x10 = COPY [[ASHR]](s64)
104 ; CHECK-I-NEXT: $x11 = COPY [[ASHR1]](s64)
105 ; CHECK-I-NEXT: PseudoCALL target-flags(riscv-call) &__divdi3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10
106 ; CHECK-I-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
107 ; CHECK-I-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x10
108 ; CHECK-I-NEXT: $x10 = COPY [[COPY2]](s64)
109 ; CHECK-I-NEXT: PseudoRET implicit $x10
111 ; CHECK-M-LABEL: name: sdiv_i16
112 ; CHECK-M: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
113 ; CHECK-M-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
114 ; CHECK-M-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 48
115 ; CHECK-M-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[COPY]], [[C]](s64)
116 ; CHECK-M-NEXT: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[SHL]], [[C]](s64)
117 ; CHECK-M-NEXT: [[SHL1:%[0-9]+]]:_(s64) = G_SHL [[COPY1]], [[C]](s64)
118 ; CHECK-M-NEXT: [[ASHR1:%[0-9]+]]:_(s64) = G_ASHR [[SHL1]], [[C]](s64)
119 ; CHECK-M-NEXT: [[DIVW:%[0-9]+]]:_(s64) = G_DIVW [[ASHR]], [[ASHR1]]
120 ; CHECK-M-NEXT: $x10 = COPY [[DIVW]](s64)
121 ; CHECK-M-NEXT: PseudoRET implicit $x10
122 %0:_(s64) = COPY $x10
123 %1:_(s64) = COPY $x11
124 %2:_(s16) = G_TRUNC %0(s64)
125 %3:_(s16) = G_TRUNC %1(s64)
126 %4:_(s16) = G_SDIV %2, %3
127 %5:_(s64) = G_ANYEXT %4(s16)
129 PseudoRET implicit $x10
136 ; CHECK-I-LABEL: name: sdiv_i32
137 ; CHECK-I: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
138 ; CHECK-I-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
139 ; CHECK-I-NEXT: [[SEXT_INREG:%[0-9]+]]:_(s64) = G_SEXT_INREG [[COPY]], 32
140 ; CHECK-I-NEXT: [[SEXT_INREG1:%[0-9]+]]:_(s64) = G_SEXT_INREG [[COPY1]], 32
141 ; CHECK-I-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
142 ; CHECK-I-NEXT: $x10 = COPY [[SEXT_INREG]](s64)
143 ; CHECK-I-NEXT: $x11 = COPY [[SEXT_INREG1]](s64)
144 ; CHECK-I-NEXT: PseudoCALL target-flags(riscv-call) &__divdi3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10
145 ; CHECK-I-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
146 ; CHECK-I-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x10
147 ; CHECK-I-NEXT: $x10 = COPY [[COPY2]](s64)
148 ; CHECK-I-NEXT: PseudoRET implicit $x10
150 ; CHECK-M-LABEL: name: sdiv_i32
151 ; CHECK-M: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
152 ; CHECK-M-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
153 ; CHECK-M-NEXT: [[DIVW:%[0-9]+]]:_(s64) = G_DIVW [[COPY]], [[COPY1]]
154 ; CHECK-M-NEXT: $x10 = COPY [[DIVW]](s64)
155 ; CHECK-M-NEXT: PseudoRET implicit $x10
156 %0:_(s64) = COPY $x10
157 %1:_(s64) = COPY $x11
158 %2:_(s32) = G_TRUNC %0(s64)
159 %3:_(s32) = G_TRUNC %1(s64)
160 %4:_(s32) = G_SDIV %2, %3
161 %5:_(s64) = G_ANYEXT %4(s32)
163 PseudoRET implicit $x10
170 ; CHECK-I-LABEL: name: sdiv_i64
171 ; CHECK-I: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
172 ; CHECK-I-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
173 ; CHECK-I-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
174 ; CHECK-I-NEXT: $x10 = COPY [[COPY]](s64)
175 ; CHECK-I-NEXT: $x11 = COPY [[COPY1]](s64)
176 ; CHECK-I-NEXT: PseudoCALL target-flags(riscv-call) &__divdi3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10
177 ; CHECK-I-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
178 ; CHECK-I-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x10
179 ; CHECK-I-NEXT: $x10 = COPY [[COPY2]](s64)
180 ; CHECK-I-NEXT: PseudoRET implicit $x10
182 ; CHECK-M-LABEL: name: sdiv_i64
183 ; CHECK-M: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
184 ; CHECK-M-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
185 ; CHECK-M-NEXT: [[SDIV:%[0-9]+]]:_(s64) = G_SDIV [[COPY]], [[COPY1]]
186 ; CHECK-M-NEXT: $x10 = COPY [[SDIV]](s64)
187 ; CHECK-M-NEXT: PseudoRET implicit $x10
188 %0:_(s64) = COPY $x10
189 %1:_(s64) = COPY $x11
190 %2:_(s64) = G_SDIV %0, %1
192 PseudoRET implicit $x10
199 ; CHECK-I-LABEL: name: sdiv_i72
200 ; CHECK-I: %xlo:_(s64) = COPY $x10
201 ; CHECK-I-NEXT: %xhi:_(s64) = COPY $x11
202 ; CHECK-I-NEXT: %ylo:_(s64) = COPY $x12
203 ; CHECK-I-NEXT: %yhi:_(s64) = COPY $x13
204 ; CHECK-I-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 56
205 ; CHECK-I-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL %xhi, [[C]](s64)
206 ; CHECK-I-NEXT: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[SHL]], [[C]](s64)
207 ; CHECK-I-NEXT: [[SHL1:%[0-9]+]]:_(s64) = G_SHL %yhi, [[C]](s64)
208 ; CHECK-I-NEXT: [[ASHR1:%[0-9]+]]:_(s64) = G_ASHR [[SHL1]], [[C]](s64)
209 ; CHECK-I-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
210 ; CHECK-I-NEXT: $x10 = COPY %xlo(s64)
211 ; CHECK-I-NEXT: $x11 = COPY [[ASHR]](s64)
212 ; CHECK-I-NEXT: $x12 = COPY %ylo(s64)
213 ; CHECK-I-NEXT: $x13 = COPY [[ASHR1]](s64)
214 ; CHECK-I-NEXT: PseudoCALL target-flags(riscv-call) &__divti3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit $x12, implicit $x13, implicit-def $x10, implicit-def $x11
215 ; CHECK-I-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
216 ; CHECK-I-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
217 ; CHECK-I-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
218 ; CHECK-I-NEXT: $x10 = COPY [[COPY]](s64)
219 ; CHECK-I-NEXT: $x11 = COPY [[COPY1]](s64)
220 ; CHECK-I-NEXT: PseudoRET implicit $x10, implicit $x11
222 ; CHECK-M-LABEL: name: sdiv_i72
223 ; CHECK-M: %xlo:_(s64) = COPY $x10
224 ; CHECK-M-NEXT: %xhi:_(s64) = COPY $x11
225 ; CHECK-M-NEXT: %ylo:_(s64) = COPY $x12
226 ; CHECK-M-NEXT: %yhi:_(s64) = COPY $x13
227 ; CHECK-M-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 56
228 ; CHECK-M-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL %xhi, [[C]](s64)
229 ; CHECK-M-NEXT: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[SHL]], [[C]](s64)
230 ; CHECK-M-NEXT: [[SHL1:%[0-9]+]]:_(s64) = G_SHL %yhi, [[C]](s64)
231 ; CHECK-M-NEXT: [[ASHR1:%[0-9]+]]:_(s64) = G_ASHR [[SHL1]], [[C]](s64)
232 ; CHECK-M-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
233 ; CHECK-M-NEXT: $x10 = COPY %xlo(s64)
234 ; CHECK-M-NEXT: $x11 = COPY [[ASHR]](s64)
235 ; CHECK-M-NEXT: $x12 = COPY %ylo(s64)
236 ; CHECK-M-NEXT: $x13 = COPY [[ASHR1]](s64)
237 ; CHECK-M-NEXT: PseudoCALL target-flags(riscv-call) &__divti3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit $x12, implicit $x13, implicit-def $x10, implicit-def $x11
238 ; CHECK-M-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
239 ; CHECK-M-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
240 ; CHECK-M-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
241 ; CHECK-M-NEXT: $x10 = COPY [[COPY]](s64)
242 ; CHECK-M-NEXT: $x11 = COPY [[COPY1]](s64)
243 ; CHECK-M-NEXT: PseudoRET implicit $x10, implicit $x11
244 %xlo:_(s64) = COPY $x10
245 %xhi:_(s64) = COPY $x11
246 %ylo:_(s64) = COPY $x12
247 %yhi:_(s64) = COPY $x13
248 %x0:_(s128) = G_MERGE_VALUES %xlo(s64), %xhi(s64)
249 %y0:_(s128) = G_MERGE_VALUES %ylo(s64), %yhi(s64)
250 %x:_(s72) = G_TRUNC %x0
251 %y:_(s72) = G_TRUNC %y0
252 %z:_(s72) = G_SDIV %x, %y
253 %z0:_(s128) = G_ANYEXT %z
254 %zlo:_(s64), %zhi:_(s64) = G_UNMERGE_VALUES %z0(s128)
255 $x10 = COPY %zlo(s64)
256 $x11 = COPY %zhi(s64)
257 PseudoRET implicit $x10, implicit $x11
264 ; CHECK-I-LABEL: name: sdiv_i128
265 ; CHECK-I: %lo1:_(s64) = COPY $x10
266 ; CHECK-I-NEXT: %hi1:_(s64) = COPY $x11
267 ; CHECK-I-NEXT: %lo2:_(s64) = COPY $x12
268 ; CHECK-I-NEXT: %hi2:_(s64) = COPY $x13
269 ; CHECK-I-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
270 ; CHECK-I-NEXT: $x10 = COPY %lo1(s64)
271 ; CHECK-I-NEXT: $x11 = COPY %hi1(s64)
272 ; CHECK-I-NEXT: $x12 = COPY %lo2(s64)
273 ; CHECK-I-NEXT: $x13 = COPY %hi2(s64)
274 ; CHECK-I-NEXT: PseudoCALL target-flags(riscv-call) &__divti3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit $x12, implicit $x13, implicit-def $x10, implicit-def $x11
275 ; CHECK-I-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
276 ; CHECK-I-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
277 ; CHECK-I-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
278 ; CHECK-I-NEXT: $x10 = COPY [[COPY]](s64)
279 ; CHECK-I-NEXT: $x11 = COPY [[COPY1]](s64)
280 ; CHECK-I-NEXT: PseudoRET implicit $x10, implicit $x11
282 ; CHECK-M-LABEL: name: sdiv_i128
283 ; CHECK-M: %lo1:_(s64) = COPY $x10
284 ; CHECK-M-NEXT: %hi1:_(s64) = COPY $x11
285 ; CHECK-M-NEXT: %lo2:_(s64) = COPY $x12
286 ; CHECK-M-NEXT: %hi2:_(s64) = COPY $x13
287 ; CHECK-M-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
288 ; CHECK-M-NEXT: $x10 = COPY %lo1(s64)
289 ; CHECK-M-NEXT: $x11 = COPY %hi1(s64)
290 ; CHECK-M-NEXT: $x12 = COPY %lo2(s64)
291 ; CHECK-M-NEXT: $x13 = COPY %hi2(s64)
292 ; CHECK-M-NEXT: PseudoCALL target-flags(riscv-call) &__divti3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit $x12, implicit $x13, implicit-def $x10, implicit-def $x11
293 ; CHECK-M-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
294 ; CHECK-M-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
295 ; CHECK-M-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
296 ; CHECK-M-NEXT: $x10 = COPY [[COPY]](s64)
297 ; CHECK-M-NEXT: $x11 = COPY [[COPY1]](s64)
298 ; CHECK-M-NEXT: PseudoRET implicit $x10, implicit $x11
299 %lo1:_(s64) = COPY $x10
300 %hi1:_(s64) = COPY $x11
301 %lo2:_(s64) = COPY $x12
302 %hi2:_(s64) = COPY $x13
303 %x1:_(s128) = G_MERGE_VALUES %lo1(s64), %hi1(s64)
304 %x2:_(s128) = G_MERGE_VALUES %lo2(s64), %hi2(s64)
305 %y:_(s128) = G_SDIV %x1, %x2
306 %loy:_(s64), %hiy:_(s64) = G_UNMERGE_VALUES %y(s128)
307 $x10 = COPY %loy(s64)
308 $x11 = COPY %hiy(s64)
309 PseudoRET implicit $x10, implicit $x11
316 ; CHECK-I-LABEL: name: udiv_i8
317 ; CHECK-I: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
318 ; CHECK-I-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
319 ; CHECK-I-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 255
320 ; CHECK-I-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY]], [[C]]
321 ; CHECK-I-NEXT: [[AND1:%[0-9]+]]:_(s64) = G_AND [[COPY1]], [[C]]
322 ; CHECK-I-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
323 ; CHECK-I-NEXT: $x10 = COPY [[AND]](s64)
324 ; CHECK-I-NEXT: $x11 = COPY [[AND1]](s64)
325 ; CHECK-I-NEXT: PseudoCALL target-flags(riscv-call) &__udivdi3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10
326 ; CHECK-I-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
327 ; CHECK-I-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x10
328 ; CHECK-I-NEXT: $x10 = COPY [[COPY2]](s64)
329 ; CHECK-I-NEXT: PseudoRET implicit $x10
331 ; CHECK-M-LABEL: name: udiv_i8
332 ; CHECK-M: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
333 ; CHECK-M-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
334 ; CHECK-M-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 255
335 ; CHECK-M-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY]], [[C]]
336 ; CHECK-M-NEXT: [[AND1:%[0-9]+]]:_(s64) = G_AND [[COPY1]], [[C]]
337 ; CHECK-M-NEXT: [[DIVUW:%[0-9]+]]:_(s64) = G_DIVUW [[AND]], [[AND1]]
338 ; CHECK-M-NEXT: $x10 = COPY [[DIVUW]](s64)
339 ; CHECK-M-NEXT: PseudoRET implicit $x10
340 %0:_(s64) = COPY $x10
341 %1:_(s64) = COPY $x11
342 %2:_(s8) = G_TRUNC %0(s64)
343 %3:_(s8) = G_TRUNC %1(s64)
344 %4:_(s8) = G_UDIV %2, %3
345 %5:_(s64) = G_ANYEXT %4(s8)
347 PseudoRET implicit $x10
354 ; CHECK-I-LABEL: name: udiv_i15
355 ; CHECK-I: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
356 ; CHECK-I-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
357 ; CHECK-I-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 32767
358 ; CHECK-I-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY]], [[C]]
359 ; CHECK-I-NEXT: [[AND1:%[0-9]+]]:_(s64) = G_AND [[COPY1]], [[C]]
360 ; CHECK-I-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
361 ; CHECK-I-NEXT: $x10 = COPY [[AND]](s64)
362 ; CHECK-I-NEXT: $x11 = COPY [[AND1]](s64)
363 ; CHECK-I-NEXT: PseudoCALL target-flags(riscv-call) &__udivdi3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10
364 ; CHECK-I-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
365 ; CHECK-I-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x10
366 ; CHECK-I-NEXT: $x10 = COPY [[COPY2]](s64)
367 ; CHECK-I-NEXT: PseudoRET implicit $x10
369 ; CHECK-M-LABEL: name: udiv_i15
370 ; CHECK-M: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
371 ; CHECK-M-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
372 ; CHECK-M-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 32767
373 ; CHECK-M-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY]], [[C]]
374 ; CHECK-M-NEXT: [[AND1:%[0-9]+]]:_(s64) = G_AND [[COPY1]], [[C]]
375 ; CHECK-M-NEXT: [[DIVUW:%[0-9]+]]:_(s64) = G_DIVUW [[AND]], [[AND1]]
376 ; CHECK-M-NEXT: $x10 = COPY [[DIVUW]](s64)
377 ; CHECK-M-NEXT: PseudoRET implicit $x10
378 %0:_(s64) = COPY $x10
379 %1:_(s64) = COPY $x11
380 %2:_(s15) = G_TRUNC %0(s64)
381 %3:_(s15) = G_TRUNC %1(s64)
382 %4:_(s15) = G_UDIV %2, %3
383 %5:_(s64) = G_ANYEXT %4(s15)
385 PseudoRET implicit $x10
392 ; CHECK-I-LABEL: name: udiv_i16
393 ; CHECK-I: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
394 ; CHECK-I-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
395 ; CHECK-I-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 65535
396 ; CHECK-I-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY]], [[C]]
397 ; CHECK-I-NEXT: [[AND1:%[0-9]+]]:_(s64) = G_AND [[COPY1]], [[C]]
398 ; CHECK-I-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
399 ; CHECK-I-NEXT: $x10 = COPY [[AND]](s64)
400 ; CHECK-I-NEXT: $x11 = COPY [[AND1]](s64)
401 ; CHECK-I-NEXT: PseudoCALL target-flags(riscv-call) &__udivdi3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10
402 ; CHECK-I-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
403 ; CHECK-I-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x10
404 ; CHECK-I-NEXT: $x10 = COPY [[COPY2]](s64)
405 ; CHECK-I-NEXT: PseudoRET implicit $x10
407 ; CHECK-M-LABEL: name: udiv_i16
408 ; CHECK-M: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
409 ; CHECK-M-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
410 ; CHECK-M-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 65535
411 ; CHECK-M-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY]], [[C]]
412 ; CHECK-M-NEXT: [[AND1:%[0-9]+]]:_(s64) = G_AND [[COPY1]], [[C]]
413 ; CHECK-M-NEXT: [[DIVUW:%[0-9]+]]:_(s64) = G_DIVUW [[AND]], [[AND1]]
414 ; CHECK-M-NEXT: $x10 = COPY [[DIVUW]](s64)
415 ; CHECK-M-NEXT: PseudoRET implicit $x10
416 %0:_(s64) = COPY $x10
417 %1:_(s64) = COPY $x11
418 %2:_(s16) = G_TRUNC %0(s64)
419 %3:_(s16) = G_TRUNC %1(s64)
420 %4:_(s16) = G_UDIV %2, %3
421 %5:_(s64) = G_ANYEXT %4(s16)
423 PseudoRET implicit $x10
430 ; CHECK-I-LABEL: name: udiv_i32
431 ; CHECK-I: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
432 ; CHECK-I-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
433 ; CHECK-I-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 4294967295
434 ; CHECK-I-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY]], [[C]]
435 ; CHECK-I-NEXT: [[AND1:%[0-9]+]]:_(s64) = G_AND [[COPY1]], [[C]]
436 ; CHECK-I-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
437 ; CHECK-I-NEXT: $x10 = COPY [[AND]](s64)
438 ; CHECK-I-NEXT: $x11 = COPY [[AND1]](s64)
439 ; CHECK-I-NEXT: PseudoCALL target-flags(riscv-call) &__udivdi3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10
440 ; CHECK-I-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
441 ; CHECK-I-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x10
442 ; CHECK-I-NEXT: $x10 = COPY [[COPY2]](s64)
443 ; CHECK-I-NEXT: PseudoRET implicit $x10
445 ; CHECK-M-LABEL: name: udiv_i32
446 ; CHECK-M: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
447 ; CHECK-M-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
448 ; CHECK-M-NEXT: [[DIVUW:%[0-9]+]]:_(s64) = G_DIVUW [[COPY]], [[COPY1]]
449 ; CHECK-M-NEXT: $x10 = COPY [[DIVUW]](s64)
450 ; CHECK-M-NEXT: PseudoRET implicit $x10
451 %0:_(s64) = COPY $x10
452 %1:_(s64) = COPY $x11
453 %2:_(s32) = G_TRUNC %0(s64)
454 %3:_(s32) = G_TRUNC %1(s64)
455 %4:_(s32) = G_UDIV %2, %3
456 %5:_(s64) = G_ANYEXT %4(s32)
458 PseudoRET implicit $x10
465 ; CHECK-I-LABEL: name: udiv_i64
466 ; CHECK-I: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
467 ; CHECK-I-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
468 ; CHECK-I-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
469 ; CHECK-I-NEXT: $x10 = COPY [[COPY]](s64)
470 ; CHECK-I-NEXT: $x11 = COPY [[COPY1]](s64)
471 ; CHECK-I-NEXT: PseudoCALL target-flags(riscv-call) &__udivdi3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10
472 ; CHECK-I-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
473 ; CHECK-I-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x10
474 ; CHECK-I-NEXT: $x10 = COPY [[COPY2]](s64)
475 ; CHECK-I-NEXT: PseudoRET implicit $x10
477 ; CHECK-M-LABEL: name: udiv_i64
478 ; CHECK-M: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
479 ; CHECK-M-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
480 ; CHECK-M-NEXT: [[UDIV:%[0-9]+]]:_(s64) = G_UDIV [[COPY]], [[COPY1]]
481 ; CHECK-M-NEXT: $x10 = COPY [[UDIV]](s64)
482 ; CHECK-M-NEXT: PseudoRET implicit $x10
483 %0:_(s64) = COPY $x10
484 %1:_(s64) = COPY $x11
485 %2:_(s64) = G_UDIV %0, %1
487 PseudoRET implicit $x10
494 ; CHECK-I-LABEL: name: udiv_i72
495 ; CHECK-I: %xlo:_(s64) = COPY $x10
496 ; CHECK-I-NEXT: %xhi:_(s64) = COPY $x11
497 ; CHECK-I-NEXT: %ylo:_(s64) = COPY $x12
498 ; CHECK-I-NEXT: %yhi:_(s64) = COPY $x13
499 ; CHECK-I-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 -1
500 ; CHECK-I-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 255
501 ; CHECK-I-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND %xlo, [[C]]
502 ; CHECK-I-NEXT: [[AND1:%[0-9]+]]:_(s64) = G_AND %xhi, [[C1]]
503 ; CHECK-I-NEXT: [[AND2:%[0-9]+]]:_(s64) = G_AND %ylo, [[C]]
504 ; CHECK-I-NEXT: [[AND3:%[0-9]+]]:_(s64) = G_AND %yhi, [[C1]]
505 ; CHECK-I-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
506 ; CHECK-I-NEXT: $x10 = COPY [[AND]](s64)
507 ; CHECK-I-NEXT: $x11 = COPY [[AND1]](s64)
508 ; CHECK-I-NEXT: $x12 = COPY [[AND2]](s64)
509 ; CHECK-I-NEXT: $x13 = COPY [[AND3]](s64)
510 ; CHECK-I-NEXT: PseudoCALL target-flags(riscv-call) &__udivti3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit $x12, implicit $x13, implicit-def $x10, implicit-def $x11
511 ; CHECK-I-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
512 ; CHECK-I-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
513 ; CHECK-I-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
514 ; CHECK-I-NEXT: $x10 = COPY [[COPY]](s64)
515 ; CHECK-I-NEXT: $x11 = COPY [[COPY1]](s64)
516 ; CHECK-I-NEXT: PseudoRET implicit $x10, implicit $x11
518 ; CHECK-M-LABEL: name: udiv_i72
519 ; CHECK-M: %xlo:_(s64) = COPY $x10
520 ; CHECK-M-NEXT: %xhi:_(s64) = COPY $x11
521 ; CHECK-M-NEXT: %ylo:_(s64) = COPY $x12
522 ; CHECK-M-NEXT: %yhi:_(s64) = COPY $x13
523 ; CHECK-M-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 -1
524 ; CHECK-M-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 255
525 ; CHECK-M-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND %xlo, [[C]]
526 ; CHECK-M-NEXT: [[AND1:%[0-9]+]]:_(s64) = G_AND %xhi, [[C1]]
527 ; CHECK-M-NEXT: [[AND2:%[0-9]+]]:_(s64) = G_AND %ylo, [[C]]
528 ; CHECK-M-NEXT: [[AND3:%[0-9]+]]:_(s64) = G_AND %yhi, [[C1]]
529 ; CHECK-M-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
530 ; CHECK-M-NEXT: $x10 = COPY [[AND]](s64)
531 ; CHECK-M-NEXT: $x11 = COPY [[AND1]](s64)
532 ; CHECK-M-NEXT: $x12 = COPY [[AND2]](s64)
533 ; CHECK-M-NEXT: $x13 = COPY [[AND3]](s64)
534 ; CHECK-M-NEXT: PseudoCALL target-flags(riscv-call) &__udivti3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit $x12, implicit $x13, implicit-def $x10, implicit-def $x11
535 ; CHECK-M-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
536 ; CHECK-M-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
537 ; CHECK-M-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
538 ; CHECK-M-NEXT: $x10 = COPY [[COPY]](s64)
539 ; CHECK-M-NEXT: $x11 = COPY [[COPY1]](s64)
540 ; CHECK-M-NEXT: PseudoRET implicit $x10, implicit $x11
541 %xlo:_(s64) = COPY $x10
542 %xhi:_(s64) = COPY $x11
543 %ylo:_(s64) = COPY $x12
544 %yhi:_(s64) = COPY $x13
545 %x0:_(s128) = G_MERGE_VALUES %xlo(s64), %xhi(s64)
546 %y0:_(s128) = G_MERGE_VALUES %ylo(s64), %yhi(s64)
547 %x:_(s72) = G_TRUNC %x0
548 %y:_(s72) = G_TRUNC %y0
549 %z:_(s72) = G_UDIV %x, %y
550 %z0:_(s128) = G_ANYEXT %z
551 %zlo:_(s64), %zhi:_(s64) = G_UNMERGE_VALUES %z0(s128)
552 $x10 = COPY %zlo(s64)
553 $x11 = COPY %zhi(s64)
554 PseudoRET implicit $x10, implicit $x11
561 ; CHECK-I-LABEL: name: udiv_i128
562 ; CHECK-I: %lo1:_(s64) = COPY $x10
563 ; CHECK-I-NEXT: %hi1:_(s64) = COPY $x11
564 ; CHECK-I-NEXT: %lo2:_(s64) = COPY $x12
565 ; CHECK-I-NEXT: %hi2:_(s64) = COPY $x13
566 ; CHECK-I-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
567 ; CHECK-I-NEXT: $x10 = COPY %lo1(s64)
568 ; CHECK-I-NEXT: $x11 = COPY %hi1(s64)
569 ; CHECK-I-NEXT: $x12 = COPY %lo2(s64)
570 ; CHECK-I-NEXT: $x13 = COPY %hi2(s64)
571 ; CHECK-I-NEXT: PseudoCALL target-flags(riscv-call) &__udivti3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit $x12, implicit $x13, implicit-def $x10, implicit-def $x11
572 ; CHECK-I-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
573 ; CHECK-I-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
574 ; CHECK-I-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
575 ; CHECK-I-NEXT: $x10 = COPY [[COPY]](s64)
576 ; CHECK-I-NEXT: $x11 = COPY [[COPY1]](s64)
577 ; CHECK-I-NEXT: PseudoRET implicit $x10, implicit $x11
579 ; CHECK-M-LABEL: name: udiv_i128
580 ; CHECK-M: %lo1:_(s64) = COPY $x10
581 ; CHECK-M-NEXT: %hi1:_(s64) = COPY $x11
582 ; CHECK-M-NEXT: %lo2:_(s64) = COPY $x12
583 ; CHECK-M-NEXT: %hi2:_(s64) = COPY $x13
584 ; CHECK-M-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
585 ; CHECK-M-NEXT: $x10 = COPY %lo1(s64)
586 ; CHECK-M-NEXT: $x11 = COPY %hi1(s64)
587 ; CHECK-M-NEXT: $x12 = COPY %lo2(s64)
588 ; CHECK-M-NEXT: $x13 = COPY %hi2(s64)
589 ; CHECK-M-NEXT: PseudoCALL target-flags(riscv-call) &__udivti3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit $x12, implicit $x13, implicit-def $x10, implicit-def $x11
590 ; CHECK-M-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
591 ; CHECK-M-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
592 ; CHECK-M-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
593 ; CHECK-M-NEXT: $x10 = COPY [[COPY]](s64)
594 ; CHECK-M-NEXT: $x11 = COPY [[COPY1]](s64)
595 ; CHECK-M-NEXT: PseudoRET implicit $x10, implicit $x11
596 %lo1:_(s64) = COPY $x10
597 %hi1:_(s64) = COPY $x11
598 %lo2:_(s64) = COPY $x12
599 %hi2:_(s64) = COPY $x13
600 %x1:_(s128) = G_MERGE_VALUES %lo1(s64), %hi1(s64)
601 %x2:_(s128) = G_MERGE_VALUES %lo2(s64), %hi2(s64)
602 %y:_(s128) = G_UDIV %x1, %x2
603 %loy:_(s64), %hiy:_(s64) = G_UNMERGE_VALUES %y(s128)
604 $x10 = COPY %loy(s64)
605 $x11 = COPY %hiy(s64)
606 PseudoRET implicit $x10, implicit $x11
615 ; CHECK-I-LABEL: name: udivrem_i64
616 ; CHECK-I: liveins: $x10, $x11
617 ; CHECK-I-NEXT: {{ $}}
618 ; CHECK-I-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
619 ; CHECK-I-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
620 ; CHECK-I-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
621 ; CHECK-I-NEXT: $x10 = COPY [[COPY]](s64)
622 ; CHECK-I-NEXT: $x11 = COPY [[COPY1]](s64)
623 ; CHECK-I-NEXT: PseudoCALL target-flags(riscv-call) &__udivdi3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10
624 ; CHECK-I-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
625 ; CHECK-I-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x10
626 ; CHECK-I-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
627 ; CHECK-I-NEXT: $x10 = COPY [[COPY]](s64)
628 ; CHECK-I-NEXT: $x11 = COPY [[COPY1]](s64)
629 ; CHECK-I-NEXT: PseudoCALL target-flags(riscv-call) &__umoddi3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10
630 ; CHECK-I-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
631 ; CHECK-I-NEXT: [[COPY3:%[0-9]+]]:_(s64) = COPY $x10
632 ; CHECK-I-NEXT: [[ADD:%[0-9]+]]:_(s64) = G_ADD [[COPY2]], [[COPY3]]
633 ; CHECK-I-NEXT: $x10 = COPY [[ADD]](s64)
634 ; CHECK-I-NEXT: PseudoRET implicit $x10
636 ; CHECK-M-LABEL: name: udivrem_i64
637 ; CHECK-M: liveins: $x10, $x11
638 ; CHECK-M-NEXT: {{ $}}
639 ; CHECK-M-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
640 ; CHECK-M-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
641 ; CHECK-M-NEXT: [[UDIV:%[0-9]+]]:_(s64) = G_UDIV [[COPY]], [[COPY1]]
642 ; CHECK-M-NEXT: [[UREM:%[0-9]+]]:_(s64) = G_UREM [[COPY]], [[COPY1]]
643 ; CHECK-M-NEXT: [[ADD:%[0-9]+]]:_(s64) = G_ADD [[UDIV]], [[UREM]]
644 ; CHECK-M-NEXT: $x10 = COPY [[ADD]](s64)
645 ; CHECK-M-NEXT: PseudoRET implicit $x10
646 %0:_(s64) = COPY $x10
647 %1:_(s64) = COPY $x11
648 %2:_(s64), %3:_(s64) = G_UDIVREM %0, %1
649 %4:_(s64) = G_ADD %2, %3
651 PseudoRET implicit $x10
660 ; CHECK-I-LABEL: name: sdivrem_i64
661 ; CHECK-I: liveins: $x10, $x11
662 ; CHECK-I-NEXT: {{ $}}
663 ; CHECK-I-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
664 ; CHECK-I-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
665 ; CHECK-I-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
666 ; CHECK-I-NEXT: $x10 = COPY [[COPY]](s64)
667 ; CHECK-I-NEXT: $x11 = COPY [[COPY1]](s64)
668 ; CHECK-I-NEXT: PseudoCALL target-flags(riscv-call) &__divdi3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10
669 ; CHECK-I-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
670 ; CHECK-I-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x10
671 ; CHECK-I-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
672 ; CHECK-I-NEXT: $x10 = COPY [[COPY]](s64)
673 ; CHECK-I-NEXT: $x11 = COPY [[COPY1]](s64)
674 ; CHECK-I-NEXT: PseudoCALL target-flags(riscv-call) &__moddi3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10
675 ; CHECK-I-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
676 ; CHECK-I-NEXT: [[COPY3:%[0-9]+]]:_(s64) = COPY $x10
677 ; CHECK-I-NEXT: [[ADD:%[0-9]+]]:_(s64) = G_ADD [[COPY2]], [[COPY3]]
678 ; CHECK-I-NEXT: $x10 = COPY [[ADD]](s64)
679 ; CHECK-I-NEXT: PseudoRET implicit $x10
681 ; CHECK-M-LABEL: name: sdivrem_i64
682 ; CHECK-M: liveins: $x10, $x11
683 ; CHECK-M-NEXT: {{ $}}
684 ; CHECK-M-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
685 ; CHECK-M-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
686 ; CHECK-M-NEXT: [[SDIV:%[0-9]+]]:_(s64) = G_SDIV [[COPY]], [[COPY1]]
687 ; CHECK-M-NEXT: [[SREM:%[0-9]+]]:_(s64) = G_SREM [[COPY]], [[COPY1]]
688 ; CHECK-M-NEXT: [[ADD:%[0-9]+]]:_(s64) = G_ADD [[SDIV]], [[SREM]]
689 ; CHECK-M-NEXT: $x10 = COPY [[ADD]](s64)
690 ; CHECK-M-NEXT: PseudoRET implicit $x10
691 %0:_(s64) = COPY $x10
692 %1:_(s64) = COPY $x11
693 %2:_(s64), %3:_(s64) = G_SDIVREM %0, %1
694 %4:_(s64) = G_ADD %2, %3
696 PseudoRET implicit $x10