• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -mtriple=i686-unknown-linux-gnu | FileCheck %s
2
3declare {i32, i1} @llvm.umul.with.overflow.i32(i32 %a, i32 %b)
4define zeroext i1 @a(i32 %x)  nounwind {
5  %res = call {i32, i1} @llvm.umul.with.overflow.i32(i32 %x, i32 3)
6  %obil = extractvalue {i32, i1} %res, 1
7  ret i1 %obil
8
9; CHECK-LABEL: a:
10; CHECK: mull
11; CHECK: seto %al
12; CHECK: ret
13}
14
15define i32 @test2(i32 %a, i32 %b) nounwind readnone {
16entry:
17	%tmp0 = add i32 %b, %a
18	%tmp1 = call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %tmp0, i32 2)
19	%tmp2 = extractvalue { i32, i1 } %tmp1, 0
20	ret i32 %tmp2
21; CHECK-LABEL: test2:
22; CHECK: addl
23; CHECK-NEXT: addl
24; CHECK-NEXT: ret
25}
26
27define i32 @test3(i32 %a, i32 %b) nounwind readnone {
28entry:
29	%tmp0 = add i32 %b, %a
30	%tmp1 = call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %tmp0, i32 4)
31	%tmp2 = extractvalue { i32, i1 } %tmp1, 0
32	ret i32 %tmp2
33; CHECK-LABEL: test3:
34; CHECK: addl
35; CHECK: mull
36; CHECK-NEXT: ret
37}
38