1 ; RUN: opt -S -passes=loop-vectorize,instsimplify -force-vector-interleave=1 \
2 ; RUN: -mcpu=neoverse-v1 -sve-tail-folding=disabled < %s | FileCheck %s --check-prefix=CHECK-EPILOG
3 ; RUN: opt -S -passes=loop-vectorize,instsimplify -force-vector-interleave=1 \
4 ; RUN: -mcpu=neoverse-v2 < %s | FileCheck %s --check-prefix=CHECK-NO-EPILOG
5 ; RUN: opt -S -passes=loop-vectorize,instsimplify -force-vector-interleave=1 \
6 ; RUN: -mcpu=cortex-x2 < %s | FileCheck %s --check-prefix=CHECK-NO-EPILOG
8 target triple = "aarch64-unknown-linux-gnu"
10 define void @foo(ptr noalias nocapture readonly %p, ptr noalias nocapture %q, i64 %len) #0 {
11 ; CHECK-EPILOG: vec.epilog.ph:
12 ; CHECK-EPILOG: vec.epilog.vector.body:
13 ; CHECK-EPILOG: load <vscale x 4 x i16>
15 ; CHECK-NO-EPILOG-NOT: vec.epilog.vector.ph:
16 ; CHECK-NO-EPILOG-NOT: vec.epilog.vector.body:
20 for.body: ; preds = %entry, %for.body
21 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
22 %arrayidx = getelementptr inbounds i16, ptr %p, i64 %indvars.iv
23 %0 = load i16, ptr %arrayidx
24 %add = add nuw nsw i16 %0, 2
25 %arrayidx3 = getelementptr inbounds i16, ptr %q, i64 %indvars.iv
26 store i16 %add, ptr %arrayidx3
27 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
28 %exitcond = icmp eq i64 %indvars.iv.next, %len
29 br i1 %exitcond, label %exit, label %for.body
31 exit: ; preds = %for.body
35 attributes #0 = { "target-features"="+sve" vscale_range(1,16) }