Use the llvm-upgrade program to upgrade llvm assembly.
[oota-llvm.git] / test / Transforms / LoopUnswitch / basictest.ll
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -loop-unswitch -disable-output
2 implementation   ; Functions:
3
4 int %test(int* %A, bool %C) {
5 entry:
6         br label %no_exit
7
8 no_exit:                ; preds = %entry, %no_exit.backedge
9         %i.0.0 = phi uint [ 0, %entry ], [ %i.0.0.be, %no_exit.backedge ]               ; <uint> [#uses=3]
10         %tmp.7 = getelementptr int* %A, uint %i.0.0             ; <int*> [#uses=4]
11         %tmp.13 = load int* %tmp.7              ; <int> [#uses=1]
12         %tmp.14 = add int %tmp.13, 1            ; <int> [#uses=1]
13         store int %tmp.14, int* %tmp.7
14         br bool %C, label %then, label %endif
15
16 then:           ; preds = %no_exit
17         %tmp.29 = load int* %tmp.7              ; <int> [#uses=1]
18         %tmp.30 = add int %tmp.29, 2            ; <int> [#uses=1]
19         store int %tmp.30, int* %tmp.7
20         %inc9 = add uint %i.0.0, 1              ; <uint> [#uses=2]
21         %tmp.112 = setlt uint %inc9, 100000             ; <bool> [#uses=1]
22         br bool %tmp.112, label %no_exit.backedge, label %return
23
24 no_exit.backedge:               ; preds = %then, %endif
25         %i.0.0.be = phi uint [ %inc9, %then ], [ %inc, %endif ]         ; <uint> [#uses=1]
26         br label %no_exit
27
28 endif:          ; preds = %no_exit
29         %inc = add uint %i.0.0, 1               ; <uint> [#uses=2]
30         %tmp.1 = setlt uint %inc, 100000                ; <bool> [#uses=1]
31         br bool %tmp.1, label %no_exit.backedge, label %return
32
33 return:         ; preds = %then, %endif
34         ret int %tmp.13
35 }