1 ; RUN: llc < %s 2 ; PR6363 3 ; 4 ; This test case creates a phi join register with a single definition. The other 5 ; predecessor blocks are implicit-def. 6 ; 7 ; If LiveIntervalAnalysis fails to recognize this as a phi join, the coalescer 8 ; will detect an infinity valno loop. 9 ; 10 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128" 11 target triple = "x86_64-unknown-linux-gnu" 12 13 define i32 @decode(i8* nocapture %input, i32 %offset, i8* nocapture %output) nounwind { 14 entry: 15 br i1 undef, label %meshBB86, label %meshBB102 16 17 bb: ; preds = %meshBB106, %meshBB102 18 br i1 false, label %bb9, label %meshBB90 19 20 bb.nph: ; preds = %meshBB90 21 br label %meshBB114 22 23 bb.nph.fragment: ; preds = %meshBB114 24 br label %meshBB118 25 26 bb1.fragment: ; preds = %meshBB118 27 br i1 false, label %bb2, label %bb3 28 29 bb2: ; preds = %bb1.fragment 30 br label %meshBB74 31 32 bb2.fragment15: ; preds = %meshBB74 33 br label %meshBB98 34 35 bb3: ; preds = %bb1.fragment 36 br i1 undef, label %meshBB, label %meshBB102 37 38 bb4: ; preds = %meshBB 39 br label %meshBB118 40 41 bb4.fragment: ; preds = %meshBB118 42 br label %meshBB82 43 44 bb5: ; preds = %meshBB102, %meshBB82 45 br i1 false, label %bb6, label %bb7 46 47 bb6: ; preds = %bb5 48 br label %bb7 49 50 bb7: ; preds = %meshBB98, %bb6, %bb5 51 br label %meshBB114 52 53 bb7.fragment: ; preds = %meshBB114 54 br i1 undef, label %meshBB74, label %bb9 55 56 bb9: ; preds = %bb7.fragment, %bb 57 br label %bb1.i23 58 59 bb1.i23: ; preds = %meshBB110, %bb9 60 br i1 undef, label %meshBB106, label %meshBB110 61 62 skip_to_newline.exit26: ; preds = %meshBB106 63 br label %meshBB86 64 65 skip_to_newline.exit26.fragment: ; preds = %meshBB86 66 br i1 false, label %meshBB90, label %meshBB106 67 68 bb11.fragment: ; preds = %meshBB90, %meshBB86 69 br label %meshBB122 70 71 bb1.i: ; preds = %meshBB122, %meshBB 72 %ooffset.2.lcssa.phi.SV.phi203 = phi i32 [ 0, %meshBB122 ], [ %ooffset.2.lcssa.phi.SV.phi233, %meshBB ] ; <i32> [#uses=1] 73 br label %meshBB98 74 75 bb1.i.fragment: ; preds = %meshBB98 76 br i1 undef, label %meshBB78, label %meshBB 77 78 skip_to_newline.exit: ; preds = %meshBB78 79 br i1 undef, label %bb12, label %meshBB110 80 81 bb12: ; preds = %skip_to_newline.exit 82 br label %meshBB94 83 84 bb12.fragment: ; preds = %meshBB94 85 br i1 false, label %bb13, label %meshBB78 86 87 bb13: ; preds = %bb12.fragment 88 br label %meshBB82 89 90 bb13.fragment: ; preds = %meshBB82 91 br i1 undef, label %meshBB94, label %meshBB122 92 93 bb14: ; preds = %meshBB94 94 ret i32 %ooffset.2.lcssa.phi.SV.phi250 95 96 bb15: ; preds = %meshBB122, %meshBB110, %meshBB78 97 unreachable 98 99 meshBB: ; preds = %bb1.i.fragment, %bb3 100 %ooffset.2.lcssa.phi.SV.phi233 = phi i32 [ undef, %bb3 ], [ %ooffset.2.lcssa.phi.SV.phi209, %bb1.i.fragment ] ; <i32> [#uses=1] 101 br i1 undef, label %bb1.i, label %bb4 102 103 meshBB74: ; preds = %bb7.fragment, %bb2 104 br i1 false, label %meshBB118, label %bb2.fragment15 105 106 meshBB78: ; preds = %bb12.fragment, %bb1.i.fragment 107 %ooffset.2.lcssa.phi.SV.phi239 = phi i32 [ %ooffset.2.lcssa.phi.SV.phi209, %bb1.i.fragment ], [ %ooffset.2.lcssa.phi.SV.phi250, %bb12.fragment ] ; <i32> [#uses=1] 108 br i1 false, label %bb15, label %skip_to_newline.exit 109 110 meshBB82: ; preds = %bb13, %bb4.fragment 111 br i1 false, label %bb5, label %bb13.fragment 112 113 meshBB86: ; preds = %skip_to_newline.exit26, %entry 114 br i1 undef, label %skip_to_newline.exit26.fragment, label %bb11.fragment 115 116 meshBB90: ; preds = %skip_to_newline.exit26.fragment, %bb 117 br i1 false, label %bb11.fragment, label %bb.nph 118 119 meshBB94: ; preds = %bb13.fragment, %bb12 120 %ooffset.2.lcssa.phi.SV.phi250 = phi i32 [ 0, %bb13.fragment ], [ %ooffset.2.lcssa.phi.SV.phi239, %bb12 ] ; <i32> [#uses=2] 121 br i1 false, label %bb12.fragment, label %bb14 122 123 meshBB98: ; preds = %bb1.i, %bb2.fragment15 124 %ooffset.2.lcssa.phi.SV.phi209 = phi i32 [ undef, %bb2.fragment15 ], [ %ooffset.2.lcssa.phi.SV.phi203, %bb1.i ] ; <i32> [#uses=2] 125 br i1 undef, label %bb1.i.fragment, label %bb7 126 127 meshBB102: ; preds = %bb3, %entry 128 br i1 undef, label %bb5, label %bb 129 130 meshBB106: ; preds = %skip_to_newline.exit26.fragment, %bb1.i23 131 br i1 undef, label %bb, label %skip_to_newline.exit26 132 133 meshBB110: ; preds = %skip_to_newline.exit, %bb1.i23 134 br i1 false, label %bb15, label %bb1.i23 135 136 meshBB114: ; preds = %bb7, %bb.nph 137 %meshStackVariable115.phi = phi i32 [ 19, %bb7 ], [ 8, %bb.nph ] ; <i32> [#uses=0] 138 br i1 undef, label %bb.nph.fragment, label %bb7.fragment 139 140 meshBB118: ; preds = %meshBB74, %bb4, %bb.nph.fragment 141 %meshCmp121 = icmp eq i32 undef, 10 ; <i1> [#uses=1] 142 br i1 %meshCmp121, label %bb4.fragment, label %bb1.fragment 143 144 meshBB122: ; preds = %bb13.fragment, %bb11.fragment 145 br i1 false, label %bb1.i, label %bb15 146 } 147