xref: /llvm-project/llvm/test/Transforms/LoopVectorize/vplan-force-tail-with-evl.ll (revision 413a66f33984a4d484ac1ff0ba7c0ac39ffa3095)
1; REQUIRES: asserts
2
3; RUN: opt -passes=loop-vectorize -debug-only=loop-vectorize \
4; RUN: -force-tail-folding-style=data-with-evl -force-vector-width=4 \
5; RUN: -force-target-supports-scalable-vectors -scalable-vectorization=on \
6; RUN: -disable-output < %s 2>&1 | FileCheck --check-prefixes=NO-VP %s
7
8; RUN: opt -passes=loop-vectorize -debug-only=loop-vectorize \
9; RUN: -force-tail-folding-style=none \
10; RUN: -prefer-predicate-over-epilogue=predicate-dont-vectorize \
11; RUN: -force-target-supports-scalable-vectors -scalable-vectorization=on \
12; RUN: -disable-output < %s 2>&1 | FileCheck --check-prefixes=NO-VP %s
13
14; The target does not support predicated vectorization.
15define void @foo(ptr noalias %a, ptr noalias %b, ptr noalias %c, i64 %N) {
16; NO-VP-NOT: EXPLICIT-VECTOR-LENGTH-BASED-IV-PHI
17
18entry:
19  br label %for.body
20
21for.body:
22  %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
23  %arrayidx = getelementptr inbounds i32, ptr %b, i64 %iv
24  %0 = load i32, ptr %arrayidx, align 4
25  %arrayidx2 = getelementptr inbounds i32, ptr %c, i64 %iv
26  %1 = load i32, ptr %arrayidx2, align 4
27  %add = add nsw i32 %1, %0
28  %arrayidx4 = getelementptr inbounds i32, ptr %a, i64 %iv
29  store i32 %add, ptr %arrayidx4, align 4
30  %iv.next = add nuw nsw i64 %iv, 1
31  %exitcond.not = icmp eq i64 %iv.next, %N
32  br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
33
34for.cond.cleanup:
35  ret void
36}
37
38