Merge branch 'master' into msp430
[llvm/msp430.git] / test / Transforms / LoopSimplify / single-backedge.ll
blob8391048eed220f713861aa6659721a483a73e1bb
1 ; The loop canonicalization pass should guarantee that there is one backedge 
2 ; for all loops.  This allows the -indvars pass to recognize the %IV 
3 ; induction variable in this testcase.
5 ; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep indvar
7 define i32 @test(i1 %C) {
8 ; <label>:0
9         br label %Loop
10 Loop:           ; preds = %BE2, %BE1, %0
11         %IV = phi i32 [ 1, %0 ], [ %IV2, %BE1 ], [ %IV2, %BE2 ]         ; <i32> [#uses=2]
12         store i32 %IV, i32* null
13         %IV2 = add i32 %IV, 2           ; <i32> [#uses=2]
14         br i1 %C, label %BE1, label %BE2
15 BE1:            ; preds = %Loop
16         br label %Loop
17 BE2:            ; preds = %Loop
18         br label %Loop