1 ; RUN: opt < %s -predsimplify -instcombine -simplifycfg -S > %t
2 ; RUN: grep -v declare %t | not grep fail
3 ; RUN: grep -v declare %t | grep pass | count 3
5 define i32 @test1(i32 %x, i32 %y) {
7 %tmp2 = or i32 %x, %y ; <i32> [#uses=1]
8 %tmp = icmp eq i32 %tmp2, 0 ; <i1> [#uses=1]
9 br i1 %tmp, label %cond_true, label %return
10 cond_true: ; preds = %entry
11 %tmp4 = icmp eq i32 %x, 0 ; <i1> [#uses=1]
12 br i1 %tmp4, label %cond_true5, label %cond_false
13 cond_true5: ; preds = %cond_true
14 %tmp6 = call i32 @pass( ) ; <i32> [#uses=1]
16 cond_false: ; preds = %cond_true
17 %tmp8 = call i32 @fail( ) ; <i32> [#uses=1]
19 return: ; preds = %entry
23 define i32 @test2(i32 %x, i32 %y) {
25 %tmp2 = or i32 %x, %y ; <i32> [#uses=1]
26 %tmp = icmp ne i32 %tmp2, 0 ; <i1> [#uses=1]
27 br i1 %tmp, label %cond_true, label %return
28 cond_true: ; preds = %entry
29 %tmp4 = icmp eq i32 %x, 0 ; <i1> [#uses=1]
30 br i1 %tmp4, label %cond_true5, label %cond_false
31 cond_true5: ; preds = %cond_true
32 %tmp6 = call i32 @pass1( ) ; <i32> [#uses=1]
34 cond_false: ; preds = %cond_true
35 %tmp8 = call i32 @pass2( ) ; <i32> [#uses=1]
37 return: ; preds = %entry