Finally implement correct ordered comparisons for PPC, even though
[oota-llvm.git] / test / Transforms / SCCP / 2003-06-24-OverdefinedPHIValue.ll
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -sccp -simplifycfg | llvm-dis | \
2 ; RUN:   not grep then:
3
4 void %cprop_test11(int* %data.1) {
5 entry:          ; No predecessors!
6         %tmp.1 = load int* %data.1              ; <int> [#uses=3]
7         %tmp.41 = setgt int %tmp.1, 1           ; <bool> [#uses=1]
8         br bool %tmp.41, label %no_exit, label %loopexit
9
10 no_exit:                ; preds = %entry, %then, %endif
11         %j.0 = phi int [ %j.0, %endif ], [ %i.0, %then ], [ 1, %entry ]         ; <int> [#uses=3]
12         %i.0 = phi int [ %inc, %endif ], [ %inc1, %then ], [ 1, %entry ]                ; <int> [#uses=4]
13         %tmp.8.not = cast int %j.0 to bool              ; <bool> [#uses=1]
14         br bool %tmp.8.not, label %endif, label %then
15
16 then:           ; preds = %no_exit
17         %inc1 = add int %i.0, 1         ; <int> [#uses=3]
18         %tmp.42 = setlt int %inc1, %tmp.1               ; <bool> [#uses=1]
19         br bool %tmp.42, label %no_exit, label %loopexit
20
21 endif:          ; preds = %no_exit
22         %inc = add int %i.0, 1          ; <int> [#uses=3]
23         %tmp.4 = setlt int %inc, %tmp.1         ; <bool> [#uses=1]
24         br bool %tmp.4, label %no_exit, label %loopexit
25
26 loopexit:               ; preds = %entry, %endif, %then
27         %j.1 = phi int [ 1, %entry ], [ %j.0, %endif ], [ %i.0, %then ]         ; <int> [#uses=1]
28         %i.1 = phi int [ 1, %entry ], [ %inc, %endif ], [ %inc1, %then ]                ; <int> [#uses=1]
29         %tmp.17 = getelementptr int* %data.1, long 1            ; <int*> [#uses=1]
30         store int %j.1, int* %tmp.17
31         %tmp.23 = getelementptr int* %data.1, long 2            ; <int*> [#uses=1]
32         store int %i.1, int* %tmp.23
33         ret void
34 }