Handle overflow of 64-bit loop conditions.
[oota-llvm.git] / test / Transforms / CondProp / phisimplify3.ll
1 ; RUN: llvm-as < %s | opt -condprop | llvm-dis | not grep phi
2
3 define i32 @foo(i1, i32, i32) {
4 prologue:
5         br i1 %0, label %eq, label %ne
6
7 eq:             ; preds = %prologue
8         store i32 0, i32* inttoptr (i32 10000 to i32*)
9         %3 = icmp eq i32 %1, %2         ; <i1> [#uses=1]
10         br label %join
11
12 ne:             ; preds = %prologue
13         %4 = icmp ne i32 %1, %2         ; <i1> [#uses=1]
14         br label %join
15
16 join:           ; preds = %ne, %eq
17         %5 = phi i1 [ %3, %eq ], [ %4, %ne ]            ; <i1> [#uses=1]
18         br i1 %5, label %yes, label %no
19
20 yes:            ; preds = %join
21         store i32 0, i32* inttoptr (i32 20000 to i32*)
22         ret i32 5
23
24 no:             ; preds = %join
25         ret i32 20
26 }