Skip to content

Commit 93a9cc0

Browse files
committed
[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
1 parent b0b94e1 commit 93a9cc0

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

test/Analysis/CostModel/X86/shuffle-broadcast.ll

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
; 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
55
; 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
66
; 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
7-
; 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
7+
; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f,+avx512bw | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512
8+
; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f,+avx512bw,+avx512vbmi | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512
89

910
;
1011
; 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
130131
; SSE42: cost of 1 {{.*}} %V512 = shufflevector
131132
; AVX1: cost of 3 {{.*}} %V512 = shufflevector
132133
; AVX2: cost of 1 {{.*}} %V512 = shufflevector
133-
; AVX512F: cost of 1 {{.*}} %V512 = shufflevector
134-
; AVX512BW: cost of 1 {{.*}} %V512 = shufflevector
134+
; AVX512: cost of 1 {{.*}} %V512 = shufflevector
135135
%V512 = shufflevector <32 x i16> %src512, <32 x i16> undef, <32 x i32> zeroinitializer
136136

137137
ret void
@@ -159,8 +159,7 @@ define void @test_vXi8(<16 x i8> %src128, <32 x i8> %src256, <64 x i8> %src512)
159159
; SSE42: cost of 1 {{.*}} %V512 = shufflevector
160160
; AVX1: cost of 2 {{.*}} %V512 = shufflevector
161161
; AVX2: cost of 1 {{.*}} %V512 = shufflevector
162-
; AVX512F: cost of 1 {{.*}} %V512 = shufflevector
163-
; AVX512BW: cost of 1 {{.*}} %V512 = shufflevector
162+
; AVX512: cost of 1 {{.*}} %V512 = shufflevector
164163
%V512 = shufflevector <64 x i8> %src512, <64 x i8> undef, <64 x i32> zeroinitializer
165164

166165
ret void

test/Analysis/CostModel/X86/shuffle-reverse.ll

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
; 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
66
; 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
77
; 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
8+
; 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
89

910
;
1011
; 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
124125
; AVX2: cost of 2 {{.*}} %V256 = shufflevector
125126
; AVX512F: cost of 2 {{.*}} %V256 = shufflevector
126127
; AVX512BW: cost of 1 {{.*}} %V256 = shufflevector
128+
; AVX512VBMI: cost of 1 {{.*}} %V256 = shufflevector
127129
%V256 = shufflevector <16 x i16> %src256, <16 x i16> undef, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
128130

129131
; 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
133135
; AVX2: cost of 4 {{.*}} %V512 = shufflevector
134136
; AVX512F: cost of 4 {{.*}} %V512 = shufflevector
135137
; AVX512BW: cost of 1 {{.*}} %V512 = shufflevector
138+
; AVX512VBMI: cost of 1 {{.*}} %V512 = shufflevector
136139
%V512 = shufflevector <32 x i16> %src512, <32 x i16> undef, <32 x i32> <i32 31, i32 30, i32 29, i32 28, i32 27, i32 26, i32 25, i32 24, i32 23, i32 22, i32 21, i32 20, i32 19, i32 18, i32 17, i32 16, i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
137140

138141
ret void
@@ -152,7 +155,9 @@ define void @test_vXi8(<16 x i8> %src128, <32 x i8> %src256, <64 x i8> %src512)
152155
; SSE42: cost of 2 {{.*}} %V256 = shufflevector
153156
; AVX1: cost of 4 {{.*}} %V256 = shufflevector
154157
; AVX2: cost of 2 {{.*}} %V256 = shufflevector
155-
; AVX512: cost of 2 {{.*}} %V256 = shufflevector
158+
; AVX512F: cost of 2 {{.*}} %V256 = shufflevector
159+
; AVX512BW: cost of 2 {{.*}} %V256 = shufflevector
160+
; AVX512VBMI: cost of 1 {{.*}} %V256 = shufflevector
156161
%V256 = shufflevector <32 x i8> %src256, <32 x i8> undef, <32 x i32> <i32 31, i32 30, i32 29, i32 28, i32 27, i32 26, i32 25, i32 24, i32 23, i32 22, i32 21, i32 20, i32 19, i32 18, i32 17, i32 16, i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
157162

158163
; 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)
162167
; AVX2: cost of 4 {{.*}} %V512 = shufflevector
163168
; AVX512F: cost of 4 {{.*}} %V512 = shufflevector
164169
; AVX512BW: cost of 2 {{.*}} %V512 = shufflevector
170+
; AVX512VBMI: cost of 1 {{.*}} %V512 = shufflevector
165171
%V512 = shufflevector <64 x i8> %src512, <64 x i8> undef, <64 x i32> <i32 63, i32 62, i32 61, i32 60, i32 59, i32 58, i32 57, i32 56, i32 55, i32 54, i32 53, i32 52, i32 51, i32 50, i32 49, i32 48, i32 47, i32 46, i32 45, i32 44, i32 43, i32 42, i32 41, i32 40, i32 39, i32 38, i32 37, i32 36, i32 35, i32 34, i32 33, i32 32, i32 31, i32 30, i32 29, i32 28, i32 27, i32 26, i32 25, i32 24, i32 23, i32 22, i32 21, i32 20, i32 19, i32 18, i32 17, i32 16, i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
166172

