llvm-6502/test/Transforms/InstCombine/intrinsics.ll
Chris Lattner 7e606e2e98 if a 'with overflow' intrinsic just has the normal result used, simplify
it to a normal binop.  Patch by Alastair Lynn, testcase by me.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86524 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 07:07:56 +00:00

13 lines
319 B
LLVM

; RUN: opt %s -instcombine -S | FileCheck %s
declare {i8, i1} @llvm.uadd.with.overflow.i8(i8, i8)
define i8 @test1(i8 %A, i8 %B) {
%x = call {i8, i1} @llvm.uadd.with.overflow.i8(i8 %A, i8 %B)
%y = extractvalue {i8, i1} %x, 0
ret i8 %y
; CHECK: @test1
; CHECK-NEXT: %y = add i8 %A, %B
; CHECK-NEXT: ret i8 %y
}