R600/SI: Custom lower SI_IF and SI_ELSE to avoid machine verifier errors
[oota-llvm.git] / test / CodeGen / R600 / uaddo.ll
1 ; RUN: llc -march=r600 -mcpu=SI -verify-machineinstrs< %s | FileCheck -check-prefix=SI %s
2
3 declare { i64, i1 } @llvm.uadd.with.overflow.i64(i64, i64) nounwind readnone
4
5 ; SI-LABEL: @uaddo_i64_zext
6 ; SI: ADD
7 ; SI: ADDC
8 ; SI: ADDC
9 define void @uaddo_i64_zext(i64 addrspace(1)* %out, i64 %a, i64 %b) nounwind {
10   %uadd = call { i64, i1 } @llvm.uadd.with.overflow.i64(i64 %a, i64 %b) nounwind
11   %val = extractvalue { i64, i1 } %uadd, 0
12   %carry = extractvalue { i64, i1 } %uadd, 1
13   %ext = zext i1 %carry to i64
14   %add2 = add i64 %val, %ext
15   store i64 %add2, i64 addrspace(1)* %out, align 8
16   ret void
17 }