167173
ret void

test/Analysis/CostModel/X86/shuffle-single-src.ll

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
; 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
66
; 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
77
; 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
8+
; 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
89

910
;
1011
; 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
155156
; AVX2: cost of 1 {{.*}} %V128 = shufflevector
156157
; AVX512F: cost of 1 {{.*}} %V128 = shufflevector
157158
; AVX512BW: cost of 1 {{.*}} %V128 = shufflevector
159+
; AVX512VBMI: cost of 1 {{.*}} %V128 = shufflevector
158160
%V128 = shufflevector <8 x i16> %src128, <8 x i16> undef, <8 x i32> <i32 7, i32 6, i32 6, i32 4, i32 3, i32 2, i32 1, i32 0>
159161

160162
; 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
164166
; AVX2: cost of 4 {{.*}} %V256 = shufflevector
165167
; AVX512F: cost of 4 {{.*}} %V256 = shufflevector
166168
; AVX512BW cost of 1 {{.*}} %V256 = shufflevector
169+
; AVX512VBMI cost of 1 {{.*}} %V256 = shufflevector
167170
%V256 = shufflevector <16 x i16> %src256, <16 x i16> undef, <16 x i32> <i32 15, i32 14, i32 13, i32 13, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
168171

169172
; 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
173176
; AVX2: cost of 64 {{.*}} %V512 = shufflevector
174177
; AVX512F: cost of 64 {{.*}} %V512 = shufflevector
175178
; AVX512BW: cost of 1 {{.*}} %V512 = shufflevector
179+
; AVX512VBMI: cost of 1 {{.*}} %V512 = shufflevector
176180
%V512 = shufflevector <32 x i16> %src512, <32 x i16> undef, <32 x i32> <i32 31, i32 30, i32 20, i32 28, i32 27, i32 26, i32 25, i32 24, i32 23, i32 22, i32 21, i32 20, i32 19, i32 18, i32 17, i32 16, i32 15, i32 14, i32 13, i32 12, i32 11, i32 11, i32 9, i32 8, i32 7, i32 11, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
177181

178182
; 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
182186
; AVX2: cost of 384 {{.*}} %V1024 = shufflevector
183187
; AVX512F: cost of 384 {{.*}} %V1024 = shufflevector
184188
; AVX512BW: cost of 2 {{.*}} %V1024 = shufflevector
189+
; AVX512VBMI: cost of 2 {{.*}} %V1024 = shufflevector
185190
%V1024 = shufflevector <64 x i16> %src1024, <64 x i16> undef, <64 x i32> <i32 63, i32 62, i32 61, i32 60, i32 59, i32 58, i32 57, i32 56, i32 55, i32 54, i32 53, i32 52, i32 51, i32 50, i32 49, i32 48, i32 47, i32 46, i32 45, i32 44, i32 43, i32 42, i32 41, i32 40, i32 39, i32 38, i32 37, i32 36, i32 35, i32 34, i32 33, i32 32, i32 31, i32 30, i32 29, i32 28, i32 27, i32 26, i32 25, i32 24, i32 23, i32 20, i32 21, i32 20, i32 19, i32 18, i32 17, i32 16, i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
186191
ret void
187192
}
@@ -203,6 +208,7 @@ define void @test_vXi8(<16 x i8> %src128, <32 x i8> %src256, <64 x i8> %src512)
203208
; AVX2: cost of 4 {{.*}} %V256 = shufflevector
204209
; AVX512F: cost of 4 {{.*}} %V256 = shufflevector
205210
; AVX512BW: cost of 3 {{.*}} %V256 = shufflevector
211+
; AVX512VBMI: cost of 1 {{.*}} %V256 = shufflevector
206212
%V256 = shufflevector <32 x i8> %src256, <32 x i8> undef, <32 x i32> <i32 31, i32 30, i32 29, i32 28, i32 27, i32 26, i32 25, i32 24, i32 23, i32 22, i32 21, i32 20, i32 19, i32 18, i32 17, i32 16, i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 8, i32 8, i32 7, i32 6, i32 8, i32 4, i32 3, i32 2, i32 1, i32 0>
207213

208214
; 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)
212218
; AVX2: cost of 128 {{.*}} %V512 = shufflevector
213219
; AVX512F: cost of 128 {{.*}} %V512 = shufflevector
214220
; AVX512BW: cost of 8 {{.*}} %V512 = shufflevector
221+
; AVX512VBMI: cost of 1 {{.*}} %V512 = shufflevector
215222
%V512 = shufflevector <64 x i8> %src512, <64 x i8> undef, <64 x i32> <i32 63, i32 62, i32 61, i32 60, i32 59, i32 58, i32 57, i32 56, i32 55, i32 54, i32 53, i32 52, i32 51, i32 50, i32 49, i32 48, i32 47, i32 46, i32 45, i32 44, i32 43, i32 42, i32 41, i32 40, i32 39, i32 38, i32 37, i32 36, i32 35, i32 34, i32 33, i32 32, i32 31, i32 30, i32 29, i32 28, i32 27, i32 26, i32 25, i32 24, i32 23, i32 20, i32 21, i32 20, i32 19, i32 18, i32 17, i32 16, i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
216223

217224
ret void

0 commit comments

Comments
 (0)