2 ; RUN: opt -mtriple=aarch64 -mattr=+sve \
3 ; RUN: -force-target-instruction-cost=1 -passes=loop-vectorize -S -debug-only=loop-vectorize < %s 2>&1 \
4 ; RUN: | FileCheck %s --check-prefixes=GENERIC,VF-VSCALE4
6 ; RUN: opt -mtriple=aarch64 -mattr=+sve -mcpu=generic \
7 ; RUN: -force-target-instruction-cost=1 -passes=loop-vectorize -S -debug-only=loop-vectorize < %s 2>&1 \
8 ; RUN: | FileCheck %s --check-prefixes=GENERIC,VF-VSCALE4
10 ; RUN: opt -mtriple=aarch64 -mcpu=neoverse-v1 \
11 ; RUN: -force-target-instruction-cost=1 -passes=loop-vectorize -S -debug-only=loop-vectorize < %s 2>&1 \
12 ; RUN: | FileCheck %s --check-prefixes=NEOVERSE-V1,VF-VSCALE4
14 ; RUN: opt -mtriple=aarch64 -mcpu=neoverse-n2 \
15 ; RUN: -force-target-instruction-cost=1 -passes=loop-vectorize -S -debug-only=loop-vectorize < %s 2>&1 \
16 ; RUN: | FileCheck %s --check-prefixes=NEOVERSE-N2,VF-VSCALE4
18 ; RUN: opt -mtriple=aarch64 -mcpu=neoverse-n2 \
19 ; RUN: -force-target-instruction-cost=1 -passes=loop-vectorize -S -debug-only=loop-vectorize < %s 2>&1 \
20 ; RUN: | FileCheck %s --check-prefixes=NEOVERSE-N2,VF-VSCALE4
22 ; GENERIC: LV: Vector loop of width vscale x 2 costs: 3 (assuming a minimum vscale of 2).
23 ; GENERIC: LV: Vector loop of width vscale x 4 costs: 1 (assuming a minimum vscale of 2).
25 ; NEOVERSE-V1: LV: Vector loop of width vscale x 2 costs: 3 (assuming a minimum vscale of 2).
26 ; NEOVERSE-V1: LV: Vector loop of width vscale x 4 costs: 1 (assuming a minimum vscale of 2).
28 ; NEOVERSE-N2: LV: Vector loop of width vscale x 2 costs: 6 (assuming a minimum vscale of 1).
29 ; NEOVERSE-N2: LV: Vector loop of width vscale x 4 costs: 3 (assuming a minimum vscale of 1).
32 ; VF-VSCALE4: <16 x i32>
33 define void @test0(ptr %a, ptr %b, ptr %c) #0 {
38 %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]
39 %arrayidx = getelementptr inbounds i32, ptr %c, i64 %iv
40 %0 = load i32, ptr %arrayidx, align 4
41 %arrayidx2 = getelementptr inbounds i8, ptr %b, i64 %iv
42 %1 = load i8, ptr %arrayidx2, align 4
43 %zext = zext i8 %1 to i32
44 %add = add nsw i32 %zext, %0
45 %arrayidx5 = getelementptr inbounds i32, ptr %a, i64 %iv
46 store i32 %add, ptr %arrayidx5, align 4
47 %iv.next = add nuw nsw i64 %iv, 1
48 %exitcond.not = icmp eq i64 %iv.next, 1024
49 br i1 %exitcond.not, label %exit, label %loop