1 ; RUN: opt < %s -correlated-propagation -S | FileCheck %s
5 define i32 @test1(i1 %C) nounwind {
6 br i1 %C, label %exit, label %body
10 %A = select i1 %C, i32 10, i32 11 ; <i32> [#uses=1]
24 %cond = tail call i1 @ext() ; <i1> [#uses=2]
25 br i1 %cond, label %bb1, label %bb2
28 %cond2 = tail call i1 @ext() ; <i1> [#uses=1]
29 br i1 %cond2, label %bb3, label %bb2
31 bb2: ; preds = %bb1, %entry
33 %cond_merge = phi i1 [ %cond, %entry ], [ false, %bb1 ] ; <i1> [#uses=1]
38 %res = tail call i1 @ext() ; <i1> [#uses=1]
44 @gv = internal constant i8 7
46 define i8 @test3(i8* %a) nounwind {
48 %cond = icmp eq i8* %a, @gv
49 br i1 %cond, label %bb2, label %bb
55 ; CHECK: %should_be_const = load i8* @gv
56 %should_be_const = load i8* %a
57 ret i8 %should_be_const
62 define i32 @test4(i32) {
64 ; CHECK: icmp sgt i32 %0, 2
65 %.demorgan = icmp sgt i32 %0, 2
66 br i1 %.demorgan, label %GreaterThanTwo, label %LessThanOrEqualToTwo
69 ; CHECK-NOT: icmp eq i32 %0, 2
72 br i1 %1, label %Impossible, label %NotTwoAndGreaterThanTwo
74 NotTwoAndGreaterThanTwo: