Chris Lattner | 8829cec | 2010-04-09 01:14:31 +0000 | [diff] [blame^] | 1 | ; RUN: opt %s -sccp -S | FileCheck %s |
| 2 | ; rdar://7832370 |
| 3 | ; Check that lots of stuff doesn't get turned into undef. |
| 4 | |
| 5 | define i32 @main() nounwind readnone ssp { |
| 6 | init: |
| 7 | br label %control.outer.outer |
| 8 | |
| 9 | control.outer.loopexit.us-lcssa: ; preds = %control |
| 10 | br label %control.outer.loopexit |
| 11 | |
| 12 | control.outer.loopexit: ; preds = %control.outer.loopexit.us-lcssa.us, %control.outer.loopexit.us-lcssa |
| 13 | br label %control.outer.outer.backedge |
| 14 | |
| 15 | control.outer.outer: ; preds = %control.outer.outer.backedge, %init |
| 16 | %switchCond.0.ph.ph = phi i32 [ 2, %init ], [ 3, %control.outer.outer.backedge ] ; <i32> [#uses=2] |
| 17 | %i.0.ph.ph = phi i32 [ undef, %init ], [ %i.0.ph.ph.be, %control.outer.outer.backedge ] ; <i32> [#uses=1] |
| 18 | %tmp4 = icmp eq i32 %i.0.ph.ph, 0 ; <i1> [#uses=1] |
| 19 | br i1 %tmp4, label %control.outer.outer.split.us, label %control.outer.outer.control.outer.outer.split_crit_edge |
| 20 | |
| 21 | control.outer.outer.control.outer.outer.split_crit_edge: ; preds = %control.outer.outer |
| 22 | br label %control.outer |
| 23 | |
| 24 | control.outer.outer.split.us: ; preds = %control.outer.outer |
| 25 | br label %control.outer.us |
| 26 | |
| 27 | control.outer.us: ; preds = %bb3.us, %control.outer.outer.split.us |
| 28 | %A.0.ph.us = phi i32 [ %switchCond.0.us, %bb3.us ], [ 4, %control.outer.outer.split.us ] ; <i32> [#uses=2] |
| 29 | %switchCond.0.ph.us = phi i32 [ %A.0.ph.us, %bb3.us ], [ %switchCond.0.ph.ph, %control.outer.outer.split.us ] ; <i32> [#uses=1] |
| 30 | br label %control.us |
| 31 | |
| 32 | bb3.us: ; preds = %control.us |
| 33 | br label %control.outer.us |
| 34 | |
| 35 | bb0.us: ; preds = %control.us |
| 36 | br label %control.us |
| 37 | |
| 38 | ; CHECK: control.us: ; preds = %bb0.us, %control.outer.us |
| 39 | ; CHECK-NEXT: %switchCond.0.us = phi i32 |
| 40 | ; CHECK-NEXT: switch i32 %switchCond.0.us |
| 41 | control.us: ; preds = %bb0.us, %control.outer.us |
| 42 | %switchCond.0.us = phi i32 [ %A.0.ph.us, %bb0.us ], [ %switchCond.0.ph.us, %control.outer.us ] ; <i32> [#uses=2] |
| 43 | switch i32 %switchCond.0.us, label %control.outer.loopexit.us-lcssa.us [ |
| 44 | i32 0, label %bb0.us |
| 45 | i32 1, label %bb1.us-lcssa.us |
| 46 | i32 3, label %bb3.us |
| 47 | i32 4, label %bb4.us-lcssa.us |
| 48 | ] |
| 49 | |
| 50 | control.outer.loopexit.us-lcssa.us: ; preds = %control.us |
| 51 | br label %control.outer.loopexit |
| 52 | |
| 53 | bb1.us-lcssa.us: ; preds = %control.us |
| 54 | br label %bb1 |
| 55 | |
| 56 | bb4.us-lcssa.us: ; preds = %control.us |
| 57 | br label %bb4 |
| 58 | |
| 59 | control.outer: ; preds = %bb3, %control.outer.outer.control.outer.outer.split_crit_edge |
| 60 | %A.0.ph = phi i32 [ %nextId17, %bb3 ], [ 4, %control.outer.outer.control.outer.outer.split_crit_edge ] ; <i32> [#uses=1] |
| 61 | %switchCond.0.ph = phi i32 [ 0, %bb3 ], [ %switchCond.0.ph.ph, %control.outer.outer.control.outer.outer.split_crit_edge ] ; <i32> [#uses=1] |
| 62 | br label %control |
| 63 | |
| 64 | control: ; preds = %bb0, %control.outer |
| 65 | %switchCond.0 = phi i32 [ %A.0.ph, %bb0 ], [ %switchCond.0.ph, %control.outer ] ; <i32> [#uses=2] |
| 66 | switch i32 %switchCond.0, label %control.outer.loopexit.us-lcssa [ |
| 67 | i32 0, label %bb0 |
| 68 | i32 1, label %bb1.us-lcssa |
| 69 | i32 3, label %bb3 |
| 70 | i32 4, label %bb4.us-lcssa |
| 71 | ] |
| 72 | |
| 73 | bb4.us-lcssa: ; preds = %control |
| 74 | br label %bb4 |
| 75 | |
| 76 | bb4: ; preds = %bb4.us-lcssa, %bb4.us-lcssa.us |
| 77 | br label %control.outer.outer.backedge |
| 78 | |
| 79 | control.outer.outer.backedge: ; preds = %bb4, %control.outer.loopexit |
| 80 | %i.0.ph.ph.be = phi i32 [ 1, %bb4 ], [ 0, %control.outer.loopexit ] ; <i32> [#uses=1] |
| 81 | br label %control.outer.outer |
| 82 | |
| 83 | bb3: ; preds = %control |
| 84 | %nextId17 = add i32 %switchCond.0, -2 ; <i32> [#uses=1] |
| 85 | br label %control.outer |
| 86 | |
| 87 | bb0: ; preds = %control |
| 88 | br label %control |
| 89 | |
| 90 | bb1.us-lcssa: ; preds = %control |
| 91 | br label %bb1 |
| 92 | |
| 93 | bb1: ; preds = %bb1.us-lcssa, %bb1.us-lcssa.us |
| 94 | ret i32 0 |
| 95 | } |