Skip to content

Commit ffd00f8

Browse files
fhahnAlexisPerry
authored andcommitted
[LV] Add test showing cost is computed when there are no vector plans.
Add test showing unnecessary cost computations, as no vector VPlans are generated.
1 parent 79354df commit ffd00f8

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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.
8+
; TODO: There's no need to compute costs for any VF, as no VPlans have been generated.
9+
define void @test_wide_integer_induction(ptr noalias %a, i64 %N) {
10+
; CHECK: LV: Vector loop of width {{.+}} costs:
11+
;
12+
; CHECK: define void @test_wide_integer_induction(
13+
; CHECK-NOT: vector.body
14+
;
15+
entry:
16+
br label %loop
17+
18+
loop:
19+
%iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]
20+
%arrayidx = getelementptr inbounds i64, ptr %a, i64 %iv
21+
store i64 %iv, ptr %arrayidx, align 8
22+
%iv.next = add nuw nsw i64 %iv, 1
23+
%exitcond.not = icmp eq i64 %iv.next, %N
24+
br i1 %exitcond.not, label %exit, label %loop
25+
26+
exit:
27+
ret void
28+
}

0 commit comments

Comments
 (0)