254 lines · plain
1; RUN: opt -scalar-evolution-max-arith-depth=4 -scalar-evolution-max-add-rec-size=4 -loop-reduce -S < %s | FileCheck %s2 3; Check that the test does not hang.4define void @test_01(ptr nocapture %a) local_unnamed_addr {5 6; CHECK-LABEL: @test_01(7 8while.body.outer:9 %arrayidx2 = getelementptr inbounds i32, ptr %a, i64 9610 %arrayidx2.promoted50 = load i32, ptr %arrayidx2, align 111 %a.promoted = load i32, ptr %a, align 112 %add347.peel = xor i32 %arrayidx2.promoted50, -113 %tobool48.peel = icmp eq i32 %a.promoted, %add347.peel14 br i1 %tobool48.peel, label %while.body.preheader, label %while.body4.preheader15 16while.body.preheader: ; preds = %while.body.outer17 %tobool48 = icmp eq i32 %a.promoted, 118 br label %while.body19 20while.body: ; preds = %while.body.preheader, %while.body21 br i1 %tobool48, label %while.body, label %while.body4.preheader.loopexit22 23while.body4.preheader.loopexit: ; preds = %while.body24 br label %while.body4.preheader25 26while.body4.preheader: ; preds = %while.body4.preheader.loopexit, %while.body.outer27 br label %while.body428 29while.body4: ; preds = %while.body4.preheader, %while.end.2230 %0 = phi i32 [ %mul.22, %while.end.22 ], [ %arrayidx2.promoted50, %while.body4.preheader ]31 %mul = mul nsw i32 %0, %032 br label %while.cond1733 34while.cond17: ; preds = %while.cond17, %while.body435 %add22.sink = phi i32 [ %add22, %while.cond17 ], [ %mul, %while.body4 ]36 %cmp = icmp slt i32 %add22.sink, 037 %add22 = add nsw i32 %add22.sink, 102438 br i1 %cmp, label %while.cond17, label %while.end39 40while.end: ; preds = %while.cond1741 %mul.1 = mul nsw i32 %add22.sink, %add22.sink42 br label %while.cond17.143 44while.cond17.1: ; preds = %while.cond17.1, %while.end45 %add22.sink.1 = phi i32 [ %add22.1, %while.cond17.1 ], [ %mul.1, %while.end ]46 %cmp.1 = icmp slt i32 %add22.sink.1, 047 %add22.1 = add nsw i32 %add22.sink.1, 204848 br i1 %cmp.1, label %while.cond17.1, label %while.end.149 50while.end.1: ; preds = %while.cond17.151 %mul.2 = mul nsw i32 %add22.sink.1, %add22.sink.152 br label %while.cond17.253 54while.cond17.2: ; preds = %while.cond17.2, %while.end.155 %add22.sink.2 = phi i32 [ %add22.2, %while.cond17.2 ], [ %mul.2, %while.end.1 ]56 %cmp.2 = icmp slt i32 %add22.sink.2, 057 %add22.2 = add nsw i32 %add22.sink.2, 409658 br i1 %cmp.2, label %while.cond17.2, label %while.end.259 60while.end.2: ; preds = %while.cond17.261 %mul.3 = mul nsw i32 %add22.sink.2, %add22.sink.262 br label %while.cond17.363 64while.cond17.3: ; preds = %while.cond17.3, %while.end.265 %add22.sink.3 = phi i32 [ %add22.3, %while.cond17.3 ], [ %mul.3, %while.end.2 ]66 %cmp.3 = icmp slt i32 %add22.sink.3, 067 %add22.3 = add nsw i32 %add22.sink.3, 819268 br i1 %cmp.3, label %while.cond17.3, label %while.end.369 70while.end.3: ; preds = %while.cond17.371 %mul.4 = mul nsw i32 %add22.sink.3, %add22.sink.372 br label %while.cond17.473 74while.cond17.4: ; preds = %while.cond17.4, %while.end.375 %add22.sink.4 = phi i32 [ %add22.4, %while.cond17.4 ], [ %mul.4, %while.end.3 ]76 %cmp.4 = icmp slt i32 %add22.sink.4, 077 %add22.4 = add nsw i32 %add22.sink.4, 1638478 br i1 %cmp.4, label %while.cond17.4, label %while.end.479 80while.end.4: ; preds = %while.cond17.481 %mul.5 = mul nsw i32 %add22.sink.4, %add22.sink.482 br label %while.cond17.583 84while.cond17.5: ; preds = %while.cond17.5, %while.end.485 %add22.sink.5 = phi i32 [ %add22.5, %while.cond17.5 ], [ %mul.5, %while.end.4 ]86 %cmp.5 = icmp slt i32 %add22.sink.5, 087 %add22.5 = add nsw i32 %add22.sink.5, 3276888 br i1 %cmp.5, label %while.cond17.5, label %while.end.589 90while.end.5: ; preds = %while.cond17.591 %mul.6 = mul nsw i32 %add22.sink.5, %add22.sink.592 br label %while.cond17.693 94while.cond17.6: ; preds = %while.cond17.6, %while.end.595 %add22.sink.6 = phi i32 [ %add22.6, %while.cond17.6 ], [ %mul.6, %while.end.5 ]96 %cmp.6 = icmp slt i32 %add22.sink.6, 097 %add22.6 = add nsw i32 %add22.sink.6, 6553698 br i1 %cmp.6, label %while.cond17.6, label %while.end.699 100while.end.6: ; preds = %while.cond17.6101 %mul.7 = mul nsw i32 %add22.sink.6, %add22.sink.6102 br label %while.cond17.7103 104while.cond17.7: ; preds = %while.cond17.7, %while.end.6105 %add22.sink.7 = phi i32 [ %add22.7, %while.cond17.7 ], [ %mul.7, %while.end.6 ]106 %cmp.7 = icmp slt i32 %add22.sink.7, 0107 %add22.7 = add nsw i32 %add22.sink.7, 131072108 br i1 %cmp.7, label %while.cond17.7, label %while.end.7109 110while.end.7: ; preds = %while.cond17.7111 %mul.8 = mul nsw i32 %add22.sink.7, %add22.sink.7112 br label %while.cond17.8113 114while.cond17.8: ; preds = %while.cond17.8, %while.end.7115 %add22.sink.8 = phi i32 [ %add22.8, %while.cond17.8 ], [ %mul.8, %while.end.7 ]116 %cmp.8 = icmp slt i32 %add22.sink.8, 0117 %add22.8 = add nsw i32 %add22.sink.8, 262144118 br i1 %cmp.8, label %while.cond17.8, label %while.end.8119 120while.end.8: ; preds = %while.cond17.8121 %mul.9 = mul nsw i32 %add22.sink.8, %add22.sink.8122 br label %while.cond17.9123 124while.cond17.9: ; preds = %while.cond17.9, %while.end.8125 %add22.sink.9 = phi i32 [ %add22.9, %while.cond17.9 ], [ %mul.9, %while.end.8 ]126 %cmp.9 = icmp slt i32 %add22.sink.9, 0127 %add22.9 = add nsw i32 %add22.sink.9, 524288128 br i1 %cmp.9, label %while.cond17.9, label %while.end.9129 130while.end.9: ; preds = %while.cond17.9131 %mul.10 = mul nsw i32 %add22.sink.9, %add22.sink.9132 br label %while.cond17.10133 134while.cond17.10: ; preds = %while.cond17.10, %while.end.9135 %add22.sink.10 = phi i32 [ %add22.10, %while.cond17.10 ], [ %mul.10, %while.end.9 ]136 %cmp.10 = icmp slt i32 %add22.sink.10, 0137 %add22.10 = add nsw i32 %add22.sink.10, 1048576138 br i1 %cmp.10, label %while.cond17.10, label %while.end.10139 140while.end.10: ; preds = %while.cond17.10141 %mul.11 = mul nsw i32 %add22.sink.10, %add22.sink.10142 br label %while.cond17.11143 144while.cond17.11: ; preds = %while.cond17.11, %while.end.10145 %add22.sink.11 = phi i32 [ %add22.11, %while.cond17.11 ], [ %mul.11, %while.end.10 ]146 %cmp.11 = icmp slt i32 %add22.sink.11, 0147 %add22.11 = add nsw i32 %add22.sink.11, 2097152148 br i1 %cmp.11, label %while.cond17.11, label %while.end.11149 150while.end.11: ; preds = %while.cond17.11151 %mul.12 = mul nsw i32 %add22.sink.11, %add22.sink.11152 br label %while.cond17.12153 154while.cond17.12: ; preds = %while.cond17.12, %while.end.11155 %add22.sink.12 = phi i32 [ %add22.12, %while.cond17.12 ], [ %mul.12, %while.end.11 ]156 %cmp.12 = icmp slt i32 %add22.sink.12, 0157 %add22.12 = add nsw i32 %add22.sink.12, 4194304158 br i1 %cmp.12, label %while.cond17.12, label %while.end.12159 160while.end.12: ; preds = %while.cond17.12161 %mul.13 = mul nsw i32 %add22.sink.12, %add22.sink.12162 br label %while.cond17.13163 164while.cond17.13: ; preds = %while.cond17.13, %while.end.12165 %add22.sink.13 = phi i32 [ %add22.13, %while.cond17.13 ], [ %mul.13, %while.end.12 ]166 %cmp.13 = icmp slt i32 %add22.sink.13, 0167 %add22.13 = add nsw i32 %add22.sink.13, 8388608168 br i1 %cmp.13, label %while.cond17.13, label %while.end.13169 170while.end.13: ; preds = %while.cond17.13171 %mul.14 = mul nsw i32 %add22.sink.13, %add22.sink.13172 br label %while.cond17.14173 174while.cond17.14: ; preds = %while.cond17.14, %while.end.13175 %add22.sink.14 = phi i32 [ %add22.14, %while.cond17.14 ], [ %mul.14, %while.end.13 ]176 %cmp.14 = icmp slt i32 %add22.sink.14, 0177 %add22.14 = add nsw i32 %add22.sink.14, 16777216178 br i1 %cmp.14, label %while.cond17.14, label %while.end.14179 180while.end.14: ; preds = %while.cond17.14181 %mul.15 = mul nsw i32 %add22.sink.14, %add22.sink.14182 br label %while.cond17.15183 184while.cond17.15: ; preds = %while.cond17.15, %while.end.14185 %add22.sink.15 = phi i32 [ %add22.15, %while.cond17.15 ], [ %mul.15, %while.end.14 ]186 %cmp.15 = icmp slt i32 %add22.sink.15, 0187 %add22.15 = add nsw i32 %add22.sink.15, 33554432188 br i1 %cmp.15, label %while.cond17.15, label %while.end.15189 190while.end.15: ; preds = %while.cond17.15191 %mul.16 = mul nsw i32 %add22.sink.15, %add22.sink.15192 br label %while.cond17.16193 194while.cond17.16: ; preds = %while.cond17.16, %while.end.15195 %add22.sink.16 = phi i32 [ %add22.16, %while.cond17.16 ], [ %mul.16, %while.end.15 ]196 %cmp.16 = icmp slt i32 %add22.sink.16, 0197 %add22.16 = add nsw i32 %add22.sink.16, 67108864198 br i1 %cmp.16, label %while.cond17.16, label %while.end.16199 200while.end.16: ; preds = %while.cond17.16201 %mul.17 = mul nsw i32 %add22.sink.16, %add22.sink.16202 br label %while.cond17.17203 204while.cond17.17: ; preds = %while.cond17.17, %while.end.16205 %add22.sink.17 = phi i32 [ %add22.17, %while.cond17.17 ], [ %mul.17, %while.end.16 ]206 %cmp.17 = icmp slt i32 %add22.sink.17, 0207 %add22.17 = add nsw i32 %add22.sink.17, 134217728208 br i1 %cmp.17, label %while.cond17.17, label %while.end.17209 210while.end.17: ; preds = %while.cond17.17211 %mul.18 = mul nsw i32 %add22.sink.17, %add22.sink.17212 br label %while.cond17.18213 214while.cond17.18: ; preds = %while.cond17.18, %while.end.17215 %add22.sink.18 = phi i32 [ %add22.18, %while.cond17.18 ], [ %mul.18, %while.end.17 ]216 %cmp.18 = icmp slt i32 %add22.sink.18, 0217 %add22.18 = add nsw i32 %add22.sink.18, 268435456218 br i1 %cmp.18, label %while.cond17.18, label %while.end.18219 220while.end.18: ; preds = %while.cond17.18221 %mul.19 = mul nsw i32 %add22.sink.18, %add22.sink.18222 br label %while.cond17.19223 224while.cond17.19: ; preds = %while.cond17.19, %while.end.18225 %add22.sink.19 = phi i32 [ %add22.19, %while.cond17.19 ], [ %mul.19, %while.end.18 ]226 %cmp.19 = icmp slt i32 %add22.sink.19, 0227 %add22.19 = add nsw i32 %add22.sink.19, 536870912228 br i1 %cmp.19, label %while.cond17.19, label %while.end.19229 230while.end.19: ; preds = %while.cond17.19231 %mul.20 = mul nsw i32 %add22.sink.19, %add22.sink.19232 br label %while.cond17.20233 234while.cond17.20: ; preds = %while.cond17.20, %while.end.19235 %add22.sink.20 = phi i32 [ %add22.20, %while.cond17.20 ], [ %mul.20, %while.end.19 ]236 %cmp.20 = icmp slt i32 %add22.sink.20, 0237 %add22.20 = add nsw i32 %add22.sink.20, 1073741824238 br i1 %cmp.20, label %while.cond17.20, label %while.end.20239 240while.end.20: ; preds = %while.cond17.20241 %mul.21 = mul nsw i32 %add22.sink.20, %add22.sink.20242 br label %while.cond17.21243 244while.cond17.21: ; preds = %while.cond17.21, %while.end.20245 %add22.sink.21 = phi i32 [ %add22.21, %while.cond17.21 ], [ %mul.21, %while.end.20 ]246 %cmp.21 = icmp slt i32 %add22.sink.21, 0247 %add22.21 = or i32 %add22.sink.21, -2147483648248 br i1 %cmp.21, label %while.cond17.21, label %while.end.22249 250while.end.22: ; preds = %while.cond17.21251 %mul.22 = mul nsw i32 %add22.sink.21, %add22.sink.21252 br label %while.body4253}254