1 ; RUN: llc -mtriple=x86_64-darwin-unknown < %s | FileCheck %s --check-prefix=CHECK --check-prefix=SDAG
2 ; RUN: llc -mtriple=x86_64-darwin-unknown -fast-isel -fast-isel-abort=1 < %s | FileCheck %s --check-prefix=CHECK --check-prefix=FAST
5 ; Get the actual value of the overflow bit.
8 define zeroext i1 @saddo.i8(i8 signext %v1, i8 signext %v2, i8* %res) {
10 ; CHECK-LABEL: saddo.i8
11 ; CHECK: addb %sil, %dil
12 ; CHECK-NEXT: seto %al
13 %t = call {i8, i1} @llvm.sadd.with.overflow.i8(i8 %v1, i8 %v2)
14 %val = extractvalue {i8, i1} %t, 0
15 %obit = extractvalue {i8, i1} %t, 1
16 store i8 %val, i8* %res
20 define zeroext i1 @saddo.i16(i16 %v1, i16 %v2, i16* %res) {
22 ; CHECK-LABEL: saddo.i16
23 ; CHECK: addw %si, %di
24 ; CHECK-NEXT: seto %al
25 %t = call {i16, i1} @llvm.sadd.with.overflow.i16(i16 %v1, i16 %v2)
26 %val = extractvalue {i16, i1} %t, 0
27 %obit = extractvalue {i16, i1} %t, 1
28 store i16 %val, i16* %res
32 define zeroext i1 @saddo.i32(i32 %v1, i32 %v2, i32* %res) {
34 ; CHECK-LABEL: saddo.i32
35 ; CHECK: addl %esi, %edi
36 ; CHECK-NEXT: seto %al
37 %t = call {i32, i1} @llvm.sadd.with.overflow.i32(i32 %v1, i32 %v2)
38 %val = extractvalue {i32, i1} %t, 0
39 %obit = extractvalue {i32, i1} %t, 1
40 store i32 %val, i32* %res
44 define zeroext i1 @saddo.i64(i64 %v1, i64 %v2, i64* %res) {
46 ; CHECK-LABEL: saddo.i64
47 ; CHECK: addq %rsi, %rdi
48 ; CHECK-NEXT: seto %al
49 %t = call {i64, i1} @llvm.sadd.with.overflow.i64(i64 %v1, i64 %v2)
50 %val = extractvalue {i64, i1} %t, 0
51 %obit = extractvalue {i64, i1} %t, 1
52 store i64 %val, i64* %res
57 define zeroext i1 @saddo.inc.i8(i8 %v1, i8* %res) {
59 ; CHECK-LABEL: saddo.inc.i8
61 ; CHECK-NEXT: seto %al
62 %t = call {i8, i1} @llvm.sadd.with.overflow.i8(i8 %v1, i8 1)
63 %val = extractvalue {i8, i1} %t, 0
64 %obit = extractvalue {i8, i1} %t, 1
65 store i8 %val, i8* %res
69 define zeroext i1 @saddo.inc.i16(i16 %v1, i16* %res) {
71 ; CHECK-LABEL: saddo.inc.i16
73 ; CHECK-NEXT: seto %al
74 %t = call {i16, i1} @llvm.sadd.with.overflow.i16(i16 %v1, i16 1)
75 %val = extractvalue {i16, i1} %t, 0
76 %obit = extractvalue {i16, i1} %t, 1
77 store i16 %val, i16* %res
81 define zeroext i1 @saddo.inc.i32(i32 %v1, i32* %res) {
83 ; CHECK-LABEL: saddo.inc.i32
85 ; CHECK-NEXT: seto %al
86 %t = call {i32, i1} @llvm.sadd.with.overflow.i32(i32 %v1, i32 1)
87 %val = extractvalue {i32, i1} %t, 0
88 %obit = extractvalue {i32, i1} %t, 1
89 store i32 %val, i32* %res
93 define zeroext i1 @saddo.inc.i64(i64 %v1, i64* %res) {
95 ; CHECK-LABEL: saddo.inc.i64
97 ; CHECK-NEXT: seto %al
98 %t = call {i64, i1} @llvm.sadd.with.overflow.i64(i64 %v1, i64 1)
99 %val = extractvalue {i64, i1} %t, 0
100 %obit = extractvalue {i64, i1} %t, 1
101 store i64 %val, i64* %res
105 ; SADDO reg, imm | imm, reg
106 ; FIXME: DAG doesn't optimize immediates on the LHS.
107 define zeroext i1 @saddo.i64imm1(i64 %v1, i64* %res) {
109 ; SDAG-LABEL: saddo.i64imm1
113 ; FAST-LABEL: saddo.i64imm1
114 ; FAST: addq $2, %rdi
115 ; FAST-NEXT: seto %al
116 %t = call {i64, i1} @llvm.sadd.with.overflow.i64(i64 2, i64 %v1)
117 %val = extractvalue {i64, i1} %t, 0
118 %obit = extractvalue {i64, i1} %t, 1
119 store i64 %val, i64* %res
123 ; Check boundary conditions for large immediates.
124 define zeroext i1 @saddo.i64imm2(i64 %v1, i64* %res) {
126 ; CHECK-LABEL: saddo.i64imm2
127 ; CHECK: addq $-2147483648, %rdi
128 ; CHECK-NEXT: seto %al
129 %t = call {i64, i1} @llvm.sadd.with.overflow.i64(i64 %v1, i64 -2147483648)
130 %val = extractvalue {i64, i1} %t, 0
131 %obit = extractvalue {i64, i1} %t, 1
132 store i64 %val, i64* %res
136 define zeroext i1 @saddo.i64imm3(i64 %v1, i64* %res) {
138 ; CHECK-LABEL: saddo.i64imm3
139 ; CHECK: movabsq $-21474836489, %[[REG:[a-z]+]]
140 ; CHECK-NEXT: addq %rdi, %[[REG]]
142 %t = call {i64, i1} @llvm.sadd.with.overflow.i64(i64 %v1, i64 -21474836489)
143 %val = extractvalue {i64, i1} %t, 0
144 %obit = extractvalue {i64, i1} %t, 1
145 store i64 %val, i64* %res
149 define zeroext i1 @saddo.i64imm4(i64 %v1, i64* %res) {
151 ; CHECK-LABEL: saddo.i64imm4
152 ; CHECK: addq $2147483647, %rdi
154 %t = call {i64, i1} @llvm.sadd.with.overflow.i64(i64 %v1, i64 2147483647)
155 %val = extractvalue {i64, i1} %t, 0
156 %obit = extractvalue {i64, i1} %t, 1
157 store i64 %val, i64* %res
161 define zeroext i1 @saddo.i64imm5(i64 %v1, i64* %res) {
163 ; CHECK-LABEL: saddo.i64imm5
164 ; CHECK: movl $2147483648
167 %t = call {i64, i1} @llvm.sadd.with.overflow.i64(i64 %v1, i64 2147483648)
168 %val = extractvalue {i64, i1} %t, 0
169 %obit = extractvalue {i64, i1} %t, 1
170 store i64 %val, i64* %res
175 define zeroext i1 @uaddo.i32(i32 %v1, i32 %v2, i32* %res) {
177 ; CHECK-LABEL: uaddo.i32
178 ; CHECK: addl %esi, %edi
179 ; CHECK-NEXT: setb %al
180 %t = call {i32, i1} @llvm.uadd.with.overflow.i32(i32 %v1, i32 %v2)
181 %val = extractvalue {i32, i1} %t, 0
182 %obit = extractvalue {i32, i1} %t, 1
183 store i32 %val, i32* %res
187 define zeroext i1 @uaddo.i64(i64 %v1, i64 %v2, i64* %res) {
189 ; CHECK-LABEL: uaddo.i64
190 ; CHECK: addq %rsi, %rdi
191 ; CHECK-NEXT: setb %al
192 %t = call {i64, i1} @llvm.uadd.with.overflow.i64(i64 %v1, i64 %v2)
193 %val = extractvalue {i64, i1} %t, 0
194 %obit = extractvalue {i64, i1} %t, 1
195 store i64 %val, i64* %res
199 ; UADDO reg, 1 | NOT INC
200 define zeroext i1 @uaddo.inc.i8(i8 %v1, i8* %res) {
202 ; CHECK-LABEL: uaddo.inc.i8
203 ; CHECK-NOT: incb %dil
204 %t = call {i8, i1} @llvm.uadd.with.overflow.i8(i8 %v1, i8 1)
205 %val = extractvalue {i8, i1} %t, 0
206 %obit = extractvalue {i8, i1} %t, 1
207 store i8 %val, i8* %res
211 define zeroext i1 @uaddo.inc.i16(i16 %v1, i16* %res) {
213 ; CHECK-LABEL: uaddo.inc.i16
214 ; CHECK-NOT: incw %di
215 %t = call {i16, i1} @llvm.uadd.with.overflow.i16(i16 %v1, i16 1)
216 %val = extractvalue {i16, i1} %t, 0
217 %obit = extractvalue {i16, i1} %t, 1
218 store i16 %val, i16* %res
222 define zeroext i1 @uaddo.inc.i32(i32 %v1, i32* %res) {
224 ; CHECK-LABEL: uaddo.inc.i32
225 ; CHECK-NOT: incl %edi
226 %t = call {i32, i1} @llvm.uadd.with.overflow.i32(i32 %v1, i32 1)
227 %val = extractvalue {i32, i1} %t, 0
228 %obit = extractvalue {i32, i1} %t, 1
229 store i32 %val, i32* %res
233 define zeroext i1 @uaddo.inc.i64(i64 %v1, i64* %res) {
235 ; CHECK-LABEL: uaddo.inc.i64
236 ; CHECK-NOT: incq %rdi
237 %t = call {i64, i1} @llvm.uadd.with.overflow.i64(i64 %v1, i64 1)
238 %val = extractvalue {i64, i1} %t, 0
239 %obit = extractvalue {i64, i1} %t, 1
240 store i64 %val, i64* %res
245 define zeroext i1 @ssubo.i32(i32 %v1, i32 %v2, i32* %res) {
247 ; CHECK-LABEL: ssubo.i32
248 ; CHECK: subl %esi, %edi
249 ; CHECK-NEXT: seto %al
250 %t = call {i32, i1} @llvm.ssub.with.overflow.i32(i32 %v1, i32 %v2)
251 %val = extractvalue {i32, i1} %t, 0
252 %obit = extractvalue {i32, i1} %t, 1
253 store i32 %val, i32* %res
257 define zeroext i1 @ssubo.i64(i64 %v1, i64 %v2, i64* %res) {
259 ; CHECK-LABEL: ssubo.i64
260 ; CHECK: subq %rsi, %rdi
261 ; CHECK-NEXT: seto %al
262 %t = call {i64, i1} @llvm.ssub.with.overflow.i64(i64 %v1, i64 %v2)
263 %val = extractvalue {i64, i1} %t, 0
264 %obit = extractvalue {i64, i1} %t, 1
265 store i64 %val, i64* %res
270 define zeroext i1 @usubo.i32(i32 %v1, i32 %v2, i32* %res) {
272 ; CHECK-LABEL: usubo.i32
273 ; CHECK: subl %esi, %edi
274 ; CHECK-NEXT: setb %al
275 %t = call {i32, i1} @llvm.usub.with.overflow.i32(i32 %v1, i32 %v2)
276 %val = extractvalue {i32, i1} %t, 0
277 %obit = extractvalue {i32, i1} %t, 1
278 store i32 %val, i32* %res
282 define zeroext i1 @usubo.i64(i64 %v1, i64 %v2, i64* %res) {
284 ; CHECK-LABEL: usubo.i64
285 ; CHECK: subq %rsi, %rdi
286 ; CHECK-NEXT: setb %al
287 %t = call {i64, i1} @llvm.usub.with.overflow.i64(i64 %v1, i64 %v2)
288 %val = extractvalue {i64, i1} %t, 0
289 %obit = extractvalue {i64, i1} %t, 1
290 store i64 %val, i64* %res
295 define zeroext i1 @smulo.i8(i8 %v1, i8 %v2, i8* %res) {
297 ; CHECK-LABEL: smulo.i8
298 ; CHECK: movb %dil, %al
299 ; CHECK-NEXT: imulb %sil
300 ; CHECK-NEXT: seto %cl
301 %t = call {i8, i1} @llvm.smul.with.overflow.i8(i8 %v1, i8 %v2)
302 %val = extractvalue {i8, i1} %t, 0
303 %obit = extractvalue {i8, i1} %t, 1
304 store i8 %val, i8* %res
308 define zeroext i1 @smulo.i16(i16 %v1, i16 %v2, i16* %res) {
310 ; CHECK-LABEL: smulo.i16
311 ; CHECK: imulw %si, %di
312 ; CHECK-NEXT: seto %al
313 %t = call {i16, i1} @llvm.smul.with.overflow.i16(i16 %v1, i16 %v2)
314 %val = extractvalue {i16, i1} %t, 0
315 %obit = extractvalue {i16, i1} %t, 1
316 store i16 %val, i16* %res
320 define zeroext i1 @smulo.i32(i32 %v1, i32 %v2, i32* %res) {
322 ; CHECK-LABEL: smulo.i32
323 ; CHECK: imull %esi, %edi
324 ; CHECK-NEXT: seto %al
325 %t = call {i32, i1} @llvm.smul.with.overflow.i32(i32 %v1, i32 %v2)
326 %val = extractvalue {i32, i1} %t, 0
327 %obit = extractvalue {i32, i1} %t, 1
328 store i32 %val, i32* %res
332 define zeroext i1 @smulo.i64(i64 %v1, i64 %v2, i64* %res) {
334 ; CHECK-LABEL: smulo.i64
335 ; CHECK: imulq %rsi, %rdi
336 ; CHECK-NEXT: seto %al
337 %t = call {i64, i1} @llvm.smul.with.overflow.i64(i64 %v1, i64 %v2)
338 %val = extractvalue {i64, i1} %t, 0
339 %obit = extractvalue {i64, i1} %t, 1
340 store i64 %val, i64* %res
345 define zeroext i1 @umulo.i8(i8 %v1, i8 %v2, i8* %res) {
347 ; CHECK-LABEL: umulo.i8
348 ; CHECK: movb %dil, %al
349 ; CHECK-NEXT: mulb %sil
350 ; CHECK-NEXT: seto %cl
351 %t = call {i8, i1} @llvm.umul.with.overflow.i8(i8 %v1, i8 %v2)
352 %val = extractvalue {i8, i1} %t, 0
353 %obit = extractvalue {i8, i1} %t, 1
354 store i8 %val, i8* %res
358 define zeroext i1 @umulo.i16(i16 %v1, i16 %v2, i16* %res) {
360 ; CHECK-LABEL: umulo.i16
363 %t = call {i16, i1} @llvm.umul.with.overflow.i16(i16 %v1, i16 %v2)
364 %val = extractvalue {i16, i1} %t, 0
365 %obit = extractvalue {i16, i1} %t, 1
366 store i16 %val, i16* %res
370 define zeroext i1 @umulo.i32(i32 %v1, i32 %v2, i32* %res) {
372 ; CHECK-LABEL: umulo.i32
375 %t = call {i32, i1} @llvm.umul.with.overflow.i32(i32 %v1, i32 %v2)
376 %val = extractvalue {i32, i1} %t, 0
377 %obit = extractvalue {i32, i1} %t, 1
378 store i32 %val, i32* %res
382 define zeroext i1 @umulo.i64(i64 %v1, i64 %v2, i64* %res) {
384 ; CHECK-LABEL: umulo.i64
387 %t = call {i64, i1} @llvm.umul.with.overflow.i64(i64 %v1, i64 %v2)
388 %val = extractvalue {i64, i1} %t, 0
389 %obit = extractvalue {i64, i1} %t, 1
390 store i64 %val, i64* %res
395 ; Check the use of the overflow bit in combination with a select instruction.
397 define i32 @saddo.select.i32(i32 %v1, i32 %v2) {
399 ; CHECK-LABEL: saddo.select.i32
400 ; CHECK: addl %esi, %eax
401 ; CHECK-NEXT: cmovol %edi, %esi
402 %t = call {i32, i1} @llvm.sadd.with.overflow.i32(i32 %v1, i32 %v2)
403 %obit = extractvalue {i32, i1} %t, 1
404 %ret = select i1 %obit, i32 %v1, i32 %v2
408 define i64 @saddo.select.i64(i64 %v1, i64 %v2) {
410 ; CHECK-LABEL: saddo.select.i64
411 ; CHECK: addq %rsi, %rax
412 ; CHECK-NEXT: cmovoq %rdi, %rsi
413 %t = call {i64, i1} @llvm.sadd.with.overflow.i64(i64 %v1, i64 %v2)
414 %obit = extractvalue {i64, i1} %t, 1
415 %ret = select i1 %obit, i64 %v1, i64 %v2
419 define i32 @uaddo.select.i32(i32 %v1, i32 %v2) {
421 ; CHECK-LABEL: uaddo.select.i32
422 ; CHECK: addl %esi, %eax
423 ; CHECK-NEXT: cmovbl %edi, %esi
424 %t = call {i32, i1} @llvm.uadd.with.overflow.i32(i32 %v1, i32 %v2)
425 %obit = extractvalue {i32, i1} %t, 1
426 %ret = select i1 %obit, i32 %v1, i32 %v2
430 define i64 @uaddo.select.i64(i64 %v1, i64 %v2) {
432 ; CHECK-LABEL: uaddo.select.i64
433 ; CHECK: addq %rsi, %rax
434 ; CHECK-NEXT: cmovbq %rdi, %rsi
435 %t = call {i64, i1} @llvm.uadd.with.overflow.i64(i64 %v1, i64 %v2)
436 %obit = extractvalue {i64, i1} %t, 1
437 %ret = select i1 %obit, i64 %v1, i64 %v2
441 define i32 @ssubo.select.i32(i32 %v1, i32 %v2) {
443 ; CHECK-LABEL: ssubo.select.i32
444 ; CHECK: cmpl %esi, %edi
445 ; CHECK-NEXT: cmovol %edi, %esi
446 %t = call {i32, i1} @llvm.ssub.with.overflow.i32(i32 %v1, i32 %v2)
447 %obit = extractvalue {i32, i1} %t, 1
448 %ret = select i1 %obit, i32 %v1, i32 %v2
452 define i64 @ssubo.select.i64(i64 %v1, i64 %v2) {
454 ; CHECK-LABEL: ssubo.select.i64
455 ; CHECK: cmpq %rsi, %rdi
456 ; CHECK-NEXT: cmovoq %rdi, %rsi
457 %t = call {i64, i1} @llvm.ssub.with.overflow.i64(i64 %v1, i64 %v2)
458 %obit = extractvalue {i64, i1} %t, 1
459 %ret = select i1 %obit, i64 %v1, i64 %v2
463 define i32 @usubo.select.i32(i32 %v1, i32 %v2) {
465 ; CHECK-LABEL: usubo.select.i32
466 ; CHECK: cmpl %esi, %edi
467 ; CHECK-NEXT: cmovbl %edi, %esi
468 %t = call {i32, i1} @llvm.usub.with.overflow.i32(i32 %v1, i32 %v2)
469 %obit = extractvalue {i32, i1} %t, 1
470 %ret = select i1 %obit, i32 %v1, i32 %v2
474 define i64 @usubo.select.i64(i64 %v1, i64 %v2) {
476 ; CHECK-LABEL: usubo.select.i64
477 ; CHECK: cmpq %rsi, %rdi
478 ; CHECK-NEXT: cmovbq %rdi, %rsi
479 %t = call {i64, i1} @llvm.usub.with.overflow.i64(i64 %v1, i64 %v2)
480 %obit = extractvalue {i64, i1} %t, 1
481 %ret = select i1 %obit, i64 %v1, i64 %v2
485 define i32 @smulo.select.i32(i32 %v1, i32 %v2) {
487 ; CHECK-LABEL: smulo.select.i32
488 ; CHECK: imull %esi, %eax
489 ; CHECK-NEXT: cmovol %edi, %esi
490 %t = call {i32, i1} @llvm.smul.with.overflow.i32(i32 %v1, i32 %v2)
491 %obit = extractvalue {i32, i1} %t, 1
492 %ret = select i1 %obit, i32 %v1, i32 %v2
496 define i64 @smulo.select.i64(i64 %v1, i64 %v2) {
498 ; CHECK-LABEL: smulo.select.i64
499 ; CHECK: imulq %rsi, %rax
500 ; CHECK-NEXT: cmovoq %rdi, %rsi
501 %t = call {i64, i1} @llvm.smul.with.overflow.i64(i64 %v1, i64 %v2)
502 %obit = extractvalue {i64, i1} %t, 1
503 %ret = select i1 %obit, i64 %v1, i64 %v2
507 define i32 @umulo.select.i32(i32 %v1, i32 %v2) {
509 ; CHECK-LABEL: umulo.select.i32
511 ; CHECK-NEXT: cmovol %edi, %esi
512 %t = call {i32, i1} @llvm.umul.with.overflow.i32(i32 %v1, i32 %v2)
513 %obit = extractvalue {i32, i1} %t, 1
514 %ret = select i1 %obit, i32 %v1, i32 %v2
518 define i64 @umulo.select.i64(i64 %v1, i64 %v2) {
520 ; CHECK-LABEL: umulo.select.i64
522 ; CHECK-NEXT: cmovoq %rdi, %rsi
523 %t = call {i64, i1} @llvm.umul.with.overflow.i64(i64 %v1, i64 %v2)
524 %obit = extractvalue {i64, i1} %t, 1
525 %ret = select i1 %obit, i64 %v1, i64 %v2
531 ; Check the use of the overflow bit in combination with a branch instruction.
533 define zeroext i1 @saddo.br.i32(i32 %v1, i32 %v2) {
535 ; CHECK-LABEL: saddo.br.i32
536 ; CHECK: addl %esi, %edi
538 %t = call {i32, i1} @llvm.sadd.with.overflow.i32(i32 %v1, i32 %v2)
539 %val = extractvalue {i32, i1} %t, 0
540 %obit = extractvalue {i32, i1} %t, 1
541 br i1 %obit, label %overflow, label %continue, !prof !0
550 define zeroext i1 @saddo.br.i64(i64 %v1, i64 %v2) {
552 ; CHECK-LABEL: saddo.br.i64
553 ; CHECK: addq %rsi, %rdi
555 %t = call {i64, i1} @llvm.sadd.with.overflow.i64(i64 %v1, i64 %v2)
556 %val = extractvalue {i64, i1} %t, 0
557 %obit = extractvalue {i64, i1} %t, 1
558 br i1 %obit, label %overflow, label %continue, !prof !0
567 define zeroext i1 @uaddo.br.i32(i32 %v1, i32 %v2) {
569 ; CHECK-LABEL: uaddo.br.i32
570 ; CHECK: addl %esi, %edi
572 %t = call {i32, i1} @llvm.uadd.with.overflow.i32(i32 %v1, i32 %v2)
573 %val = extractvalue {i32, i1} %t, 0
574 %obit = extractvalue {i32, i1} %t, 1
575 br i1 %obit, label %overflow, label %continue, !prof !0
584 define zeroext i1 @uaddo.br.i64(i64 %v1, i64 %v2) {
586 ; CHECK-LABEL: uaddo.br.i64
587 ; CHECK: addq %rsi, %rdi
589 %t = call {i64, i1} @llvm.uadd.with.overflow.i64(i64 %v1, i64 %v2)
590 %val = extractvalue {i64, i1} %t, 0
591 %obit = extractvalue {i64, i1} %t, 1
592 br i1 %obit, label %overflow, label %continue, !prof !0
601 define zeroext i1 @ssubo.br.i32(i32 %v1, i32 %v2) {
603 ; CHECK-LABEL: ssubo.br.i32
604 ; CHECK: cmpl %esi, %edi
606 %t = call {i32, i1} @llvm.ssub.with.overflow.i32(i32 %v1, i32 %v2)
607 %val = extractvalue {i32, i1} %t, 0
608 %obit = extractvalue {i32, i1} %t, 1
609 br i1 %obit, label %overflow, label %continue, !prof !0
618 define zeroext i1 @ssubo.br.i64(i64 %v1, i64 %v2) {
620 ; CHECK-LABEL: ssubo.br.i64
621 ; CHECK: cmpq %rsi, %rdi
623 %t = call {i64, i1} @llvm.ssub.with.overflow.i64(i64 %v1, i64 %v2)
624 %val = extractvalue {i64, i1} %t, 0
625 %obit = extractvalue {i64, i1} %t, 1
626 br i1 %obit, label %overflow, label %continue, !prof !0
635 define zeroext i1 @usubo.br.i32(i32 %v1, i32 %v2) {
637 ; CHECK-LABEL: usubo.br.i32
638 ; CHECK: cmpl %esi, %edi
640 %t = call {i32, i1} @llvm.usub.with.overflow.i32(i32 %v1, i32 %v2)
641 %val = extractvalue {i32, i1} %t, 0
642 %obit = extractvalue {i32, i1} %t, 1
643 br i1 %obit, label %overflow, label %continue, !prof !0
652 define zeroext i1 @usubo.br.i64(i64 %v1, i64 %v2) {
654 ; CHECK-LABEL: usubo.br.i64
655 ; CHECK: cmpq %rsi, %rdi
657 %t = call {i64, i1} @llvm.usub.with.overflow.i64(i64 %v1, i64 %v2)
658 %val = extractvalue {i64, i1} %t, 0
659 %obit = extractvalue {i64, i1} %t, 1
660 br i1 %obit, label %overflow, label %continue, !prof !0
669 define zeroext i1 @smulo.br.i32(i32 %v1, i32 %v2) {
671 ; CHECK-LABEL: smulo.br.i32
672 ; CHECK: imull %esi, %edi
674 %t = call {i32, i1} @llvm.smul.with.overflow.i32(i32 %v1, i32 %v2)
675 %val = extractvalue {i32, i1} %t, 0
676 %obit = extractvalue {i32, i1} %t, 1
677 br i1 %obit, label %overflow, label %continue, !prof !0
686 define zeroext i1 @smulo.br.i64(i64 %v1, i64 %v2) {
688 ; CHECK-LABEL: smulo.br.i64
689 ; CHECK: imulq %rsi, %rdi
691 %t = call {i64, i1} @llvm.smul.with.overflow.i64(i64 %v1, i64 %v2)
692 %val = extractvalue {i64, i1} %t, 0
693 %obit = extractvalue {i64, i1} %t, 1
694 br i1 %obit, label %overflow, label %continue, !prof !0
703 define zeroext i1 @umulo.br.i32(i32 %v1, i32 %v2) {
705 ; CHECK-LABEL: umulo.br.i32
708 %t = call {i32, i1} @llvm.umul.with.overflow.i32(i32 %v1, i32 %v2)
709 %val = extractvalue {i32, i1} %t, 0
710 %obit = extractvalue {i32, i1} %t, 1
711 br i1 %obit, label %overflow, label %continue, !prof !0
720 define zeroext i1 @umulo.br.i64(i64 %v1, i64 %v2) {
722 ; CHECK-LABEL: umulo.br.i64
725 %t = call {i64, i1} @llvm.umul.with.overflow.i64(i64 %v1, i64 %v2)
726 %val = extractvalue {i64, i1} %t, 0
727 %obit = extractvalue {i64, i1} %t, 1
728 br i1 %obit, label %overflow, label %continue, !prof !0
737 declare {i8, i1} @llvm.sadd.with.overflow.i8 (i8, i8 ) nounwind readnone
738 declare {i16, i1} @llvm.sadd.with.overflow.i16(i16, i16) nounwind readnone
739 declare {i32, i1} @llvm.sadd.with.overflow.i32(i32, i32) nounwind readnone
740 declare {i64, i1} @llvm.sadd.with.overflow.i64(i64, i64) nounwind readnone
741 declare {i8, i1} @llvm.uadd.with.overflow.i8 (i8, i8 ) nounwind readnone
742 declare {i16, i1} @llvm.uadd.with.overflow.i16(i16, i16) nounwind readnone
743 declare {i32, i1} @llvm.uadd.with.overflow.i32(i32, i32) nounwind readnone
744 declare {i64, i1} @llvm.uadd.with.overflow.i64(i64, i64) nounwind readnone
745 declare {i32, i1} @llvm.ssub.with.overflow.i32(i32, i32) nounwind readnone
746 declare {i64, i1} @llvm.ssub.with.overflow.i64(i64, i64) nounwind readnone
747 declare {i32, i1} @llvm.usub.with.overflow.i32(i32, i32) nounwind readnone
748 declare {i64, i1} @llvm.usub.with.overflow.i64(i64, i64) nounwind readnone
749 declare {i8, i1} @llvm.smul.with.overflow.i8 (i8, i8 ) nounwind readnone
750 declare {i16, i1} @llvm.smul.with.overflow.i16(i16, i16) nounwind readnone
751 declare {i32, i1} @llvm.smul.with.overflow.i32(i32, i32) nounwind readnone
752 declare {i64, i1} @llvm.smul.with.overflow.i64(i64, i64) nounwind readnone
753 declare {i8, i1} @llvm.umul.with.overflow.i8 (i8, i8 ) nounwind readnone
754 declare {i16, i1} @llvm.umul.with.overflow.i16(i16, i16) nounwind readnone
755 declare {i32, i1} @llvm.umul.with.overflow.i32(i32, i32) nounwind readnone
756 declare {i64, i1} @llvm.umul.with.overflow.i64(i64, i64) nounwind readnone
758 !0 = !{!"branch_weights", i32 0, i32 2147483647}