llvm.org GIT mirror llvm / 93a9cc0
[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 Simon Pilgrim 2 years ago
3 changed file(s) with 18 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
33 ; 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
44 ; 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
55 ; 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
6 ; 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
6 ; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f,+avx512bw | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512
7 ; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f,+avx512bw,+avx512vbmi | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512
78
89 ;
910 ; Verify the cost model for broadcast shuffles.
129130 ; SSE42: cost of 1 {{.*}} %V512 = shufflevector
130131 ; AVX1: cost of 3 {{.*}} %V512 = shufflevector
131132 ; AVX2: cost of 1 {{.*}} %V512 = shufflevector
132 ; AVX512F: cost of 1 {{.*}} %V512 = shufflevector
133 ; AVX512BW: cost of 1 {{.*}} %V512 = shufflevector
133 ; AVX512: cost of 1 {{.*}} %V512 = shufflevector
134134 %V512 = shufflevector <32 x i16> %src512, <32 x i16> undef, <32 x i32> zeroinitializer
135135
136136 ret void
158158 ; SSE42: cost of 1 {{.*}} %V512 = shufflevector
159159 ; AVX1: cost of 2 {{.*}} %V512 = shufflevector
160160 ; AVX2: cost of 1 {{.*}} %V512 = shufflevector
161 ; AVX512F: cost of 1 {{.*}} %V512 = shufflevector
162 ; AVX512BW: cost of 1 {{.*}} %V512 = shufflevector
161 ; AVX512: cost of 1 {{.*}} %V512 = shufflevector
163162 %V512 = shufflevector <64 x i8> %src512, <64 x i8> undef, <64 x i32> zeroinitializer
164163
165164 ret void
44 ; 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
55 ; 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
66 ; 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,+avx512vbmi | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 --check-prefix=AVX512VBMI
78
89 ;
910 ; Verify the cost model for reverse shuffles.
123124 ; AVX2: cost of 2 {{.*}} %V256 = shufflevector
124125 ; AVX512F: cost of 2 {{.*}} %V256 = shufflevector
125126 ; AVX512BW: cost of 1 {{.*}} %V256 = shufflevector
127 ; AVX512VBMI: cost of 1 {{.*}} %V256 = shufflevector
126128 %V256 = shufflevector <16 x i16> %src256, <16 x i16> undef, <16 x i32>
127129
128130 ; SSE2: cost of 12 {{.*}} %V512 = shufflevector
132134 ; AVX2: cost of 4 {{.*}} %V512 = shufflevector
133135 ; AVX512F: cost of 4 {{.*}} %V512 = shufflevector
134136 ; AVX512BW: cost of 1 {{.*}} %V512 = shufflevector
137 ; AVX512VBMI: cost of 1 {{.*}} %V512 = shufflevector
135138 %V512 = shufflevector <32 x i16> %src512, <32 x i16> undef, <32 x i32>
136139
137140 ret void
151154 ; SSE42: cost of 2 {{.*}} %V256 = shufflevector
152155 ; AVX1: cost of 4 {{.*}} %V256 = shufflevector
153156 ; AVX2: cost of 2 {{.*}} %V256 = shufflevector
154 ; AVX512: cost of 2 {{.*}} %V256 = shufflevector
157 ; AVX512F: cost of 2 {{.*}} %V256 = shufflevector
158 ; AVX512BW: cost of 2 {{.*}} %V256 = shufflevector
159 ; AVX512VBMI: cost of 1 {{.*}} %V256 = shufflevector
155160 %V256 = shufflevector <32 x i8> %src256, <32 x i8> undef, <32 x i32>
156161
157162 ; SSE2: cost of 36 {{.*}} %V512 = shufflevector
161166 ; AVX2: cost of 4 {{.*}} %V512 = shufflevector
162167 ; AVX512F: cost of 4 {{.*}} %V512 = shufflevector
163168 ; AVX512BW: cost of 2 {{.*}} %V512 = shufflevector
169 ; AVX512VBMI: cost of 1 {{.*}} %V512 = shufflevector
164170 %V512 = shufflevector <64 x i8> %src512, <64 x i8> undef, <64 x i32>
165171
166172 ret void
44 ; 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
55 ; 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
66 ; 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,+avx512vbmi | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 --check-prefix=AVX512VBMI
78
89 ;
910 ; Verify the cost model for 1 src shuffles
154155 ; AVX2: cost of 1 {{.*}} %V128 = shufflevector
155156 ; AVX512F: cost of 1 {{.*}} %V128 = shufflevector
156157 ; AVX512BW: cost of 1 {{.*}} %V128 = shufflevector
158 ; AVX512VBMI: cost of 1 {{.*}} %V128 = shufflevector
157159 %V128 = shufflevector <8 x i16> %src128, <8 x i16> undef, <8 x i32>
158160
159161 ; SSE2: cost of 32 {{.*}} %V256 = shufflevector
163165 ; AVX2: cost of 4 {{.*}} %V256 = shufflevector
164166 ; AVX512F: cost of 4 {{.*}} %V256 = shufflevector
165167 ; AVX512BW cost of 1 {{.*}} %V256 = shufflevector
168 ; AVX512VBMI cost of 1 {{.*}} %V256 = shufflevector
166169 %V256 = shufflevector <16 x i16> %src256, <16 x i16> undef, <16 x i32>
167170
168171 ; SSE2: cost of 192 {{.*}} %V512 = shufflevector
172175 ; AVX2: cost of 64 {{.*}} %V512 = shufflevector
173176 ; AVX512F: cost of 64 {{.*}} %V512 = shufflevector
174177 ; AVX512BW: cost of 1 {{.*}} %V512 = shufflevector
178 ; AVX512VBMI: cost of 1 {{.*}} %V512 = shufflevector
175179 %V512 = shufflevector <32 x i16> %src512, <32 x i16> undef, <32 x i32>
176180
177181 ; SSE2: cost of 896 {{.*}} %V1024 = shufflevector
181185 ; AVX2: cost of 384 {{.*}} %V1024 = shufflevector
182186 ; AVX512F: cost of 384 {{.*}} %V1024 = shufflevector
183187 ; AVX512BW: cost of 2 {{.*}} %V1024 = shufflevector
188 ; AVX512VBMI: cost of 2 {{.*}} %V1024 = shufflevector
184189 %V1024 = shufflevector <64 x i16> %src1024, <64 x i16> undef, <64 x i32>
185190 ret void
186191 }
202207 ; AVX2: cost of 4 {{.*}} %V256 = shufflevector
203208 ; AVX512F: cost of 4 {{.*}} %V256 = shufflevector
204209 ; AVX512BW: cost of 3 {{.*}} %V256 = shufflevector
210 ; AVX512VBMI: cost of 1 {{.*}} %V256 = shufflevector
205211 %V256 = shufflevector <32 x i8> %src256, <32 x i8> undef, <32 x i32>
206212
207213 ; SSE2: cost of 384 {{.*}} %V512 = shufflevector
211217 ; AVX2: cost of 128 {{.*}} %V512 = shufflevector
212218 ; AVX512F: cost of 128 {{.*}} %V512 = shufflevector
213219 ; AVX512BW: cost of 8 {{.*}} %V512 = shufflevector
220 ; AVX512VBMI: cost of 1 {{.*}} %V512 = shufflevector
214221 %V512 = shufflevector <64 x i8> %src512, <64 x i8> undef, <64 x i32>
215222
216223 ret void