85 lines · plain
1; RUN: opt -S -loop-reduce < %s | FileCheck %s2 3; Check that no crash here.4; When GenerateICmpZeroScales transforms the base formula5; it can get non-canonical form.6 7target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"8target triple = "x86_64-unknown-linux-gnu"9 10define void @hoge(i32 %arg) {11; CHECK: @hoge12bb:13 %tmp = and i32 %arg, -814 br label %bb215 16bb1: ; preds = %bb217 ret void18 19bb2: ; preds = %bb2, %bb20 %tmp3 = phi i64 [ 0, %bb ], [ %tmp62, %bb2 ]21 %tmp4 = phi i32 [ 1, %bb ], [ %tmp63, %bb2 ]22 %tmp5 = phi i32 [ 0, %bb ], [ %tmp64, %bb2 ]23 %tmp6 = add i64 %tmp3, 124 %tmp7 = trunc i64 %tmp6 to i3225 %tmp8 = sub i32 %tmp4, %tmp726 %tmp9 = mul i32 %tmp8, %tmp827 %tmp10 = sub i32 %tmp9, %tmp828 %tmp11 = sext i32 %tmp10 to i6429 %tmp12 = sub i64 %tmp6, %tmp1130 %tmp13 = add nuw nsw i32 %tmp4, 131 %tmp14 = add i64 %tmp12, 132 %tmp15 = trunc i64 %tmp14 to i3233 %tmp16 = sub i32 %tmp13, %tmp1534 %tmp17 = mul i32 %tmp16, %tmp1635 %tmp18 = sub i32 %tmp17, %tmp1636 %tmp19 = sext i32 %tmp18 to i6437 %tmp20 = sub i64 %tmp14, %tmp1938 %tmp21 = add i64 %tmp20, 139 %tmp22 = sub i64 %tmp21, 040 %tmp23 = add nuw nsw i32 %tmp4, 341 %tmp24 = add i64 %tmp22, 142 %tmp25 = trunc i64 %tmp24 to i3243 %tmp26 = sub i32 %tmp23, %tmp2544 %tmp27 = mul i32 %tmp26, %tmp2645 %tmp28 = sub i32 %tmp27, %tmp2646 %tmp29 = sext i32 %tmp28 to i6447 %tmp30 = sub i64 %tmp24, %tmp2948 %tmp31 = add nuw nsw i32 %tmp4, 449 %tmp32 = add i64 %tmp30, 150 %tmp33 = trunc i64 %tmp32 to i3251 %tmp34 = sub i32 %tmp31, %tmp3352 %tmp35 = mul i32 %tmp34, %tmp3453 %tmp36 = sub i32 %tmp35, %tmp3454 %tmp37 = sext i32 %tmp36 to i6455 %tmp38 = sub i64 %tmp32, %tmp3756 %tmp39 = add nuw nsw i32 %tmp4, 557 %tmp40 = add i64 %tmp38, 158 %tmp41 = trunc i64 %tmp40 to i3259 %tmp42 = sub i32 %tmp39, %tmp4160 %tmp43 = mul i32 %tmp42, %tmp4261 %tmp44 = sub i32 %tmp43, %tmp4262 %tmp45 = sext i32 %tmp44 to i6463 %tmp46 = sub i64 %tmp40, %tmp4564 %tmp47 = add nuw nsw i32 %tmp4, 665 %tmp48 = add i64 %tmp46, 166 %tmp49 = trunc i64 %tmp48 to i3267 %tmp50 = sub i32 %tmp47, %tmp4968 %tmp51 = mul i32 %tmp50, %tmp5069 %tmp52 = sub i32 %tmp51, %tmp5070 %tmp53 = sext i32 %tmp52 to i6471 %tmp54 = sub i64 %tmp48, %tmp5372 %tmp55 = add nuw nsw i32 %tmp4, 773 %tmp56 = add i64 %tmp54, 174 %tmp57 = trunc i64 %tmp56 to i3275 %tmp58 = sub i32 %tmp55, %tmp5776 %tmp59 = mul i32 %tmp58, %tmp5877 %tmp60 = sub i32 %tmp59, %tmp5878 %tmp61 = sext i32 %tmp60 to i6479 %tmp62 = sub i64 %tmp56, %tmp6180 %tmp63 = add nuw nsw i32 %tmp4, 881 %tmp64 = add i32 %tmp5, 882 %tmp65 = icmp eq i32 %tmp64, %tmp83 br i1 %tmp65, label %bb1, label %bb284}85