40 lines · plain
1; REQUIRES: asserts2; RUN: opt --passes=loop-vectorize,dce,instcombine --mtriple loongarch64 \3; RUN: -S < %s 2>&1 | FileCheck %s4 5; CHECK-LABEL: foo6; CHECK: %{{.*}} = add {{.*}}, 87 8; Function Attrs: nofree norecurse nosync nounwind writeonly9define dso_local void @foo(i32 signext %n, ptr nocapture %A) local_unnamed_addr #0 {10entry:11 %cmp5 = icmp sgt i32 %n, 012 br i1 %cmp5, label %for.body.preheader, label %for.cond.cleanup13 14for.body.preheader: ; preds = %entry15 %wide.trip.count = zext i32 %n to i6416 br label %for.body17 18for.cond.cleanup.loopexit: ; preds = %for.body19 br label %for.cond.cleanup20 21for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry22 ret void23 24for.body: ; preds = %for.body.preheader, %for.body25 %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]26 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv27 %0 = trunc i64 %indvars.iv to i3228 store i32 %0, ptr %arrayidx, align 4, !tbaa !429 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 130 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count31 br i1 %exitcond.not, label %for.cond.cleanup.loopexit, label %for.body, !llvm.loop !832}33 34!4 = !{!5, !5, i64 0}35!5 = !{!"int", !6, i64 0}36!6 = !{!"omnipotent char", !7, i64 0}37!7 = !{!"Simple C/C++ TBAA"}38!8 = distinct !{!8, !9}39!9 = !{!"llvm.loop.mustprogress"}40