[TTI] getTypeBasedIntrinsicInstrCost - add basic handling for strided load/store...
[llvm-project.git] / llvm / test / Transforms / LoopVectorize / AArch64 / prefer-fixed-if-equal-to-scalable.ll
blob64f1b28d6828762e649a30bd0e8eb529fcb9b8ee
1 ; RUN: opt -S < %s -passes=loop-vectorize -mcpu=generic -mattr=+sve2 | FileCheck %s --check-prefix=CHECK-GENERIC
2 ; RUN: opt -S < %s -passes=loop-vectorize -mcpu=neoverse-v2 | FileCheck %s --check-prefix=CHECK-PREFERFIXED
3 ; RUN: opt -S < %s -passes=loop-vectorize -mcpu=cortex-x2 | FileCheck %s --check-prefix=CHECK-PREFERFIXED
4 ; RUN: opt -S < %s -passes=loop-vectorize -mcpu=cortex-x3 | FileCheck %s --check-prefix=CHECK-PREFERFIXED
5 ; RUN: opt -S < %s -passes=loop-vectorize -mcpu=cortex-x4 | FileCheck %s --check-prefix=CHECK-PREFERFIXED
6 ; RUN: opt -S < %s -passes=loop-vectorize -mcpu=cortex-x925 | FileCheck %s --check-prefix=CHECK-PREFERFIXED
8 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32"
9 target triple = "aarch64-unknown-linux-gnu"
11 @a = dso_local local_unnamed_addr global [32000 x float] zeroinitializer, align 64
12 @b = dso_local local_unnamed_addr global [32000 x float] zeroinitializer, align 64
14 define void @test() #0 {
15 ; CHECK-GENERIC-LABEL: define void @test(
16 ; CHECK-GENERIC:       store <vscale x 4 x float>
17 ; CHECK-PREFERFIXED-LABEL: define void @test(
18 ; CHECK-PREFERFIXED:       store <4 x float>
20 entry:
21   br label %for.body
23 for.cond.cleanup:
24   ret void
26 for.body:
27   %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
28   %arrayidx = getelementptr inbounds [32000 x float], ptr @a, i64 0, i64 %indvars.iv
29   %0 = load float, ptr %arrayidx, align 4
30   %arrayidx2 = getelementptr inbounds [32000 x float], ptr @b, i64 0, i64 %indvars.iv
31   %1 = load float, ptr %arrayidx2, align 4
32   %add = fadd fast float %1, %0
33   %2 = add nuw nsw i64 %indvars.iv, 16000
34   %arrayidx5 = getelementptr inbounds [32000 x float], ptr @a, i64 0, i64 %2
35   store float %add, ptr %arrayidx5, align 4
36   %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
37   %exitcond.not = icmp eq i64 %indvars.iv.next, 16000
38   br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
41 attributes #0 = { vscale_range(1,16) }