• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s
2
3@ok = internal constant [4 x i8] c"%d\0A\00"
4@no = internal constant [4 x i8] c"no\0A\00"
5
6
7
8define i1 @func2(i128 zeroext %v1, i128 zeroext %v2) nounwind {
9entry:
10  %t = call {i128, i1} @llvm.uadd.with.overflow.i128(i128 %v1, i128 %v2)
11  %sum = extractvalue {i128, i1} %t, 0
12  %sum32 = trunc i128 %sum to i32
13  %obit = extractvalue {i128, i1} %t, 1
14  br i1 %obit, label %carry, label %normal
15
16normal:
17  %t1 = tail call i32 (i8*, ...)* @printf( i8* getelementptr ([4 x i8]* @ok, i32 0, i32 0), i32 %sum32 ) nounwind
18  ret i1 true
19
20carry:
21  %t2 = tail call i32 (i8*, ...)* @printf( i8* getelementptr ([4 x i8]* @no, i32 0, i32 0) ) nounwind
22  ret i1 false
23}
24
25declare i32 @printf(i8*, ...) nounwind
26declare {i96, i1} @llvm.sadd.with.overflow.i96(i96, i96)
27declare {i128, i1} @llvm.uadd.with.overflow.i128(i128, i128)
28
29define i1 @func1(i96 signext %v1, i96 signext %v2) nounwind {
30entry:
31  %t = call {i96, i1} @llvm.sadd.with.overflow.i96(i96 %v1, i96 %v2)
32  %obit = extractvalue {i96, i1} %t, 1
33  ret i1 %obit
34}
35