1 ; RUN: llc -verify-machineinstrs < %s 2 ; 3 ; The lowering of a switch combined with constand folding would leave spurious extra arguments on a PHI instruction. 4 ; 5 target triple = "x86_64-apple-darwin10" 6 7 define void @foo() { 8 br label %cond_true813.i 9 10 cond_true813.i: ; preds = %0 11 br i1 false, label %cond_true818.i, label %cond_next1146.i 12 13 cond_true818.i: ; preds = %cond_true813.i 14 br i1 false, label %recog_memoized.exit52, label %cond_next1146.i 15 16 recog_memoized.exit52: ; preds = %cond_true818.i 17 switch i32 0, label %bb886.i.preheader [ 18 i32 0, label %bb907.i 19 i32 44, label %bb866.i 20 i32 103, label %bb874.i 21 i32 114, label %bb874.i 22 ] 23 24 bb857.i: ; preds = %bb886.i, %bb866.i 25 %tmp862.i494.24 = phi i8* [ null, %bb866.i ], [ %tmp862.i494.26, %bb886.i ] ; <i8*> [#uses=1] 26 switch i32 0, label %bb886.i.preheader [ 27 i32 0, label %bb907.i 28 i32 44, label %bb866.i 29 i32 103, label %bb874.i 30 i32 114, label %bb874.i 31 ] 32 33 bb866.i.loopexit: ; preds = %bb874.i 34 br label %bb866.i 35 36 bb866.i.loopexit31: ; preds = %cond_true903.i 37 br label %bb866.i 38 39 bb866.i: ; preds = %bb866.i.loopexit31, %bb866.i.loopexit, %bb857.i, %recog_memoized.exit52 40 br i1 false, label %bb907.i, label %bb857.i 41 42 bb874.i.preheader.loopexit: ; preds = %cond_true903.i, %cond_true903.i 43 ret void 44 45 bb874.i: ; preds = %bb857.i, %bb857.i, %recog_memoized.exit52, %recog_memoized.exit52 46 switch i32 0, label %bb886.i.preheader.loopexit [ 47 i32 0, label %bb907.i 48 i32 44, label %bb866.i.loopexit 49 i32 103, label %bb874.i.backedge 50 i32 114, label %bb874.i.backedge 51 ] 52 53 bb874.i.backedge: ; preds = %bb874.i, %bb874.i 54 ret void 55 56 bb886.i.preheader.loopexit: ; preds = %bb874.i 57 ret void 58 59 bb886.i.preheader: ; preds = %bb857.i, %recog_memoized.exit52 60 %tmp862.i494.26 = phi i8* [ undef, %recog_memoized.exit52 ], [ %tmp862.i494.24, %bb857.i ] ; <i8*> [#uses=1] 61 br label %bb886.i 62 63 bb886.i: ; preds = %cond_true903.i, %bb886.i.preheader 64 br i1 false, label %bb857.i, label %cond_true903.i 65 66 cond_true903.i: ; preds = %bb886.i 67 switch i32 0, label %bb886.i [ 68 i32 0, label %bb907.i 69 i32 44, label %bb866.i.loopexit31 70 i32 103, label %bb874.i.preheader.loopexit 71 i32 114, label %bb874.i.preheader.loopexit 72 ] 73 74 bb907.i: ; preds = %cond_true903.i, %bb874.i, %bb866.i, %bb857.i, %recog_memoized.exit52 75 br i1 false, label %cond_next1146.i, label %cond_true910.i 76 77 cond_true910.i: ; preds = %bb907.i 78 ret void 79 80 cond_next1146.i: ; preds = %bb907.i, %cond_true818.i, %cond_true813.i 81 ret void 82 83 bb2060.i: ; No predecessors! 84 br i1 false, label %cond_true2064.i, label %bb2067.i 85 86 cond_true2064.i: ; preds = %bb2060.i 87 unreachable 88 89 bb2067.i: ; preds = %bb2060.i 90 ret void 91 92 cond_next3473: ; No predecessors! 93 ret void 94 95 cond_next3521: ; No predecessors! 96 ret void 97 } 98