brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · 305b821 Raw
44 lines · plain
1; RUN: opt < %s -passes='globalopt,function(instcombine,loop-mssa(loop-rotate,licm),instcombine,loop(indvars,loop-deletion)),constmerge' -S | FileCheck %s2; PR11882: ComputeLoadConstantCompareExitLimit crash.3;4; for.body is deleted leaving a loop-invariant load.5; CHECK-NOT: for.body6target datalayout = "e-p:64:64:64-n32:64"7 8@func_21_l_773 = external global i32, align 49@g_814 = external global i32, align 410@g_244 = internal global [1 x [0 x i32]] zeroinitializer, align 411 12define void @func_21() nounwind uwtable ssp {13entry:14  br label %lbl_81815 16lbl_818:                                          ; preds = %for.end, %entry17  call void (...) @func_27()18  store i32 0, ptr @g_814, align 419  br label %for.cond20 21for.cond:                                         ; preds = %for.body, %lbl_81822  %0 = load i32, ptr @g_814, align 423  %cmp = icmp sle i32 %0, 024  br i1 %cmp, label %for.body, label %for.end25 26for.body:                                         ; preds = %for.cond27  %idxprom = sext i32 %0 to i6428  %arrayidx = getelementptr inbounds [0 x i32], ptr @g_244, i32 0, i64 %idxprom29  %1 = load i32, ptr %arrayidx, align 130  store i32 %1, ptr @func_21_l_773, align 431  store i32 1, ptr @g_814, align 432  br label %for.cond33 34for.end:                                          ; preds = %for.cond35  %2 = load i32, ptr @func_21_l_773, align 436  %tobool = icmp ne i32 %2, 037  br i1 %tobool, label %lbl_818, label %if.end38 39if.end:                                           ; preds = %for.end40  ret void41}42 43declare void @func_27(...)44