1; REQUIRES: asserts 2; RUN: opt -passes=loop-vectorize,dce,instcombine -mtriple riscv64-linux-gnu \ 3; RUN: -mattr=+v -debug-only=loop-vectorize --disable-output \ 4; RUN: -riscv-v-vector-bits-min=128 -scalable-vectorization=off -S < %s 2>&1 | FileCheck %s 5 6; CHECK-LABEL: foo 7; CHECK: LV: IC is 2 8; CHECK: %{{.*}} = add <8 x i32> %{{.*}}, splat (i32 8) 9; CHECK: %{{.*}} = add {{.*}}, 16 10 11; Function Attrs: nofree norecurse nosync nounwind writeonly 12define dso_local void @foo(i32 signext %n, ptr nocapture %A) local_unnamed_addr #0 { 13entry: 14 %cmp5 = icmp sgt i32 %n, 0 15 br i1 %cmp5, label %for.body.preheader, label %for.cond.cleanup 16 17for.body.preheader: ; preds = %entry 18 %wide.trip.count = zext i32 %n to i64 19 br label %for.body 20 21for.cond.cleanup.loopexit: ; preds = %for.body 22 br label %for.cond.cleanup 23 24for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry 25 ret void 26 27for.body: ; preds = %for.body.preheader, %for.body 28 %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] 29 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv 30 %0 = trunc i64 %indvars.iv to i32 31 store i32 %0, ptr %arrayidx, align 4, !tbaa !4 32 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 33 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count 34 br i1 %exitcond.not, label %for.cond.cleanup.loopexit, label %for.body, !llvm.loop !8 35} 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