From bddc04bc4cd5fed35b5fc10955612b6718696a95 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Tue, 28 Sep 2021 17:59:30 +0100 Subject: [PATCH] [CostModel][X86] Add SSE2/AVX1/AVX512BW test coverage for i16 interleaved load/store --- .../X86/interleaved-load-i16-stride-2.ll | 40 +++++++++++++++---- .../X86/interleaved-load-i16-stride-3.ll | 40 +++++++++++++++---- .../X86/interleaved-load-i16-stride-4.ll | 40 +++++++++++++++---- .../X86/interleaved-load-i16-stride-5.ll | 36 ++++++++++++++--- .../X86/interleaved-load-i16-stride-6.ll | 36 ++++++++++++++--- .../X86/interleaved-store-i16-stride-2.ll | 40 +++++++++++++++---- .../X86/interleaved-store-i16-stride-3.ll | 40 +++++++++++++++---- .../X86/interleaved-store-i16-stride-4.ll | 40 +++++++++++++++---- .../X86/interleaved-store-i16-stride-5.ll | 36 ++++++++++++++--- .../X86/interleaved-store-i16-stride-6.ll | 36 ++++++++++++++--- 10 files changed, 318 insertions(+), 66 deletions(-) diff --git a/llvm/test/Analysis/CostModel/X86/interleaved-load-i16-stride-2.ll b/llvm/test/Analysis/CostModel/X86/interleaved-load-i16-stride-2.ll index 845a43fd82d14..6cb3a41dc79d4 100644 --- a/llvm/test/Analysis/CostModel/X86/interleaved-load-i16-stride-2.ll +++ b/llvm/test/Analysis/CostModel/X86/interleaved-load-i16-stride-2.ll @@ -1,4 +1,7 @@ -; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+avx2 --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s +; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+sse2 --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,SSE2 +; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+avx --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,AVX1 +; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+avx2 --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,AVX2 +; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+avx512bw,+avx512vl --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,AVX512 ; REQUIRES: asserts target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" @@ -8,12 +11,35 @@ target triple = "x86_64-unknown-linux-gnu" @B = global [1024 x i8] zeroinitializer, align 128 ; CHECK: LV: Checking a loop in "test" -; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: %v0 = load i16, i16* %in0, align 2 -; CHECK: LV: Found an estimated cost of 3 for VF 2 For instruction: %v0 = load i16, i16* %in0, align 2 -; CHECK: LV: Found an estimated cost of 3 for VF 4 For instruction: %v0 = load i16, i16* %in0, align 2 -; CHECK: LV: Found an estimated cost of 7 for VF 8 For instruction: %v0 = load i16, i16* %in0, align 2 -; CHECK: LV: Found an estimated cost of 11 for VF 16 For instruction: %v0 = load i16, i16* %in0, align 2 -; CHECK: LV: Found an estimated cost of 22 for VF 32 For instruction: %v0 = load i16, i16* %in0, align 2 +; +; SSE2: LV: Found an estimated cost of 1 for VF 1 For instruction: %v0 = load i16, i16* %in0, align 2 +; SSE2: LV: Found an estimated cost of 9 for VF 2 For instruction: %v0 = load i16, i16* %in0, align 2 +; SSE2: LV: Found an estimated cost of 17 for VF 4 For instruction: %v0 = load i16, i16* %in0, align 2 +; SSE2: LV: Found an estimated cost of 34 for VF 8 For instruction: %v0 = load i16, i16* %in0, align 2 +; SSE2: LV: Found an estimated cost of 68 for VF 16 For instruction: %v0 = load i16, i16* %in0, align 2 +; +; AVX1: LV: Found an estimated cost of 1 for VF 1 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX1: LV: Found an estimated cost of 9 for VF 2 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX1: LV: Found an estimated cost of 17 for VF 4 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX1: LV: Found an estimated cost of 41 for VF 8 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX1: LV: Found an estimated cost of 114 for VF 16 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX1: LV: Found an estimated cost of 228 for VF 32 For instruction: %v0 = load i16, i16* %in0, align 2 +; +; AVX2: LV: Found an estimated cost of 1 for VF 1 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX2: LV: Found an estimated cost of 3 for VF 2 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX2: LV: Found an estimated cost of 3 for VF 4 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX2: LV: Found an estimated cost of 7 for VF 8 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX2: LV: Found an estimated cost of 11 for VF 16 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX2: LV: Found an estimated cost of 22 for VF 32 For instruction: %v0 = load i16, i16* %in0, align 2 +; +; AVX512: LV: Found an estimated cost of 1 for VF 1 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX512: LV: Found an estimated cost of 3 for VF 2 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX512: LV: Found an estimated cost of 3 for VF 4 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX512: LV: Found an estimated cost of 5 for VF 8 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX512: LV: Found an estimated cost of 5 for VF 16 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX512: LV: Found an estimated cost of 7 for VF 32 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX512: LV: Found an estimated cost of 34 for VF 64 For instruction: %v0 = load i16, i16* %in0, align 2 +; ; CHECK-NOT: LV: Found an estimated cost of {{[0-9]+}} for VF {{[0-9]+}} For instruction: %v0 = load i16, i16* %in0, align 2 define void @test() { diff --git a/llvm/test/Analysis/CostModel/X86/interleaved-load-i16-stride-3.ll b/llvm/test/Analysis/CostModel/X86/interleaved-load-i16-stride-3.ll index 945f903d73da1..7145ddfb6978b 100644 --- a/llvm/test/Analysis/CostModel/X86/interleaved-load-i16-stride-3.ll +++ b/llvm/test/Analysis/CostModel/X86/interleaved-load-i16-stride-3.ll @@ -1,4 +1,7 @@ -; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+avx2 --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s +; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+sse2 --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,SSE2 +; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+avx --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,AVX1 +; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+avx2 --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,AVX2 +; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+avx512bw,+avx512vl --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,AVX512 ; REQUIRES: asserts target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" @@ -8,12 +11,35 @@ target triple = "x86_64-unknown-linux-gnu" @B = global [1024 x i8] zeroinitializer, align 128 ; CHECK: LV: Checking a loop in "test" -; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: %v0 = load i16, i16* %in0, align 2 -; CHECK: LV: Found an estimated cost of 15 for VF 2 For instruction: %v0 = load i16, i16* %in0, align 2 -; CHECK: LV: Found an estimated cost of 31 for VF 4 For instruction: %v0 = load i16, i16* %in0, align 2 -; CHECK: LV: Found an estimated cost of 58 for VF 8 For instruction: %v0 = load i16, i16* %in0, align 2 -; CHECK: LV: Found an estimated cost of 171 for VF 16 For instruction: %v0 = load i16, i16* %in0, align 2 -; CHECK: LV: Found an estimated cost of 342 for VF 32 For instruction: %v0 = load i16, i16* %in0, align 2 +; +; SSE2: LV: Found an estimated cost of 1 for VF 1 For instruction: %v0 = load i16, i16* %in0, align 2 +; SSE2: LV: Found an estimated cost of 18 for VF 2 For instruction: %v0 = load i16, i16* %in0, align 2 +; SSE2: LV: Found an estimated cost of 26 for VF 4 For instruction: %v0 = load i16, i16* %in0, align 2 +; SSE2: LV: Found an estimated cost of 51 for VF 8 For instruction: %v0 = load i16, i16* %in0, align 2 +; SSE2: LV: Found an estimated cost of 102 for VF 16 For instruction: %v0 = load i16, i16* %in0, align 2 +; +; AVX1: LV: Found an estimated cost of 1 for VF 1 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX1: LV: Found an estimated cost of 15 for VF 2 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX1: LV: Found an estimated cost of 31 for VF 4 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX1: LV: Found an estimated cost of 58 for VF 8 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX1: LV: Found an estimated cost of 171 for VF 16 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX1: LV: Found an estimated cost of 342 for VF 32 For instruction: %v0 = load i16, i16* %in0, align 2 +; +; AVX2: LV: Found an estimated cost of 1 for VF 1 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX2: LV: Found an estimated cost of 15 for VF 2 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX2: LV: Found an estimated cost of 31 for VF 4 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX2: LV: Found an estimated cost of 58 for VF 8 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX2: LV: Found an estimated cost of 171 for VF 16 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX2: LV: Found an estimated cost of 342 for VF 32 For instruction: %v0 = load i16, i16* %in0, align 2 +; +; AVX512: LV: Found an estimated cost of 1 for VF 1 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX512: LV: Found an estimated cost of 4 for VF 2 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX512: LV: Found an estimated cost of 7 for VF 4 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX512: LV: Found an estimated cost of 7 for VF 8 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX512: LV: Found an estimated cost of 9 for VF 16 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX512: LV: Found an estimated cost of 18 for VF 32 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX512: LV: Found an estimated cost of 81 for VF 64 For instruction: %v0 = load i16, i16* %in0, align 2 +; ; CHECK-NOT: LV: Found an estimated cost of {{[0-9]+}} for VF {{[0-9]+}} For instruction: %v0 = load i16, i16* %in0, align 2 define void @test() { diff --git a/llvm/test/Analysis/CostModel/X86/interleaved-load-i16-stride-4.ll b/llvm/test/Analysis/CostModel/X86/interleaved-load-i16-stride-4.ll index 8998a3c1d1345..ef806e33bfb91 100644 --- a/llvm/test/Analysis/CostModel/X86/interleaved-load-i16-stride-4.ll +++ b/llvm/test/Analysis/CostModel/X86/interleaved-load-i16-stride-4.ll @@ -1,4 +1,7 @@ -; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+avx2 --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s +; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+sse2 --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,SSE2 +; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+avx --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,AVX1 +; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+avx2 --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,AVX2 +; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+avx512bw,+avx512vl --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,AVX512 ; REQUIRES: asserts target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" @@ -8,12 +11,35 @@ target triple = "x86_64-unknown-linux-gnu" @B = global [1024 x i8] zeroinitializer, align 128 ; CHECK: LV: Checking a loop in "test" -; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: %v0 = load i16, i16* %in0, align 2 -; CHECK: LV: Found an estimated cost of 7 for VF 2 For instruction: %v0 = load i16, i16* %in0, align 2 -; CHECK: LV: Found an estimated cost of 18 for VF 4 For instruction: %v0 = load i16, i16* %in0, align 2 -; CHECK: LV: Found an estimated cost of 35 for VF 8 For instruction: %v0 = load i16, i16* %in0, align 2 -; CHECK: LV: Found an estimated cost of 79 for VF 16 For instruction: %v0 = load i16, i16* %in0, align 2 -; CHECK: LV: Found an estimated cost of 158 for VF 32 For instruction: %v0 = load i16, i16* %in0, align 2 +; +; SSE2: LV: Found an estimated cost of 1 for VF 1 For instruction: %v0 = load i16, i16* %in0, align 2 +; SSE2: LV: Found an estimated cost of 17 for VF 2 For instruction: %v0 = load i16, i16* %in0, align 2 +; SSE2: LV: Found an estimated cost of 34 for VF 4 For instruction: %v0 = load i16, i16* %in0, align 2 +; SSE2: LV: Found an estimated cost of 68 for VF 8 For instruction: %v0 = load i16, i16* %in0, align 2 +; SSE2: LV: Found an estimated cost of 136 for VF 16 For instruction: %v0 = load i16, i16* %in0, align 2 +; +; AVX1: LV: Found an estimated cost of 1 for VF 1 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX1: LV: Found an estimated cost of 17 for VF 2 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX1: LV: Found an estimated cost of 41 for VF 4 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX1: LV: Found an estimated cost of 82 for VF 8 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX1: LV: Found an estimated cost of 228 for VF 16 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX1: LV: Found an estimated cost of 456 for VF 32 For instruction: %v0 = load i16, i16* %in0, align 2 +; +; AVX2: LV: Found an estimated cost of 1 for VF 1 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX2: LV: Found an estimated cost of 7 for VF 2 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX2: LV: Found an estimated cost of 18 for VF 4 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX2: LV: Found an estimated cost of 35 for VF 8 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX2: LV: Found an estimated cost of 79 for VF 16 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX2: LV: Found an estimated cost of 158 for VF 32 For instruction: %v0 = load i16, i16* %in0, align 2 +; +; AVX512: LV: Found an estimated cost of 1 for VF 1 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX512: LV: Found an estimated cost of 5 for VF 2 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX512: LV: Found an estimated cost of 9 for VF 4 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX512: LV: Found an estimated cost of 9 for VF 8 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX512: LV: Found an estimated cost of 12 for VF 16 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX512: LV: Found an estimated cost of 34 for VF 32 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX512: LV: Found an estimated cost of 148 for VF 64 For instruction: %v0 = load i16, i16* %in0, align 2 +; ; CHECK-NOT: LV: Found an estimated cost of {{[0-9]+}} for VF {{[0-9]+}} For instruction: %v0 = load i16, i16* %in0, align 2 define void @test() { diff --git a/llvm/test/Analysis/CostModel/X86/interleaved-load-i16-stride-5.ll b/llvm/test/Analysis/CostModel/X86/interleaved-load-i16-stride-5.ll index 308717d9f4198..86057c092bc3b 100644 --- a/llvm/test/Analysis/CostModel/X86/interleaved-load-i16-stride-5.ll +++ b/llvm/test/Analysis/CostModel/X86/interleaved-load-i16-stride-5.ll @@ -1,4 +1,7 @@ -; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+avx2 --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s +; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+sse2 --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,SSE2 +; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+avx --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,AVX1 +; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+avx2 --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,AVX2 +; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+avx512bw,+avx512vl --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,AVX512 ; REQUIRES: asserts target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" @@ -8,11 +11,32 @@ target triple = "x86_64-unknown-linux-gnu" @B = global [1024 x i8] zeroinitializer, align 128 ; CHECK: LV: Checking a loop in "test" -; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: %v0 = load i16, i16* %in0, align 2 -; CHECK: LV: Found an estimated cost of 26 for VF 2 For instruction: %v0 = load i16, i16* %in0, align 2 -; CHECK: LV: Found an estimated cost of 50 for VF 4 For instruction: %v0 = load i16, i16* %in0, align 2 -; CHECK: LV: Found an estimated cost of 99 for VF 8 For instruction: %v0 = load i16, i16* %in0, align 2 -; CHECK: LV: Found an estimated cost of 285 for VF 16 For instruction: %v0 = load i16, i16* %in0, align 2 +; +; SSE2: LV: Found an estimated cost of 1 for VF 1 For instruction: %v0 = load i16, i16* %in0, align 2 +; SSE2: LV: Found an estimated cost of 22 for VF 2 For instruction: %v0 = load i16, i16* %in0, align 2 +; SSE2: LV: Found an estimated cost of 43 for VF 4 For instruction: %v0 = load i16, i16* %in0, align 2 +; SSE2: LV: Found an estimated cost of 85 for VF 8 For instruction: %v0 = load i16, i16* %in0, align 2 +; +; AVX1: LV: Found an estimated cost of 1 for VF 1 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX1: LV: Found an estimated cost of 26 for VF 2 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX1: LV: Found an estimated cost of 50 for VF 4 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX1: LV: Found an estimated cost of 99 for VF 8 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX1: LV: Found an estimated cost of 285 for VF 16 For instruction: %v0 = load i16, i16* %in0, align 2 +; +; AVX2: LV: Found an estimated cost of 1 for VF 1 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX2: LV: Found an estimated cost of 26 for VF 2 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX2: LV: Found an estimated cost of 50 for VF 4 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX2: LV: Found an estimated cost of 99 for VF 8 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX2: LV: Found an estimated cost of 285 for VF 16 For instruction: %v0 = load i16, i16* %in0, align 2 +; +; AVX512: LV: Found an estimated cost of 1 for VF 1 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX512: LV: Found an estimated cost of 11 for VF 2 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX512: LV: Found an estimated cost of 11 for VF 4 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX512: LV: Found an estimated cost of 14 for VF 8 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX512: LV: Found an estimated cost of 28 for VF 16 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX512: LV: Found an estimated cost of 55 for VF 32 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX512: LV: Found an estimated cost of 235 for VF 64 For instruction: %v0 = load i16, i16* %in0, align 2 +; ; CHECK-NOT: LV: Found an estimated cost of {{[0-9]+}} for VF {{[0-9]+}} For instruction: %v0 = load i16, i16* %in0, align 2 define void @test() { diff --git a/llvm/test/Analysis/CostModel/X86/interleaved-load-i16-stride-6.ll b/llvm/test/Analysis/CostModel/X86/interleaved-load-i16-stride-6.ll index 4b837ecc8fe96..ec89a35c41e2d 100644 --- a/llvm/test/Analysis/CostModel/X86/interleaved-load-i16-stride-6.ll +++ b/llvm/test/Analysis/CostModel/X86/interleaved-load-i16-stride-6.ll @@ -1,4 +1,7 @@ -; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+avx2 --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s +; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+sse2 --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,SSE2 +; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+avx --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,AVX1 +; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+avx2 --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,AVX2 +; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+avx512bw,+avx512vl --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,AVX512 ; REQUIRES: asserts target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" @@ -8,11 +11,32 @@ target triple = "x86_64-unknown-linux-gnu" @B = global [1024 x i8] zeroinitializer, align 128 ; CHECK: LV: Checking a loop in "test" -; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: %v0 = load i16, i16* %in0, align 2 -; CHECK: LV: Found an estimated cost of 16 for VF 2 For instruction: %v0 = load i16, i16* %in0, align 2 -; CHECK: LV: Found an estimated cost of 11 for VF 4 For instruction: %v0 = load i16, i16* %in0, align 2 -; CHECK: LV: Found an estimated cost of 42 for VF 8 For instruction: %v0 = load i16, i16* %in0, align 2 -; CHECK: LV: Found an estimated cost of 112 for VF 16 For instruction: %v0 = load i16, i16* %in0, align 2 +; +; SSE2: LV: Found an estimated cost of 1 for VF 1 For instruction: %v0 = load i16, i16* %in0, align 2 +; SSE2: LV: Found an estimated cost of 26 for VF 2 For instruction: %v0 = load i16, i16* %in0, align 2 +; SSE2: LV: Found an estimated cost of 51 for VF 4 For instruction: %v0 = load i16, i16* %in0, align 2 +; SSE2: LV: Found an estimated cost of 102 for VF 8 For instruction: %v0 = load i16, i16* %in0, align 2 +; +; AVX1: LV: Found an estimated cost of 1 for VF 1 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX1: LV: Found an estimated cost of 31 for VF 2 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX1: LV: Found an estimated cost of 58 for VF 4 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX1: LV: Found an estimated cost of 123 for VF 8 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX1: LV: Found an estimated cost of 342 for VF 16 For instruction: %v0 = load i16, i16* %in0, align 2 +; +; AVX2: LV: Found an estimated cost of 1 for VF 1 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX2: LV: Found an estimated cost of 16 for VF 2 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX2: LV: Found an estimated cost of 11 for VF 4 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX2: LV: Found an estimated cost of 42 for VF 8 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX2: LV: Found an estimated cost of 112 for VF 16 For instruction: %v0 = load i16, i16* %in0, align 2 +; +; AVX512: LV: Found an estimated cost of 1 for VF 1 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX512: LV: Found an estimated cost of 13 for VF 2 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX512: LV: Found an estimated cost of 13 for VF 4 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX512: LV: Found an estimated cost of 17 for VF 8 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX512: LV: Found an estimated cost of 33 for VF 16 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX512: LV: Found an estimated cost of 81 for VF 32 For instruction: %v0 = load i16, i16* %in0, align 2 +; AVX512: LV: Found an estimated cost of 342 for VF 64 For instruction: %v0 = load i16, i16* %in0, align 2 +; ; CHECK-NOT: LV: Found an estimated cost of {{[0-9]+}} for VF {{[0-9]+}} For instruction: %v0 = load i16, i16* %in0, align 2 define void @test() { diff --git a/llvm/test/Analysis/CostModel/X86/interleaved-store-i16-stride-2.ll b/llvm/test/Analysis/CostModel/X86/interleaved-store-i16-stride-2.ll index 69f9999e7b316..e4f009adce767 100644 --- a/llvm/test/Analysis/CostModel/X86/interleaved-store-i16-stride-2.ll +++ b/llvm/test/Analysis/CostModel/X86/interleaved-store-i16-stride-2.ll @@ -1,4 +1,7 @@ -; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+avx2 --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s +; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+sse2 --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,SSE2 +; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+avx --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,AVX1 +; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+avx2 --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,AVX2 +; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+avx512bw,+avx512vl --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,AVX512 ; REQUIRES: asserts target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" @@ -8,12 +11,35 @@ target triple = "x86_64-unknown-linux-gnu" @B = global [1024 x i16] zeroinitializer, align 128 ; CHECK: LV: Checking a loop in "test" -; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: store i16 %v1, i16* %out1, align 2 -; CHECK: LV: Found an estimated cost of 2 for VF 2 For instruction: store i16 %v1, i16* %out1, align 2 -; CHECK: LV: Found an estimated cost of 2 for VF 4 For instruction: store i16 %v1, i16* %out1, align 2 -; CHECK: LV: Found an estimated cost of 4 for VF 8 For instruction: store i16 %v1, i16* %out1, align 2 -; CHECK: LV: Found an estimated cost of 6 for VF 16 For instruction: store i16 %v1, i16* %out1, align 2 -; CHECK: LV: Found an estimated cost of 12 for VF 32 For instruction: store i16 %v1, i16* %out1, align 2 +; +; SSE2: LV: Found an estimated cost of 1 for VF 1 For instruction: store i16 %v1, i16* %out1, align 2 +; SSE2: LV: Found an estimated cost of 9 for VF 2 For instruction: store i16 %v1, i16* %out1, align 2 +; SSE2: LV: Found an estimated cost of 17 for VF 4 For instruction: store i16 %v1, i16* %out1, align 2 +; SSE2: LV: Found an estimated cost of 34 for VF 8 For instruction: store i16 %v1, i16* %out1, align 2 +; SSE2: LV: Found an estimated cost of 68 for VF 16 For instruction: store i16 %v1, i16* %out1, align 2 +; +; AVX1: LV: Found an estimated cost of 1 for VF 1 For instruction: store i16 %v1, i16* %out1, align 2 +; AVX1: LV: Found an estimated cost of 9 for VF 2 For instruction: store i16 %v1, i16* %out1, align 2 +; AVX1: LV: Found an estimated cost of 17 for VF 4 For instruction: store i16 %v1, i16* %out1, align 2 +; AVX1: LV: Found an estimated cost of 49 for VF 8 For instruction: store i16 %v1, i16* %out1, align 2 +; AVX1: LV: Found an estimated cost of 114 for VF 16 For instruction: store i16 %v1, i16* %out1, align 2 +; AVX1: LV: Found an estimated cost of 228 for VF 32 For instruction: store i16 %v1, i16* %out1, align 2 +; +; AVX2: LV: Found an estimated cost of 1 for VF 1 For instruction: store i16 %v1, i16* %out1, align 2 +; AVX2: LV: Found an estimated cost of 2 for VF 2 For instruction: store i16 %v1, i16* %out1, align 2 +; AVX2: LV: Found an estimated cost of 2 for VF 4 For instruction: store i16 %v1, i16* %out1, align 2 +; AVX2: LV: Found an estimated cost of 4 for VF 8 For instruction: store i16 %v1, i16* %out1, align 2 +; AVX2: LV: Found an estimated cost of 6 for VF 16 For instruction: store i16 %v1, i16* %out1, align 2 +; AVX2: LV: Found an estimated cost of 12 for VF 32 For instruction: store i16 %v1, i16* %out1, align 2 +; +; AVX512: LV: Found an estimated cost of 1 for VF 1 For instruction: store i16 %v1, i16* %out1, align 2 +; AVX512: LV: Found an estimated cost of 3 for VF 2 For instruction: store i16 %v1, i16* %out1, align 2 +; AVX512: LV: Found an estimated cost of 3 for VF 4 For instruction: store i16 %v1, i16* %out1, align 2 +; AVX512: LV: Found an estimated cost of 3 for VF 8 For instruction: store i16 %v1, i16* %out1, align 2 +; AVX512: LV: Found an estimated cost of 3 for VF 16 For instruction: store i16 %v1, i16* %out1, align 2 +; AVX512: LV: Found an estimated cost of 7 for VF 32 For instruction: store i16 %v1, i16* %out1, align 2 +; AVX512: LV: Found an estimated cost of 14 for VF 64 For instruction: store i16 %v1, i16* %out1, align 2 +; ; CHECK-NOT: LV: Found an estimated cost of {{[0-9]+}} for VF {{[0-9]+}} For instruction: store i16 %v1, i16* %out1, align 2 define void @test() { diff --git a/llvm/test/Analysis/CostModel/X86/interleaved-store-i16-stride-3.ll b/llvm/test/Analysis/CostModel/X86/interleaved-store-i16-stride-3.ll index 4235d8f13db33..5d002b42cf496 100644 --- a/llvm/test/Analysis/CostModel/X86/interleaved-store-i16-stride-3.ll +++ b/llvm/test/Analysis/CostModel/X86/interleaved-store-i16-stride-3.ll @@ -1,4 +1,7 @@ -; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+avx2 --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s +; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+sse2 --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,SSE2 +; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+avx --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,AVX1 +; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+avx2 --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,AVX2 +; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+avx512bw,+avx512vl --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,AVX512 ; REQUIRES: asserts target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" @@ -8,12 +11,35 @@ target triple = "x86_64-unknown-linux-gnu" @B = global [1024 x i16] zeroinitializer, align 128 ; CHECK: LV: Checking a loop in "test" -; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: store i16 %v2, i16* %out2, align 2 -; CHECK: LV: Found an estimated cost of 15 for VF 2 For instruction: store i16 %v2, i16* %out2, align 2 -; CHECK: LV: Found an estimated cost of 35 for VF 4 For instruction: store i16 %v2, i16* %out2, align 2 -; CHECK: LV: Found an estimated cost of 66 for VF 8 For instruction: store i16 %v2, i16* %out2, align 2 -; CHECK: LV: Found an estimated cost of 171 for VF 16 For instruction: store i16 %v2, i16* %out2, align 2 -; CHECK: LV: Found an estimated cost of 342 for VF 32 For instruction: store i16 %v2, i16* %out2, align 2 +; +; SSE2: LV: Found an estimated cost of 1 for VF 1 For instruction: store i16 %v2, i16* %out2, align 2 +; SSE2: LV: Found an estimated cost of 16 for VF 2 For instruction: store i16 %v2, i16* %out2, align 2 +; SSE2: LV: Found an estimated cost of 26 for VF 4 For instruction: store i16 %v2, i16* %out2, align 2 +; SSE2: LV: Found an estimated cost of 51 for VF 8 For instruction: store i16 %v2, i16* %out2, align 2 +; SSE2: LV: Found an estimated cost of 102 for VF 16 For instruction: store i16 %v2, i16* %out2, align 2 +; +; AVX1: LV: Found an estimated cost of 1 for VF 1 For instruction: store i16 %v2, i16* %out2, align 2 +; AVX1: LV: Found an estimated cost of 15 for VF 2 For instruction: store i16 %v2, i16* %out2, align 2 +; AVX1: LV: Found an estimated cost of 35 for VF 4 For instruction: store i16 %v2, i16* %out2, align 2 +; AVX1: LV: Found an estimated cost of 66 for VF 8 For instruction: store i16 %v2, i16* %out2, align 2 +; AVX1: LV: Found an estimated cost of 171 for VF 16 For instruction: store i16 %v2, i16* %out2, align 2 +; AVX1: LV: Found an estimated cost of 342 for VF 32 For instruction: store i16 %v2, i16* %out2, align 2 +; +; AVX2: LV: Found an estimated cost of 1 for VF 1 For instruction: store i16 %v2, i16* %out2, align 2 +; AVX2: LV: Found an estimated cost of 15 for VF 2 For instruction: store i16 %v2, i16* %out2, align 2 +; AVX2: LV: Found an estimated cost of 35 for VF 4 For instruction: store i16 %v2, i16* %out2, align 2 +; AVX2: LV: Found an estimated cost of 66 for VF 8 For instruction: store i16 %v2, i16* %out2, align 2 +; AVX2: LV: Found an estimated cost of 171 for VF 16 For instruction: store i16 %v2, i16* %out2, align 2 +; AVX2: LV: Found an estimated cost of 342 for VF 32 For instruction: store i16 %v2, i16* %out2, align 2 +; +; AVX512: LV: Found an estimated cost of 1 for VF 1 For instruction: store i16 %v2, i16* %out2, align 2 +; AVX512: LV: Found an estimated cost of 6 for VF 2 For instruction: store i16 %v2, i16* %out2, align 2 +; AVX512: LV: Found an estimated cost of 6 for VF 4 For instruction: store i16 %v2, i16* %out2, align 2 +; AVX512: LV: Found an estimated cost of 6 for VF 8 For instruction: store i16 %v2, i16* %out2, align 2 +; AVX512: LV: Found an estimated cost of 12 for VF 16 For instruction: store i16 %v2, i16* %out2, align 2 +; AVX512: LV: Found an estimated cost of 18 for VF 32 For instruction: store i16 %v2, i16* %out2, align 2 +; AVX512: LV: Found an estimated cost of 36 for VF 64 For instruction: store i16 %v2, i16* %out2, align 2 +; ; CHECK-NOT: LV: Found an estimated cost of {{[0-9]+}} for VF {{[0-9]+}} For instruction: store i16 %v2, i16* %out2, align 2 define void @test() { diff --git a/llvm/test/Analysis/CostModel/X86/interleaved-store-i16-stride-4.ll b/llvm/test/Analysis/CostModel/X86/interleaved-store-i16-stride-4.ll index 7d9c1f1a0f4d2..94d8c24c16f3f 100644 --- a/llvm/test/Analysis/CostModel/X86/interleaved-store-i16-stride-4.ll +++ b/llvm/test/Analysis/CostModel/X86/interleaved-store-i16-stride-4.ll @@ -1,4 +1,7 @@ -; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+avx2 --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s +; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+sse2 --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,SSE2 +; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+avx --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,AVX1 +; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+avx2 --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,AVX2 +; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+avx512bw,+avx512vl --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,AVX512 ; REQUIRES: asserts target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" @@ -8,12 +11,35 @@ target triple = "x86_64-unknown-linux-gnu" @B = global [1024 x i16] zeroinitializer, align 128 ; CHECK: LV: Checking a loop in "test" -; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: store i16 %v3, i16* %out3, align 2 -; CHECK: LV: Found an estimated cost of 3 for VF 2 For instruction: store i16 %v3, i16* %out3, align 2 -; CHECK: LV: Found an estimated cost of 7 for VF 4 For instruction: store i16 %v3, i16* %out3, align 2 -; CHECK: LV: Found an estimated cost of 12 for VF 8 For instruction: store i16 %v3, i16* %out3, align 2 -; CHECK: LV: Found an estimated cost of 36 for VF 16 For instruction: store i16 %v3, i16* %out3, align 2 -; CHECK: LV: Found an estimated cost of 72 for VF 32 For instruction: store i16 %v3, i16* %out3, align 2 +; +; SSE2: LV: Found an estimated cost of 1 for VF 1 For instruction: store i16 %v3, i16* %out3, align 2 +; SSE2: LV: Found an estimated cost of 17 for VF 2 For instruction: store i16 %v3, i16* %out3, align 2 +; SSE2: LV: Found an estimated cost of 34 for VF 4 For instruction: store i16 %v3, i16* %out3, align 2 +; SSE2: LV: Found an estimated cost of 68 for VF 8 For instruction: store i16 %v3, i16* %out3, align 2 +; SSE2: LV: Found an estimated cost of 136 for VF 16 For instruction: store i16 %v3, i16* %out3, align 2 +; +; AVX1: LV: Found an estimated cost of 1 for VF 1 For instruction: store i16 %v3, i16* %out3, align 2 +; AVX1: LV: Found an estimated cost of 17 for VF 2 For instruction: store i16 %v3, i16* %out3, align 2 +; AVX1: LV: Found an estimated cost of 49 for VF 4 For instruction: store i16 %v3, i16* %out3, align 2 +; AVX1: LV: Found an estimated cost of 98 for VF 8 For instruction: store i16 %v3, i16* %out3, align 2 +; AVX1: LV: Found an estimated cost of 228 for VF 16 For instruction: store i16 %v3, i16* %out3, align 2 +; AVX1: LV: Found an estimated cost of 456 for VF 32 For instruction: store i16 %v3, i16* %out3, align 2 +; +; AVX2: LV: Found an estimated cost of 1 for VF 1 For instruction: store i16 %v3, i16* %out3, align 2 +; AVX2: LV: Found an estimated cost of 3 for VF 2 For instruction: store i16 %v3, i16* %out3, align 2 +; AVX2: LV: Found an estimated cost of 7 for VF 4 For instruction: store i16 %v3, i16* %out3, align 2 +; AVX2: LV: Found an estimated cost of 12 for VF 8 For instruction: store i16 %v3, i16* %out3, align 2 +; AVX2: LV: Found an estimated cost of 36 for VF 16 For instruction: store i16 %v3, i16* %out3, align 2 +; AVX2: LV: Found an estimated cost of 72 for VF 32 For instruction: store i16 %v3, i16* %out3, align 2 +; +; AVX512: LV: Found an estimated cost of 1 for VF 1 For instruction: store i16 %v3, i16* %out3, align 2 +; AVX512: LV: Found an estimated cost of 8 for VF 2 For instruction: store i16 %v3, i16* %out3, align 2 +; AVX512: LV: Found an estimated cost of 8 for VF 4 For instruction: store i16 %v3, i16* %out3, align 2 +; AVX512: LV: Found an estimated cost of 8 for VF 8 For instruction: store i16 %v3, i16* %out3, align 2 +; AVX512: LV: Found an estimated cost of 17 for VF 16 For instruction: store i16 %v3, i16* %out3, align 2 +; AVX512: LV: Found an estimated cost of 34 for VF 32 For instruction: store i16 %v3, i16* %out3, align 2 +; AVX512: LV: Found an estimated cost of 68 for VF 64 For instruction: store i16 %v3, i16* %out3, align 2 +; ; CHECK-NOT: LV: Found an estimated cost of {{[0-9]+}} for VF {{[0-9]+}} For instruction: store i16 %v3, i16* %out3, align 2 define void @test() { diff --git a/llvm/test/Analysis/CostModel/X86/interleaved-store-i16-stride-5.ll b/llvm/test/Analysis/CostModel/X86/interleaved-store-i16-stride-5.ll index e0899f2646ee1..8a62afafcbda8 100644 --- a/llvm/test/Analysis/CostModel/X86/interleaved-store-i16-stride-5.ll +++ b/llvm/test/Analysis/CostModel/X86/interleaved-store-i16-stride-5.ll @@ -1,4 +1,7 @@ -; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+avx2 --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s +; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+sse2 --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,SSE2 +; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+avx --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,AVX1 +; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+avx2 --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,AVX2 +; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+avx512bw,+avx512vl --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,AVX512 ; REQUIRES: asserts target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" @@ -8,11 +11,32 @@ target triple = "x86_64-unknown-linux-gnu" @B = global [1024 x i16] zeroinitializer, align 128 ; CHECK: LV: Checking a loop in "test" -; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: store i16 %v4, i16* %out4, align 2 -; CHECK: LV: Found an estimated cost of 28 for VF 2 For instruction: store i16 %v4, i16* %out4, align 2 -; CHECK: LV: Found an estimated cost of 58 for VF 4 For instruction: store i16 %v4, i16* %out4, align 2 -; CHECK: LV: Found an estimated cost of 115 for VF 8 For instruction: store i16 %v4, i16* %out4, align 2 -; CHECK: LV: Found an estimated cost of 285 for VF 16 For instruction: store i16 %v4, i16* %out4, align 2 +; +; SSE2: LV: Found an estimated cost of 1 for VF 1 For instruction: store i16 %v4, i16* %out4, align 2 +; SSE2: LV: Found an estimated cost of 22 for VF 2 For instruction: store i16 %v4, i16* %out4, align 2 +; SSE2: LV: Found an estimated cost of 43 for VF 4 For instruction: store i16 %v4, i16* %out4, align 2 +; SSE2: LV: Found an estimated cost of 85 for VF 8 For instruction: store i16 %v4, i16* %out4, align 2 +; +; AVX1: LV: Found an estimated cost of 1 for VF 1 For instruction: store i16 %v4, i16* %out4, align 2 +; AVX1: LV: Found an estimated cost of 28 for VF 2 For instruction: store i16 %v4, i16* %out4, align 2 +; AVX1: LV: Found an estimated cost of 58 for VF 4 For instruction: store i16 %v4, i16* %out4, align 2 +; AVX1: LV: Found an estimated cost of 115 for VF 8 For instruction: store i16 %v4, i16* %out4, align 2 +; AVX1: LV: Found an estimated cost of 285 for VF 16 For instruction: store i16 %v4, i16* %out4, align 2 +; +; AVX2: LV: Found an estimated cost of 1 for VF 1 For instruction: store i16 %v4, i16* %out4, align 2 +; AVX2: LV: Found an estimated cost of 28 for VF 2 For instruction: store i16 %v4, i16* %out4, align 2 +; AVX2: LV: Found an estimated cost of 58 for VF 4 For instruction: store i16 %v4, i16* %out4, align 2 +; AVX2: LV: Found an estimated cost of 115 for VF 8 For instruction: store i16 %v4, i16* %out4, align 2 +; AVX2: LV: Found an estimated cost of 285 for VF 16 For instruction: store i16 %v4, i16* %out4, align 2 +; +; AVX512: LV: Found an estimated cost of 1 for VF 1 For instruction: store i16 %v4, i16* %out4, align 2 +; AVX512: LV: Found an estimated cost of 11 for VF 2 For instruction: store i16 %v4, i16* %out4, align 2 +; AVX512: LV: Found an estimated cost of 11 for VF 4 For instruction: store i16 %v4, i16* %out4, align 2 +; AVX512: LV: Found an estimated cost of 22 for VF 8 For instruction: store i16 %v4, i16* %out4, align 2 +; AVX512: LV: Found an estimated cost of 33 for VF 16 For instruction: store i16 %v4, i16* %out4, align 2 +; AVX512: LV: Found an estimated cost of 55 for VF 32 For instruction: store i16 %v4, i16* %out4, align 2 +; AVX512: LV: Found an estimated cost of 110 for VF 64 For instruction: store i16 %v4, i16* %out4, align 2 +; ; CHECK-NOT: LV: Found an estimated cost of {{[0-9]+}} for VF {{[0-9]+}} For instruction: store i16 %v4, i16* %out4, align 2 define void @test() { diff --git a/llvm/test/Analysis/CostModel/X86/interleaved-store-i16-stride-6.ll b/llvm/test/Analysis/CostModel/X86/interleaved-store-i16-stride-6.ll index 6bc8c8058c541..6a68e443f2c51 100644 --- a/llvm/test/Analysis/CostModel/X86/interleaved-store-i16-stride-6.ll +++ b/llvm/test/Analysis/CostModel/X86/interleaved-store-i16-stride-6.ll @@ -1,4 +1,7 @@ -; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+avx2 --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s +; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+sse2 --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,SSE2 +; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+avx --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,AVX1 +; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+avx2 --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,AVX2 +; RUN: opt -loop-vectorize -vectorizer-maximize-bandwidth -S -mattr=+avx512bw,+avx512vl --debug-only=loop-vectorize < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,AVX512 ; REQUIRES: asserts target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" @@ -8,11 +11,32 @@ target triple = "x86_64-unknown-linux-gnu" @B = global [1024 x i16] zeroinitializer, align 128 ; CHECK: LV: Checking a loop in "test" -; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: store i16 %v5, i16* %out5, align 2 -; CHECK: LV: Found an estimated cost of 13 for VF 2 For instruction: store i16 %v5, i16* %out5, align 2 -; CHECK: LV: Found an estimated cost of 17 for VF 4 For instruction: store i16 %v5, i16* %out5, align 2 -; CHECK: LV: Found an estimated cost of 24 for VF 8 For instruction: store i16 %v5, i16* %out5, align 2 -; CHECK: LV: Found an estimated cost of 64 for VF 16 For instruction: store i16 %v5, i16* %out5, align 2 +; +; SSE2: LV: Found an estimated cost of 1 for VF 1 For instruction: store i16 %v5, i16* %out5, align 2 +; SSE2: LV: Found an estimated cost of 26 for VF 2 For instruction: store i16 %v5, i16* %out5, align 2 +; SSE2: LV: Found an estimated cost of 51 for VF 4 For instruction: store i16 %v5, i16* %out5, align 2 +; SSE2: LV: Found an estimated cost of 102 for VF 8 For instruction: store i16 %v5, i16* %out5, align 2 +; +; AVX1: LV: Found an estimated cost of 1 for VF 1 For instruction: store i16 %v5, i16* %out5, align 2 +; AVX1: LV: Found an estimated cost of 35 for VF 2 For instruction: store i16 %v5, i16* %out5, align 2 +; AVX1: LV: Found an estimated cost of 66 for VF 4 For instruction: store i16 %v5, i16* %out5, align 2 +; AVX1: LV: Found an estimated cost of 147 for VF 8 For instruction: store i16 %v5, i16* %out5, align 2 +; AVX1: LV: Found an estimated cost of 342 for VF 16 For instruction: store i16 %v5, i16* %out5, align 2 +; +; AVX2: LV: Found an estimated cost of 1 for VF 1 For instruction: store i16 %v5, i16* %out5, align 2 +; AVX2: LV: Found an estimated cost of 13 for VF 2 For instruction: store i16 %v5, i16* %out5, align 2 +; AVX2: LV: Found an estimated cost of 17 for VF 4 For instruction: store i16 %v5, i16* %out5, align 2 +; AVX2: LV: Found an estimated cost of 24 for VF 8 For instruction: store i16 %v5, i16* %out5, align 2 +; AVX2: LV: Found an estimated cost of 64 for VF 16 For instruction: store i16 %v5, i16* %out5, align 2 +; +; AVX512: LV: Found an estimated cost of 1 for VF 1 For instruction: store i16 %v5, i16* %out5, align 2 +; AVX512: LV: Found an estimated cost of 13 for VF 2 For instruction: store i16 %v5, i16* %out5, align 2 +; AVX512: LV: Found an estimated cost of 13 for VF 4 For instruction: store i16 %v5, i16* %out5, align 2 +; AVX512: LV: Found an estimated cost of 27 for VF 8 For instruction: store i16 %v5, i16* %out5, align 2 +; AVX512: LV: Found an estimated cost of 40 for VF 16 For instruction: store i16 %v5, i16* %out5, align 2 +; AVX512: LV: Found an estimated cost of 81 for VF 32 For instruction: store i16 %v5, i16* %out5, align 2 +; AVX512: LV: Found an estimated cost of 162 for VF 64 For instruction: store i16 %v5, i16* %out5, align 2 +; ; CHECK-NOT: LV: Found an estimated cost of {{[0-9]+}} for VF {{[0-9]+}} For instruction: store i16 %v5, i16* %out5, align 2 define void @test() {