1 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=-popcnt,+sse2 | FileCheck %s -check-prefixes=CHECK,SSE,SSE2,NOPOPCNT
3 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+popcnt,+sse2 | FileCheck %s -check-prefixes=CHECK,SSE,SSE2,POPCNT
4 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+popcnt,+sse4.2 | FileCheck %s -check-prefixes=CHECK,POPCNT,SSE,SSE42
5 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+popcnt,+avx | FileCheck %s -check-prefixes=CHECK,POPCNT,AVX,AVX1
6 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+popcnt,+avx2 | FileCheck %s -check-prefixes=CHECK,POPCNT,AVX,AVX2
7 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+popcnt,+avx512f | FileCheck %s -check-prefixes=CHECK,POPCNT,AVX512,AVX512F
8 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+popcnt,+avx512vl,+avx512bw,+avx512dq | FileCheck %s -check-prefixes=CHECK,POPCNT,AVX512,AVX512BW
10 ; Verify the cost of scalar population count instructions.
12 declare i64 @llvm.ctpop.i64(i64)
13 declare i32 @llvm.ctpop.i32(i32)
14 declare i16 @llvm.ctpop.i16(i16)
15 declare i8 @llvm.ctpop.i8(i8)
17 define i64 @var_ctpop_i64(i64 %a) {
18 ; NOPOPCNT-LABEL: 'var_ctpop_i64'
19 ; NOPOPCNT-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %ctpop = call i64 @llvm.ctpop.i64(i64 %a)
20 ; NOPOPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i64 %ctpop
22 ; POPCNT-LABEL: 'var_ctpop_i64'
23 ; POPCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctpop = call i64 @llvm.ctpop.i64(i64 %a)
24 ; POPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i64 %ctpop
26 %ctpop = call i64 @llvm.ctpop.i64(i64 %a)
30 define i32 @var_ctpop_i32(i32 %a) {
31 ; NOPOPCNT-LABEL: 'var_ctpop_i32'
32 ; NOPOPCNT-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %ctpop = call i32 @llvm.ctpop.i32(i32 %a)
33 ; NOPOPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 %ctpop
35 ; POPCNT-LABEL: 'var_ctpop_i32'
36 ; POPCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctpop = call i32 @llvm.ctpop.i32(i32 %a)
37 ; POPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 %ctpop
39 %ctpop = call i32 @llvm.ctpop.i32(i32 %a)
43 define i16 @var_ctpop_i16(i16 %a) {
44 ; NOPOPCNT-LABEL: 'var_ctpop_i16'
45 ; NOPOPCNT-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %ctpop = call i16 @llvm.ctpop.i16(i16 %a)
46 ; NOPOPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i16 %ctpop
48 ; POPCNT-LABEL: 'var_ctpop_i16'
49 ; POPCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctpop = call i16 @llvm.ctpop.i16(i16 %a)
50 ; POPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i16 %ctpop
52 %ctpop = call i16 @llvm.ctpop.i16(i16 %a)
56 define i8 @var_ctpop_i8(i8 %a) {
57 ; NOPOPCNT-LABEL: 'var_ctpop_i8'
58 ; NOPOPCNT-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %ctpop = call i8 @llvm.ctpop.i8(i8 %a)
59 ; NOPOPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i8 %ctpop
61 ; POPCNT-LABEL: 'var_ctpop_i8'
62 ; POPCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctpop = call i8 @llvm.ctpop.i8(i8 %a)
63 ; POPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i8 %ctpop
65 %ctpop = call i8 @llvm.ctpop.i8(i8 %a)
69 ; Verify the cost of vector population count instructions.
71 declare <2 x i64> @llvm.ctpop.v2i64(<2 x i64>)
72 declare <4 x i32> @llvm.ctpop.v4i32(<4 x i32>)
73 declare <8 x i16> @llvm.ctpop.v8i16(<8 x i16>)
74 declare <16 x i8> @llvm.ctpop.v16i8(<16 x i8>)
76 declare <4 x i64> @llvm.ctpop.v4i64(<4 x i64>)
77 declare <8 x i32> @llvm.ctpop.v8i32(<8 x i32>)
78 declare <16 x i16> @llvm.ctpop.v16i16(<16 x i16>)
79 declare <32 x i8> @llvm.ctpop.v32i8(<32 x i8>)
81 declare <8 x i64> @llvm.ctpop.v8i64(<8 x i64>)
82 declare <16 x i32> @llvm.ctpop.v16i32(<16 x i32>)
83 declare <32 x i16> @llvm.ctpop.v32i16(<32 x i16>)
84 declare <64 x i8> @llvm.ctpop.v64i8(<64 x i8>)
86 define <2 x i64> @var_ctpop_v2i64(<2 x i64> %a) {
87 ; SSE2-LABEL: 'var_ctpop_v2i64'
88 ; SSE2-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %ctpop = call <2 x i64> @llvm.ctpop.v2i64(<2 x i64> %a)
89 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctpop
91 ; SSE42-LABEL: 'var_ctpop_v2i64'
92 ; SSE42-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %ctpop = call <2 x i64> @llvm.ctpop.v2i64(<2 x i64> %a)
93 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctpop
95 ; AVX-LABEL: 'var_ctpop_v2i64'
96 ; AVX-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %ctpop = call <2 x i64> @llvm.ctpop.v2i64(<2 x i64> %a)
97 ; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctpop
99 ; AVX512-LABEL: 'var_ctpop_v2i64'
100 ; AVX512-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %ctpop = call <2 x i64> @llvm.ctpop.v2i64(<2 x i64> %a)
101 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctpop
103 %ctpop = call <2 x i64> @llvm.ctpop.v2i64(<2 x i64> %a)
107 define <4 x i64> @var_ctpop_v4i64(<4 x i64> %a) {
108 ; SSE2-LABEL: 'var_ctpop_v4i64'
109 ; SSE2-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %ctpop = call <4 x i64> @llvm.ctpop.v4i64(<4 x i64> %a)
110 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctpop
112 ; SSE42-LABEL: 'var_ctpop_v4i64'
113 ; SSE42-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %ctpop = call <4 x i64> @llvm.ctpop.v4i64(<4 x i64> %a)
114 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctpop
116 ; AVX1-LABEL: 'var_ctpop_v4i64'
117 ; AVX1-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %ctpop = call <4 x i64> @llvm.ctpop.v4i64(<4 x i64> %a)
118 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctpop
120 ; AVX2-LABEL: 'var_ctpop_v4i64'
121 ; AVX2-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %ctpop = call <4 x i64> @llvm.ctpop.v4i64(<4 x i64> %a)
122 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctpop
124 ; AVX512-LABEL: 'var_ctpop_v4i64'
125 ; AVX512-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %ctpop = call <4 x i64> @llvm.ctpop.v4i64(<4 x i64> %a)
126 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctpop
128 %ctpop = call <4 x i64> @llvm.ctpop.v4i64(<4 x i64> %a)
132 define <8 x i64> @var_ctpop_v8i64(<8 x i64> %a) {
133 ; SSE2-LABEL: 'var_ctpop_v8i64'
134 ; SSE2-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %ctpop = call <8 x i64> @llvm.ctpop.v8i64(<8 x i64> %a)
135 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctpop
137 ; SSE42-LABEL: 'var_ctpop_v8i64'
138 ; SSE42-NEXT: Cost Model: Found an estimated cost of 28 for instruction: %ctpop = call <8 x i64> @llvm.ctpop.v8i64(<8 x i64> %a)
139 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctpop
141 ; AVX1-LABEL: 'var_ctpop_v8i64'
142 ; AVX1-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %ctpop = call <8 x i64> @llvm.ctpop.v8i64(<8 x i64> %a)
143 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctpop
145 ; AVX2-LABEL: 'var_ctpop_v8i64'
146 ; AVX2-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %ctpop = call <8 x i64> @llvm.ctpop.v8i64(<8 x i64> %a)
147 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctpop
149 ; AVX512F-LABEL: 'var_ctpop_v8i64'
150 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %ctpop = call <8 x i64> @llvm.ctpop.v8i64(<8 x i64> %a)
151 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctpop
153 ; AVX512BW-LABEL: 'var_ctpop_v8i64'
154 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %ctpop = call <8 x i64> @llvm.ctpop.v8i64(<8 x i64> %a)
155 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctpop
157 %ctpop = call <8 x i64> @llvm.ctpop.v8i64(<8 x i64> %a)
161 define <4 x i32> @var_ctpop_v4i32(<4 x i32> %a) {
162 ; SSE2-LABEL: 'var_ctpop_v4i32'
163 ; SSE2-NEXT: Cost Model: Found an estimated cost of 15 for instruction: %ctpop = call <4 x i32> @llvm.ctpop.v4i32(<4 x i32> %a)
164 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctpop
166 ; SSE42-LABEL: 'var_ctpop_v4i32'
167 ; SSE42-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %ctpop = call <4 x i32> @llvm.ctpop.v4i32(<4 x i32> %a)
168 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctpop
170 ; AVX-LABEL: 'var_ctpop_v4i32'
171 ; AVX-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %ctpop = call <4 x i32> @llvm.ctpop.v4i32(<4 x i32> %a)
172 ; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctpop
174 ; AVX512-LABEL: 'var_ctpop_v4i32'
175 ; AVX512-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %ctpop = call <4 x i32> @llvm.ctpop.v4i32(<4 x i32> %a)
176 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctpop
178 %ctpop = call <4 x i32> @llvm.ctpop.v4i32(<4 x i32> %a)
182 define <8 x i32> @var_ctpop_v8i32(<8 x i32> %a) {
183 ; SSE2-LABEL: 'var_ctpop_v8i32'
184 ; SSE2-NEXT: Cost Model: Found an estimated cost of 30 for instruction: %ctpop = call <8 x i32> @llvm.ctpop.v8i32(<8 x i32> %a)
185 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctpop
187 ; SSE42-LABEL: 'var_ctpop_v8i32'
188 ; SSE42-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %ctpop = call <8 x i32> @llvm.ctpop.v8i32(<8 x i32> %a)
189 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctpop
191 ; AVX1-LABEL: 'var_ctpop_v8i32'
192 ; AVX1-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %ctpop = call <8 x i32> @llvm.ctpop.v8i32(<8 x i32> %a)
193 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctpop
195 ; AVX2-LABEL: 'var_ctpop_v8i32'
196 ; AVX2-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %ctpop = call <8 x i32> @llvm.ctpop.v8i32(<8 x i32> %a)
197 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctpop
199 ; AVX512-LABEL: 'var_ctpop_v8i32'
200 ; AVX512-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %ctpop = call <8 x i32> @llvm.ctpop.v8i32(<8 x i32> %a)
201 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctpop
203 %ctpop = call <8 x i32> @llvm.ctpop.v8i32(<8 x i32> %a)
207 define <16 x i32> @var_ctpop_v16i32(<16 x i32> %a) {
208 ; SSE2-LABEL: 'var_ctpop_v16i32'
209 ; SSE2-NEXT: Cost Model: Found an estimated cost of 60 for instruction: %ctpop = call <16 x i32> @llvm.ctpop.v16i32(<16 x i32> %a)
210 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctpop
212 ; SSE42-LABEL: 'var_ctpop_v16i32'
213 ; SSE42-NEXT: Cost Model: Found an estimated cost of 44 for instruction: %ctpop = call <16 x i32> @llvm.ctpop.v16i32(<16 x i32> %a)
214 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctpop
216 ; AVX1-LABEL: 'var_ctpop_v16i32'
217 ; AVX1-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %ctpop = call <16 x i32> @llvm.ctpop.v16i32(<16 x i32> %a)
218 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctpop
220 ; AVX2-LABEL: 'var_ctpop_v16i32'
221 ; AVX2-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %ctpop = call <16 x i32> @llvm.ctpop.v16i32(<16 x i32> %a)
222 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctpop
224 ; AVX512F-LABEL: 'var_ctpop_v16i32'
225 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %ctpop = call <16 x i32> @llvm.ctpop.v16i32(<16 x i32> %a)
226 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctpop
228 ; AVX512BW-LABEL: 'var_ctpop_v16i32'
229 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %ctpop = call <16 x i32> @llvm.ctpop.v16i32(<16 x i32> %a)
230 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctpop
232 %ctpop = call <16 x i32> @llvm.ctpop.v16i32(<16 x i32> %a)
233 ret <16 x i32> %ctpop
236 define <8 x i16> @var_ctpop_v8i16(<8 x i16> %a) {
237 ; SSE2-LABEL: 'var_ctpop_v8i16'
238 ; SSE2-NEXT: Cost Model: Found an estimated cost of 13 for instruction: %ctpop = call <8 x i16> @llvm.ctpop.v8i16(<8 x i16> %a)
239 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctpop
241 ; SSE42-LABEL: 'var_ctpop_v8i16'
242 ; SSE42-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %ctpop = call <8 x i16> @llvm.ctpop.v8i16(<8 x i16> %a)
243 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctpop
245 ; AVX-LABEL: 'var_ctpop_v8i16'
246 ; AVX-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %ctpop = call <8 x i16> @llvm.ctpop.v8i16(<8 x i16> %a)
247 ; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctpop
249 ; AVX512-LABEL: 'var_ctpop_v8i16'
250 ; AVX512-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %ctpop = call <8 x i16> @llvm.ctpop.v8i16(<8 x i16> %a)
251 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctpop
253 %ctpop = call <8 x i16> @llvm.ctpop.v8i16(<8 x i16> %a)
257 define <16 x i16> @var_ctpop_v16i16(<16 x i16> %a) {
258 ; SSE2-LABEL: 'var_ctpop_v16i16'
259 ; SSE2-NEXT: Cost Model: Found an estimated cost of 26 for instruction: %ctpop = call <16 x i16> @llvm.ctpop.v16i16(<16 x i16> %a)
260 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctpop
262 ; SSE42-LABEL: 'var_ctpop_v16i16'
263 ; SSE42-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %ctpop = call <16 x i16> @llvm.ctpop.v16i16(<16 x i16> %a)
264 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctpop
266 ; AVX1-LABEL: 'var_ctpop_v16i16'
267 ; AVX1-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %ctpop = call <16 x i16> @llvm.ctpop.v16i16(<16 x i16> %a)
268 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctpop
270 ; AVX2-LABEL: 'var_ctpop_v16i16'
271 ; AVX2-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %ctpop = call <16 x i16> @llvm.ctpop.v16i16(<16 x i16> %a)
272 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctpop
274 ; AVX512-LABEL: 'var_ctpop_v16i16'
275 ; AVX512-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %ctpop = call <16 x i16> @llvm.ctpop.v16i16(<16 x i16> %a)
276 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctpop
278 %ctpop = call <16 x i16> @llvm.ctpop.v16i16(<16 x i16> %a)
279 ret <16 x i16> %ctpop
282 define <32 x i16> @var_ctpop_v32i16(<32 x i16> %a) {
283 ; SSE2-LABEL: 'var_ctpop_v32i16'
284 ; SSE2-NEXT: Cost Model: Found an estimated cost of 52 for instruction: %ctpop = call <32 x i16> @llvm.ctpop.v32i16(<32 x i16> %a)
285 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctpop
287 ; SSE42-LABEL: 'var_ctpop_v32i16'
288 ; SSE42-NEXT: Cost Model: Found an estimated cost of 36 for instruction: %ctpop = call <32 x i16> @llvm.ctpop.v32i16(<32 x i16> %a)
289 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctpop
291 ; AVX1-LABEL: 'var_ctpop_v32i16'
292 ; AVX1-NEXT: Cost Model: Found an estimated cost of 40 for instruction: %ctpop = call <32 x i16> @llvm.ctpop.v32i16(<32 x i16> %a)
293 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctpop
295 ; AVX2-LABEL: 'var_ctpop_v32i16'
296 ; AVX2-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %ctpop = call <32 x i16> @llvm.ctpop.v32i16(<32 x i16> %a)
297 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctpop
299 ; AVX512F-LABEL: 'var_ctpop_v32i16'
300 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %ctpop = call <32 x i16> @llvm.ctpop.v32i16(<32 x i16> %a)
301 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctpop
303 ; AVX512BW-LABEL: 'var_ctpop_v32i16'
304 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %ctpop = call <32 x i16> @llvm.ctpop.v32i16(<32 x i16> %a)
305 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctpop
307 %ctpop = call <32 x i16> @llvm.ctpop.v32i16(<32 x i16> %a)
308 ret <32 x i16> %ctpop
311 define <16 x i8> @var_ctpop_v16i8(<16 x i8> %a) {
312 ; SSE2-LABEL: 'var_ctpop_v16i8'
313 ; SSE2-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %ctpop = call <16 x i8> @llvm.ctpop.v16i8(<16 x i8> %a)
314 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctpop
316 ; SSE42-LABEL: 'var_ctpop_v16i8'
317 ; SSE42-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %ctpop = call <16 x i8> @llvm.ctpop.v16i8(<16 x i8> %a)
318 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctpop
320 ; AVX-LABEL: 'var_ctpop_v16i8'
321 ; AVX-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %ctpop = call <16 x i8> @llvm.ctpop.v16i8(<16 x i8> %a)
322 ; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctpop
324 ; AVX512-LABEL: 'var_ctpop_v16i8'
325 ; AVX512-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %ctpop = call <16 x i8> @llvm.ctpop.v16i8(<16 x i8> %a)
326 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctpop
328 %ctpop = call <16 x i8> @llvm.ctpop.v16i8(<16 x i8> %a)
332 define <32 x i8> @var_ctpop_v32i8(<32 x i8> %a) {
333 ; SSE2-LABEL: 'var_ctpop_v32i8'
334 ; SSE2-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %ctpop = call <32 x i8> @llvm.ctpop.v32i8(<32 x i8> %a)
335 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctpop
337 ; SSE42-LABEL: 'var_ctpop_v32i8'
338 ; SSE42-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %ctpop = call <32 x i8> @llvm.ctpop.v32i8(<32 x i8> %a)
339 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctpop
341 ; AVX1-LABEL: 'var_ctpop_v32i8'
342 ; AVX1-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %ctpop = call <32 x i8> @llvm.ctpop.v32i8(<32 x i8> %a)
343 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctpop
345 ; AVX2-LABEL: 'var_ctpop_v32i8'
346 ; AVX2-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %ctpop = call <32 x i8> @llvm.ctpop.v32i8(<32 x i8> %a)
347 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctpop
349 ; AVX512-LABEL: 'var_ctpop_v32i8'
350 ; AVX512-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %ctpop = call <32 x i8> @llvm.ctpop.v32i8(<32 x i8> %a)
351 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctpop
353 %ctpop = call <32 x i8> @llvm.ctpop.v32i8(<32 x i8> %a)
357 define <64 x i8> @var_ctpop_v64i8(<64 x i8> %a) {
358 ; SSE2-LABEL: 'var_ctpop_v64i8'
359 ; SSE2-NEXT: Cost Model: Found an estimated cost of 40 for instruction: %ctpop = call <64 x i8> @llvm.ctpop.v64i8(<64 x i8> %a)
360 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctpop
362 ; SSE42-LABEL: 'var_ctpop_v64i8'
363 ; SSE42-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %ctpop = call <64 x i8> @llvm.ctpop.v64i8(<64 x i8> %a)
364 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctpop
366 ; AVX1-LABEL: 'var_ctpop_v64i8'
367 ; AVX1-NEXT: Cost Model: Found an estimated cost of 28 for instruction: %ctpop = call <64 x i8> @llvm.ctpop.v64i8(<64 x i8> %a)
368 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctpop
370 ; AVX2-LABEL: 'var_ctpop_v64i8'
371 ; AVX2-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %ctpop = call <64 x i8> @llvm.ctpop.v64i8(<64 x i8> %a)
372 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctpop
374 ; AVX512F-LABEL: 'var_ctpop_v64i8'
375 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %ctpop = call <64 x i8> @llvm.ctpop.v64i8(<64 x i8> %a)
376 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctpop
378 ; AVX512BW-LABEL: 'var_ctpop_v64i8'
379 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %ctpop = call <64 x i8> @llvm.ctpop.v64i8(<64 x i8> %a)
380 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctpop
382 %ctpop = call <64 x i8> @llvm.ctpop.v64i8(<64 x i8> %a)