xref: /llvm-project/llvm/test/Transforms/LoopVectorize/optimal-epilog-vectorization-scalable.ll (revision c836b8956d393f98e0d4e136799a33f1bd06e5f5)
1; REQUIRES: asserts
2; RUN: opt < %s -passes='loop-vectorize' -force-target-supports-scalable-vectors=true -enable-epilogue-vectorization -epilogue-vectorization-force-VF=2 --debug-only=loop-vectorize --disable-output -S -scalable-vectorization=on 2>&1 | FileCheck %s
3
4target datalayout = "e-m:e-i64:64-n32:64-v256:256:256-v512:512:512"
5
6; Currently we cannot handle scalable vectorization factors.
7; CHECK: LV: Checking a loop in 'f1'
8; CHECK: LEV: Epilogue vectorization factor is forced.
9; CHECK: Epilogue Loop VF:2, Epilogue Loop UF:1
10
11define void @f1(ptr %A) {
12entry:
13  br label %for.body
14
15for.body:
16  %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
17  %arrayidx = getelementptr inbounds i8, ptr %A, i64 %iv
18  store i8 1, ptr %arrayidx, align 1
19  %iv.next = add nuw nsw i64 %iv, 1
20  %exitcond = icmp ne i64 %iv.next, 1024
21  br i1 %exitcond, label %for.body, label %exit, !llvm.loop !0
22
23exit:
24  ret void
25}
26
27!0 = !{!0, !1}
28!1 = !{!"llvm.loop.vectorize.scalable.enable", i1 true}
29