From: Simon Pilgrim Date: Thu, 10 Aug 2017 17:33:25 +0000 (+0000) Subject: [CostModel][X86] Add avx512vbmi broadcast/reverse/single-src shuffle cost tests X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=93a9cc077ccf6182ca31cbc272f4c8cd1f3f2109;p=llvm [CostModel][X86] Add avx512vbmi broadcast/reverse/single-src shuffle cost tests git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310633 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Analysis/CostModel/X86/shuffle-broadcast.ll b/test/Analysis/CostModel/X86/shuffle-broadcast.ll index 86cf7569a72..43bd8718ac4 100644 --- a/test/Analysis/CostModel/X86/shuffle-broadcast.ll +++ b/test/Analysis/CostModel/X86/shuffle-broadcast.ll @@ -4,7 +4,8 @@ ; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-unknown-linux-gnu -mattr=+avx | FileCheck %s -check-prefix=CHECK -check-prefix=AVX -check-prefix=AVX1 ; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-unknown-linux-gnu -mattr=+avx2 | FileCheck %s -check-prefix=CHECK -check-prefix=AVX -check-prefix=AVX2 ; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 --check-prefix=AVX512F -; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f,+avx512bw | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 --check-prefix=AVX512BW +; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f,+avx512bw | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 +; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f,+avx512bw,+avx512vbmi | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 ; ; Verify the cost model for broadcast shuffles. @@ -130,8 +131,7 @@ define void @test_vXi16(<8 x i16> %src128, <16 x i16> %src256, <32 x i16> %src51 ; SSE42: cost of 1 {{.*}} %V512 = shufflevector ; AVX1: cost of 3 {{.*}} %V512 = shufflevector ; AVX2: cost of 1 {{.*}} %V512 = shufflevector - ; AVX512F: cost of 1 {{.*}} %V512 = shufflevector - ; AVX512BW: cost of 1 {{.*}} %V512 = shufflevector + ; AVX512: cost of 1 {{.*}} %V512 = shufflevector %V512 = shufflevector <32 x i16> %src512, <32 x i16> undef, <32 x i32> zeroinitializer ret void @@ -159,8 +159,7 @@ define void @test_vXi8(<16 x i8> %src128, <32 x i8> %src256, <64 x i8> %src512) ; SSE42: cost of 1 {{.*}} %V512 = shufflevector ; AVX1: cost of 2 {{.*}} %V512 = shufflevector ; AVX2: cost of 1 {{.*}} %V512 = shufflevector - ; AVX512F: cost of 1 {{.*}} %V512 = shufflevector - ; AVX512BW: cost of 1 {{.*}} %V512 = shufflevector + ; AVX512: cost of 1 {{.*}} %V512 = shufflevector %V512 = shufflevector <64 x i8> %src512, <64 x i8> undef, <64 x i32> zeroinitializer ret void diff --git a/test/Analysis/CostModel/X86/shuffle-reverse.ll b/test/Analysis/CostModel/X86/shuffle-reverse.ll index 627d7985743..8be9f4626de 100644 --- a/test/Analysis/CostModel/X86/shuffle-reverse.ll +++ b/test/Analysis/CostModel/X86/shuffle-reverse.ll @@ -5,6 +5,7 @@ ; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-unknown-linux-gnu -mattr=+avx2 | FileCheck %s -check-prefix=CHECK -check-prefix=AVX -check-prefix=AVX2 ; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 --check-prefix=AVX512F ; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f,+avx512bw | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 --check-prefix=AVX512BW +; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f,+avx512bw,+avx512vbmi | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 --check-prefix=AVX512VBMI ; ; Verify the cost model for reverse shuffles. @@ -124,6 +125,7 @@ define void @test_vXi16(<8 x i16> %src128, <16 x i16> %src256, <32 x i16> %src51 ; AVX2: cost of 2 {{.*}} %V256 = shufflevector ; AVX512F: cost of 2 {{.*}} %V256 = shufflevector ; AVX512BW: cost of 1 {{.*}} %V256 = shufflevector + ; AVX512VBMI: cost of 1 {{.*}} %V256 = shufflevector %V256 = shufflevector <16 x i16> %src256, <16 x i16> undef, <16 x i32> ; SSE2: cost of 12 {{.*}} %V512 = shufflevector @@ -133,6 +135,7 @@ define void @test_vXi16(<8 x i16> %src128, <16 x i16> %src256, <32 x i16> %src51 ; AVX2: cost of 4 {{.*}} %V512 = shufflevector ; AVX512F: cost of 4 {{.*}} %V512 = shufflevector ; AVX512BW: cost of 1 {{.*}} %V512 = shufflevector + ; AVX512VBMI: cost of 1 {{.*}} %V512 = shufflevector %V512 = shufflevector <32 x i16> %src512, <32 x i16> undef, <32 x i32> ret void @@ -152,7 +155,9 @@ define void @test_vXi8(<16 x i8> %src128, <32 x i8> %src256, <64 x i8> %src512) ; SSE42: cost of 2 {{.*}} %V256 = shufflevector ; AVX1: cost of 4 {{.*}} %V256 = shufflevector ; AVX2: cost of 2 {{.*}} %V256 = shufflevector - ; AVX512: cost of 2 {{.*}} %V256 = shufflevector + ; AVX512F: cost of 2 {{.*}} %V256 = shufflevector + ; AVX512BW: cost of 2 {{.*}} %V256 = shufflevector + ; AVX512VBMI: cost of 1 {{.*}} %V256 = shufflevector %V256 = shufflevector <32 x i8> %src256, <32 x i8> undef, <32 x i32> ; SSE2: cost of 36 {{.*}} %V512 = shufflevector @@ -162,6 +167,7 @@ define void @test_vXi8(<16 x i8> %src128, <32 x i8> %src256, <64 x i8> %src512) ; AVX2: cost of 4 {{.*}} %V512 = shufflevector ; AVX512F: cost of 4 {{.*}} %V512 = shufflevector ; AVX512BW: cost of 2 {{.*}} %V512 = shufflevector + ; AVX512VBMI: cost of 1 {{.*}} %V512 = shufflevector %V512 = shufflevector <64 x i8> %src512, <64 x i8> undef, <64 x i32> ret void diff --git a/test/Analysis/CostModel/X86/shuffle-single-src.ll b/test/Analysis/CostModel/X86/shuffle-single-src.ll index d63632d085e..69e8e886a88 100644 --- a/test/Analysis/CostModel/X86/shuffle-single-src.ll +++ b/test/Analysis/CostModel/X86/shuffle-single-src.ll @@ -5,6 +5,7 @@ ; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-unknown-linux-gnu -mattr=+avx2 | FileCheck %s -check-prefix=CHECK -check-prefix=AVX -check-prefix=AVX2 ; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 --check-prefix=AVX512F ; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f,+avx512bw | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 --check-prefix=AVX512BW +; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f,+avx512bw,+avx512vbmi | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 --check-prefix=AVX512VBMI ; ; Verify the cost model for 1 src shuffles @@ -155,6 +156,7 @@ define void @test_vXi16(<8 x i16> %src128, <16 x i16> %src256, <32 x i16> %src51 ; AVX2: cost of 1 {{.*}} %V128 = shufflevector ; AVX512F: cost of 1 {{.*}} %V128 = shufflevector ; AVX512BW: cost of 1 {{.*}} %V128 = shufflevector + ; AVX512VBMI: cost of 1 {{.*}} %V128 = shufflevector %V128 = shufflevector <8 x i16> %src128, <8 x i16> undef, <8 x i32> ; SSE2: cost of 32 {{.*}} %V256 = shufflevector @@ -164,6 +166,7 @@ define void @test_vXi16(<8 x i16> %src128, <16 x i16> %src256, <32 x i16> %src51 ; AVX2: cost of 4 {{.*}} %V256 = shufflevector ; AVX512F: cost of 4 {{.*}} %V256 = shufflevector ; AVX512BW cost of 1 {{.*}} %V256 = shufflevector + ; AVX512VBMI cost of 1 {{.*}} %V256 = shufflevector %V256 = shufflevector <16 x i16> %src256, <16 x i16> undef, <16 x i32> ; SSE2: cost of 192 {{.*}} %V512 = shufflevector @@ -173,6 +176,7 @@ define void @test_vXi16(<8 x i16> %src128, <16 x i16> %src256, <32 x i16> %src51 ; AVX2: cost of 64 {{.*}} %V512 = shufflevector ; AVX512F: cost of 64 {{.*}} %V512 = shufflevector ; AVX512BW: cost of 1 {{.*}} %V512 = shufflevector + ; AVX512VBMI: cost of 1 {{.*}} %V512 = shufflevector %V512 = shufflevector <32 x i16> %src512, <32 x i16> undef, <32 x i32> ; SSE2: cost of 896 {{.*}} %V1024 = shufflevector @@ -182,6 +186,7 @@ define void @test_vXi16(<8 x i16> %src128, <16 x i16> %src256, <32 x i16> %src51 ; AVX2: cost of 384 {{.*}} %V1024 = shufflevector ; AVX512F: cost of 384 {{.*}} %V1024 = shufflevector ; AVX512BW: cost of 2 {{.*}} %V1024 = shufflevector + ; AVX512VBMI: cost of 2 {{.*}} %V1024 = shufflevector %V1024 = shufflevector <64 x i16> %src1024, <64 x i16> undef, <64 x i32> ret void } @@ -203,6 +208,7 @@ define void @test_vXi8(<16 x i8> %src128, <32 x i8> %src256, <64 x i8> %src512) ; AVX2: cost of 4 {{.*}} %V256 = shufflevector ; AVX512F: cost of 4 {{.*}} %V256 = shufflevector ; AVX512BW: cost of 3 {{.*}} %V256 = shufflevector + ; AVX512VBMI: cost of 1 {{.*}} %V256 = shufflevector %V256 = shufflevector <32 x i8> %src256, <32 x i8> undef, <32 x i32> ; SSE2: cost of 384 {{.*}} %V512 = shufflevector @@ -212,6 +218,7 @@ define void @test_vXi8(<16 x i8> %src128, <32 x i8> %src256, <64 x i8> %src512) ; AVX2: cost of 128 {{.*}} %V512 = shufflevector ; AVX512F: cost of 128 {{.*}} %V512 = shufflevector ; AVX512BW: cost of 8 {{.*}} %V512 = shufflevector + ; AVX512VBMI: cost of 1 {{.*}} %V512 = shufflevector %V512 = shufflevector <64 x i8> %src512, <64 x i8> undef, <64 x i32> ret void