1 ; RUN: opt < %s -gvn -S | FileCheck %s
6 define i64 @test1(i64 %a, i64 %b) nounwind ssp {
8 %uadd = tail call %0 @llvm.uadd.with.overflow.i64(i64 %a, i64 %b)
9 %uadd.0 = extractvalue %0 %uadd, 0
10 %add1 = add i64 %a, %b
14 ; CHECK-LABEL: @test1(
18 define i64 @test2(i64 %a, i64 %b) nounwind ssp {
20 %usub = tail call %0 @llvm.usub.with.overflow.i64(i64 %a, i64 %b)
21 %usub.0 = extractvalue %0 %usub, 0
22 %sub1 = sub i64 %a, %b
26 ; CHECK-LABEL: @test2(
30 define i64 @test3(i64 %a, i64 %b) nounwind ssp {
32 %umul = tail call %0 @llvm.umul.with.overflow.i64(i64 %a, i64 %b)
33 %umul.0 = extractvalue %0 %umul, 0
34 %mul1 = mul i64 %a, %b
38 ; CHECK-LABEL: @test3(
42 define i64 @test4(i64 %a, i64 %b) nounwind ssp {
44 %sadd = tail call %0 @llvm.sadd.with.overflow.i64(i64 %a, i64 %b)
45 %sadd.0 = extractvalue %0 %sadd, 0
46 %add1 = add i64 %a, %b
50 ; CHECK-LABEL: @test4(
54 define i64 @test5(i64 %a, i64 %b) nounwind ssp {
56 %ssub = tail call %0 @llvm.ssub.with.overflow.i64(i64 %a, i64 %b)
57 %ssub.0 = extractvalue %0 %ssub, 0
58 %sub1 = sub i64 %a, %b
62 ; CHECK-LABEL: @test5(
66 define i64 @test6(i64 %a, i64 %b) nounwind ssp {
68 %smul = tail call %0 @llvm.smul.with.overflow.i64(i64 %a, i64 %b)
69 %smul.0 = extractvalue %0 %smul, 0
70 %mul1 = mul i64 %a, %b
74 ; CHECK-LABEL: @test6(
78 declare void @exit(i32) noreturn
79 declare %0 @llvm.uadd.with.overflow.i64(i64, i64) nounwind readnone
80 declare %0 @llvm.usub.with.overflow.i64(i64, i64) nounwind readnone
81 declare %0 @llvm.umul.with.overflow.i64(i64, i64) nounwind readnone
82 declare %0 @llvm.sadd.with.overflow.i64(i64, i64) nounwind readnone
83 declare %0 @llvm.ssub.with.overflow.i64(i64, i64) nounwind readnone
84 declare %0 @llvm.smul.with.overflow.i64(i64, i64) nounwind readnone