67 lines · plain
1; RUN: opt -S -loop-reduce < %s | FileCheck %s2;3;This test produces zero factor that becomes a denumerator and fails an assetion.4 5target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128-ni:1-p2:32:8:8:32-ni:2"6target triple = "x86_64-unknown-linux-gnu"7 8define void @test(i1 %arg) {9; CHECK-LABEL: test10bb:11 %tmp = load i32, ptr addrspace(3) undef, align 412 br label %bb113 14bb1: ; preds = %bb38, %bb15 %tmp2 = phi i64 [ undef, %bb ], [ %tmp6, %bb38 ]16 %tmp3 = phi i32 [ %tmp, %bb ], [ 1, %bb38 ]17 %tmp4 = add i32 %tmp3, 118 %tmp5 = call i32 @llvm.smax.i32(i32 %tmp4, i32 74)19 %tmp6 = add nuw nsw i64 %tmp2, 120 br i1 %arg, label %bb7, label %bb3821 22bb7: ; preds = %bb123 %tmp8 = trunc i64 %tmp6 to i3224 %tmp9 = sub nsw i32 3, %tmp525 %tmp10 = mul i32 %tmp9, %tmp826 br label %bb1127 28bb11: ; preds = %bb11, %bb729 %tmp12 = phi i32 [ undef, %bb7 ], [ %tmp17, %bb11 ]30 %tmp13 = phi i64 [ 3, %bb7 ], [ %tmp22, %bb11 ]31 %tmp14 = phi i64 [ undef, %bb7 ], [ %tmp23, %bb11 ]32 %tmp15 = add i32 %tmp12, %tmp1033 %tmp16 = add nuw nsw i64 %tmp13, 134 %tmp17 = add i32 %tmp15, %tmp1035 %tmp18 = add i32 %tmp17, undef36 %tmp19 = sub i32 %tmp18, undef37 %tmp20 = sext i32 %tmp19 to i6438 %tmp21 = add nsw i64 undef, %tmp2039 %tmp22 = add nuw nsw i64 %tmp13, 240 %tmp23 = add i64 %tmp14, -241 %tmp24 = icmp eq i64 %tmp23, 042 br i1 %tmp24, label %bb25, label %bb1143 44bb25: ; preds = %bb1145 %tmp26 = trunc i64 %tmp16 to i3246 %tmp27 = icmp ult i32 %tmp26, 5247 %tmp28 = trunc i64 %tmp22 to i3248 %tmp29 = mul i32 %tmp9, %tmp2849 %tmp30 = add i32 undef, %tmp2950 %tmp31 = mul i32 %tmp30, %tmp851 %tmp32 = add i32 undef, %tmp3152 %tmp33 = add i32 %tmp32, 3453 %tmp34 = trunc i64 %tmp21 to i3254 %tmp35 = add i32 %tmp33, undef55 %tmp36 = sub i32 %tmp35, %tmp3456 %tmp37 = sext i32 %tmp36 to i6457 unreachable58 59bb38: ; preds = %bb160 br label %bb161}62 63; Function Attrs: nofree nosync nounwind readnone speculatable willreturn64declare i32 @llvm.smax.i32(i32, i32) #065 66attributes #0 = { nofree nosync nounwind readnone speculatable willreturn }67