1 ; RUN: llc < %s -mtriple=x86_64-linux | FileCheck %s
2 ; RUN: llc < %s -mtriple=x86_64-win32 | FileCheck %s
4 ; Reuse the flags value from the add instructions instead of emitting separate
7 ; Use the flags on the add.
15 define i32 @test1(i32* %x, i32 %y, i32 %a, i32 %b) nounwind {
16 %tmp2 = load i32, i32* %x, align 4 ; <i32> [#uses=1]
17 %tmp4 = add i32 %tmp2, %y ; <i32> [#uses=1]
18 %tmp5 = icmp slt i32 %tmp4, 0 ; <i1> [#uses=1]
19 %tmp.0 = select i1 %tmp5, i32 %a, i32 %b ; <i32> [#uses=1]
23 declare void @foo(i32)
25 ; Don't use the flags result of the and here, since the and has no
26 ; other use. A simple test is better.
29 ; CHECK: testb $16, {{%dil|%cl}}
31 define void @test2(i32 %x) nounwind {
33 %t = icmp eq i32 %y, 0
34 br i1 %t, label %true, label %false
36 call void @foo(i32 %x)
42 ; Do use the flags result of the and here, since the and has another use.
48 define void @test3(i32 %x) nounwind {
50 %t = icmp eq i32 %y, 0
51 br i1 %t, label %true, label %false
53 call void @foo(i32 %y)