52 lines · plain
1; REQUIRES: asserts2; RUN: opt -passes=loop-vectorize,dce,instcombine -mtriple riscv64-linux-gnu \3; RUN: -mattr=+v -debug-only=loop-vectorize --disable-output \4; RUN: -scalable-vectorization=off -S < %s 2>&1 | FileCheck %s5 6; CHECK-LABEL: foo7; CHECK: LV: IC is 28; CHECK: %{{.*}} = add <8 x i32> %{{.*}}, splat (i32 8)9; CHECK: %{{.*}} = add {{.*}}, 1610 11; Function Attrs: nofree norecurse nosync nounwind writeonly12define dso_local void @foo(i32 signext %n, ptr nocapture %A) local_unnamed_addr #0 {13entry:14 %cmp5 = icmp sgt i32 %n, 015 br i1 %cmp5, label %for.body.preheader, label %for.cond.cleanup16 17for.body.preheader: ; preds = %entry18 %wide.trip.count = zext i32 %n to i6419 br label %for.body20 21for.cond.cleanup.loopexit: ; preds = %for.body22 br label %for.cond.cleanup23 24for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry25 ret void26 27for.body: ; preds = %for.body.preheader, %for.body28 %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]29 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv30 %0 = trunc i64 %indvars.iv to i3231 store i32 %0, ptr %arrayidx, align 4, !tbaa !432 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 133 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count34 br i1 %exitcond.not, label %for.cond.cleanup.loopexit, label %for.body, !llvm.loop !835}36 37attributes #0 = { nofree norecurse nosync nounwind writeonly "frame-pointer"="none" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+64bit,+a,+c,+m,+relax,-save-restore" }38 39!llvm.module.flags = !{!0, !1, !2}40!llvm.ident = !{!3}41 42!0 = !{i32 1, !"wchar_size", i32 4}43!1 = !{i32 1, !"target-abi", !"lp64"}44!2 = !{i32 8, !"SmallDataLimit", i32 8}45!3 = !{!"clang version 13.0.0"}46!4 = !{!5, !5, i64 0}47!5 = !{!"int", !6, i64 0}48!6 = !{!"omnipotent char", !7, i64 0}49!7 = !{!"Simple C/C++ TBAA"}50!8 = distinct !{!8, !9}51!9 = !{!"llvm.loop.mustprogress"}52