1 ; RUN: opt < %s -passes=loop-vectorize -mtriple=ve-linux -S | FileCheck %s -check-prefix=VE
2 ; RUN: opt < %s -passes=loop-vectorize -mtriple=x86_64-pc_linux -mcpu=core-avx2 -S | FileCheck %s -check-prefix=AVX
4 ; Make sure LV does not trigger for VE on an appealing loop that vectorizes for x86 AVX.
6 ; TODO: Remove this test once VE vector isel is deemed stable.
8 ; VE-NOT: llvm.loop.isvectorized
9 ; AVX: llvm.loop.isvectorized
11 define dso_local void @foo(ptr noalias nocapture %A, ptr noalias nocapture readonly %B, i32 signext %n) local_unnamed_addr {
13 %cmp = icmp sgt i32 %n, 0
14 br i1 %cmp, label %omp.inner.for.body.preheader, label %simd.if.end
16 omp.inner.for.body.preheader: ; preds = %entry
17 %wide.trip.count = zext i32 %n to i64
18 br label %omp.inner.for.body
20 omp.inner.for.body: ; preds = %omp.inner.for.body.preheader, %omp.inner.for.body
21 %indvars.iv = phi i64 [ 0, %omp.inner.for.body.preheader ], [ %indvars.iv.next, %omp.inner.for.body ]
22 %arrayidx = getelementptr inbounds i32, ptr %B, i64 %indvars.iv
23 %0 = load i32, ptr %arrayidx, align 4, !llvm.access.group !6
24 %mul6 = mul nsw i32 %0, 3
25 %arrayidx8 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
26 store i32 %mul6, ptr %arrayidx8, align 4, !llvm.access.group !6
27 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
28 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
29 br i1 %exitcond.not, label %simd.if.end, label %omp.inner.for.body, !llvm.loop !7
31 simd.if.end: ; preds = %omp.inner.for.body, %entry
36 !7 = distinct !{!7, !8, !9}
37 !8 = !{!"llvm.loop.parallel_accesses", !6}
38 !9 = !{!"llvm.loop.vectorize.enable", i1 true}