Devang Patel | 0b10e71 | 2008-11-03 19:38:07 +0000 | [diff] [blame^] | 1 | ; RUN: llvm-as < %s | opt -loop-unswitch -stats | not grep loop-unswitch |
| 2 | |
| 3 | |
| 4 | define void @test_fc_while_continue_or(float %x, float %y, float* %result) nounwind { |
| 5 | entry: |
| 6 | br label %bb2.outer |
| 7 | |
| 8 | bb: ; preds = %bb2 |
| 9 | %0 = add float %5, %z.0 ; <float> [#uses=3] |
| 10 | %1 = fcmp oeq float %0, 0.000000e+00 ; <i1> [#uses=1] |
| 11 | br i1 %1, label %bb2, label %bb1 |
| 12 | |
| 13 | bb1: ; preds = %bb |
| 14 | %.lcssa = phi float [ %0, %bb ] ; <float> [#uses=1] |
| 15 | %z.0.lcssa1 = phi float [ %z.0, %bb ] ; <float> [#uses=0] |
| 16 | %2 = add float %x_addr.0.ph, 1.000000e+00 ; <float> [#uses=1] |
| 17 | br label %bb2.outer |
| 18 | |
| 19 | bb2.outer: ; preds = %bb1, %entry |
| 20 | %z.0.ph = phi float [ 0.000000e+00, %entry ], [ %.lcssa, %bb1 ] ; <float> [#uses=1] |
| 21 | %x_addr.0.ph = phi float [ %x, %entry ], [ %2, %bb1 ] ; <float> [#uses=3] |
| 22 | %3 = fcmp une float %x_addr.0.ph, 0.000000e+00 ; <i1> [#uses=1] |
| 23 | %4 = fcmp une float %y, 0.000000e+00 ; <i1> [#uses=1] |
| 24 | %or.cond = or i1 %3, %4 ; <i1> [#uses=1] |
| 25 | %5 = mul float %x_addr.0.ph, %y ; <float> [#uses=1] |
| 26 | br label %bb2 |
| 27 | |
| 28 | bb2: ; preds = %bb2.outer, %bb |
| 29 | %z.0 = phi float [ %0, %bb ], [ %z.0.ph, %bb2.outer ] ; <float> [#uses=3] |
| 30 | br i1 %or.cond, label %bb, label %bb4 |
| 31 | |
| 32 | bb4: ; preds = %bb2 |
| 33 | %z.0.lcssa = phi float [ %z.0, %bb2 ] ; <float> [#uses=1] |
| 34 | store float %z.0.lcssa, float* %result, align 4 |
| 35 | ret void |
| 36 | } |
| 37 | |
| 38 | define i32 @main() nounwind { |
| 39 | entry: |
| 40 | %z = alloca [10 x i32] ; <[10 x i32]*> [#uses=2] |
| 41 | %0 = call i32 (...)* @test_fc_while_or(i32 0, i32 0, [10 x i32]* %z) nounwind ; <i32> [#uses=0] |
| 42 | %1 = getelementptr [10 x i32]* %z, i32 0, i32 0 ; <i32*> [#uses=1] |
| 43 | %2 = load i32* %1, align 4 ; <i32> [#uses=1] |
| 44 | ret i32 %2 |
| 45 | } |
| 46 | |
| 47 | declare i32 @test_fc_while_or(...) |