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
9
10; Verify the cost of scalar population count instructions.
11
12declare i64 @llvm.ctpop.i64(i64)
13declare i32 @llvm.ctpop.i32(i32)
14declare i16 @llvm.ctpop.i16(i16)
15declare  i8 @llvm.ctpop.i8(i8)
16
17define i64 @var_ctpop_i64(i64 %a) {
18; NOPOPCNT-LABEL: 'var_ctpop_i64'
19; NOPOPCNT-NEXT:  Cost Model: Found an estimated cost of 4 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
21;
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
25;
26  %ctpop = call i64 @llvm.ctpop.i64(i64 %a)
27  ret i64 %ctpop
28}
29
30define i32 @var_ctpop_i32(i32 %a) {
31; NOPOPCNT-LABEL: 'var_ctpop_i32'
32; NOPOPCNT-NEXT:  Cost Model: Found an estimated cost of 4 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
34;
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
38;
39  %ctpop = call i32 @llvm.ctpop.i32(i32 %a)
40  ret i32 %ctpop
41}
42
43define i16 @var_ctpop_i16(i16 %a) {
44; NOPOPCNT-LABEL: 'var_ctpop_i16'
45; NOPOPCNT-NEXT:  Cost Model: Found an estimated cost of 4 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
47;
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
51;
52  %ctpop = call i16 @llvm.ctpop.i16(i16 %a)
53  ret i16 %ctpop
54}
55
56define i8 @var_ctpop_i8(i8 %a) {
57; NOPOPCNT-LABEL: 'var_ctpop_i8'
58; NOPOPCNT-NEXT:  Cost Model: Found an estimated cost of 4 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
60;
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
64;
65  %ctpop = call i8 @llvm.ctpop.i8(i8 %a)
66  ret i8 %ctpop
67}
68
69; Verify the cost of vector population count instructions.
70
71declare <2 x i64> @llvm.ctpop.v2i64(<2 x i64>)
72declare <4 x i32> @llvm.ctpop.v4i32(<4 x i32>)
73declare <8 x i16> @llvm.ctpop.v8i16(<8 x i16>)
74declare <16 x i8> @llvm.ctpop.v16i8(<16 x i8>)
75
76declare <4 x i64> @llvm.ctpop.v4i64(<4 x i64>)
77declare <8 x i32> @llvm.ctpop.v8i32(<8 x i32>)
78declare <16 x i16> @llvm.ctpop.v16i16(<16 x i16>)
79declare <32 x i8> @llvm.ctpop.v32i8(<32 x i8>)
80
81declare <8 x i64> @llvm.ctpop.v8i64(<8 x i64>)
82declare <16 x i32> @llvm.ctpop.v16i32(<16 x i32>)
83declare <32 x i16> @llvm.ctpop.v32i16(<32 x i16>)
84declare <64 x i8> @llvm.ctpop.v64i8(<64 x i8>)
85
86define <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
90;
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
94;
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
98;
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
102;
103  %ctpop = call <2 x i64> @llvm.ctpop.v2i64(<2 x i64> %a)
104  ret <2 x i64> %ctpop
105}
106
107define <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
111;
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
115;
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
119;
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
123;
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
127;
128  %ctpop = call <4 x i64> @llvm.ctpop.v4i64(<4 x i64> %a)
129  ret <4 x i64> %ctpop
130}
131
132define <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
136;
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
140;
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
144;
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
148;
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
152;
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
156;
157  %ctpop = call <8 x i64> @llvm.ctpop.v8i64(<8 x i64> %a)
158  ret <8 x i64> %ctpop
159}
160
161define <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
165;
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
169;
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
173;
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
177;
178  %ctpop = call <4 x i32> @llvm.ctpop.v4i32(<4 x i32> %a)
179  ret <4 x i32> %ctpop
180}
181
182define <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
186;
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
190;
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
194;
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
198;
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
202;
203  %ctpop = call <8 x i32> @llvm.ctpop.v8i32(<8 x i32> %a)
204  ret <8 x i32> %ctpop
205}
206
207define <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
211;
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
215;
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
219;
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
223;
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
227;
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
231;
232  %ctpop = call <16 x i32> @llvm.ctpop.v16i32(<16 x i32> %a)
233  ret <16 x i32> %ctpop
234}
235
236define <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
240;
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
244;
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
248;
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
252;
253  %ctpop = call <8 x i16> @llvm.ctpop.v8i16(<8 x i16> %a)
254  ret <8 x i16> %ctpop
255}
256
257define <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
261;
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
265;
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
269;
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
273;
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
277;
278  %ctpop = call <16 x i16> @llvm.ctpop.v16i16(<16 x i16> %a)
279  ret <16 x i16> %ctpop
280}
281
282define <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
286;
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
290;
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
294;
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
298;
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
302;
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
306;
307  %ctpop = call <32 x i16> @llvm.ctpop.v32i16(<32 x i16> %a)
308  ret <32 x i16> %ctpop
309}
310
311define <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
315;
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
319;
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
323;
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
327;
328  %ctpop = call <16 x i8> @llvm.ctpop.v16i8(<16 x i8> %a)
329  ret <16 x i8> %ctpop
330}
331
332define <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
336;
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
340;
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
344;
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
348;
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
352;
353  %ctpop = call <32 x i8> @llvm.ctpop.v32i8(<32 x i8> %a)
354  ret <32 x i8> %ctpop
355}
356
357define <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
361;
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
365;
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
369;
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
373;
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
377;
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
381;
382  %ctpop = call <64 x i8> @llvm.ctpop.v64i8(<64 x i8> %a)
383  ret <64 x i8> %ctpop
384}
385