xref: /llvm-project/llvm/test/Transforms/LoopVectorize/RISCV/only-compute-cost-for-vplan-vfs.ll (revision abf5969f76c6b4196b08fe5ea9c2890e97a61357)
1; RUN: opt -passes=loop-vectorize -force-tail-folding-style=data-with-evl \
2; RUN: -prefer-predicate-over-epilogue=predicate-dont-vectorize \
3; RUN: -mtriple=riscv64 -mattr=+v -S -debug %s 2>&1 | FileCheck %s
4
5; REQUIRES: asserts
6
7; Make sure we do not vectorize a loop with a widened int induction.
8define void @test_wide_integer_induction(ptr noalias %a, i64 %N) {
9; CHECK-NOT: LV: Vector loop of width {{.+}} costs:
10;
11; CHECK: define void @test_wide_integer_induction(
12; CHECK-NOT: vector.body
13;
14entry:
15  br label %loop
16
17loop:
18  %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]
19  %arrayidx = getelementptr inbounds i64, ptr %a, i64 %iv
20  store i64 %iv, ptr %arrayidx, align 8
21  %iv.next = add nuw nsw i64 %iv, 1
22  %exitcond.not = icmp eq i64 %iv.next, %N
23  br i1 %exitcond.not, label %exit, label %loop
24
25exit:
26  ret void
27}
28