1 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" 2>&1 -disable-output -mattr=-popcnt,+sse2 | FileCheck %s -check-prefixes=SSE2,NOPOPCNT
3 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" 2>&1 -disable-output -mattr=+popcnt,+sse2 | FileCheck %s -check-prefixes=SSE2,POPCNT
4 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" 2>&1 -disable-output -mattr=+popcnt,+sse4.2 | FileCheck %s -check-prefixes=POPCNT,SSE42
5 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" 2>&1 -disable-output -mattr=+popcnt,+avx | FileCheck %s -check-prefixes=POPCNT,AVX1
6 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" 2>&1 -disable-output -mattr=+popcnt,+avx2 | FileCheck %s -check-prefixes=POPCNT,AVX2
7 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" 2>&1 -disable-output -mattr=+popcnt,+avx512f | FileCheck %s -check-prefixes=POPCNT,AVX512F
8 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" 2>&1 -disable-output -mattr=+popcnt,+avx512vl,+avx512bw,+avx512dq | FileCheck %s -check-prefixes=POPCNT,AVX512BW
9 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" 2>&1 -disable-output -mattr=+popcnt,+avx512vl,+avx512vpopcntdq | FileCheck %s -check-prefixes=POPCNT,AVX512VPOPCNT
10 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" 2>&1 -disable-output -mattr=+popcnt,+avx512vl,+avx512bitalg | FileCheck %s -check-prefixes=POPCNT,AVX512BITALG
12 ; Verify the cost of scalar population count instructions.
14 declare i64 @llvm.ctpop.i64(i64)
15 declare i32 @llvm.ctpop.i32(i32)
16 declare i16 @llvm.ctpop.i16(i16)
17 declare i8 @llvm.ctpop.i8(i8)
19 define i64 @var_ctpop_i64(i64 %a) {
20 ; NOPOPCNT-LABEL: 'var_ctpop_i64'
21 ; NOPOPCNT-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %ctpop = call i64 @llvm.ctpop.i64(i64 %a)
22 ; NOPOPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i64 %ctpop
24 ; POPCNT-LABEL: 'var_ctpop_i64'
25 ; POPCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctpop = call i64 @llvm.ctpop.i64(i64 %a)
26 ; POPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i64 %ctpop
28 %ctpop = call i64 @llvm.ctpop.i64(i64 %a)
32 define i32 @var_ctpop_i32(i32 %a) {
33 ; NOPOPCNT-LABEL: 'var_ctpop_i32'
34 ; NOPOPCNT-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %ctpop = call i32 @llvm.ctpop.i32(i32 %a)
35 ; NOPOPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 %ctpop
37 ; POPCNT-LABEL: 'var_ctpop_i32'
38 ; POPCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctpop = call i32 @llvm.ctpop.i32(i32 %a)
39 ; POPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 %ctpop
41 %ctpop = call i32 @llvm.ctpop.i32(i32 %a)
45 define i16 @var_ctpop_i16(i16 %a) {
46 ; NOPOPCNT-LABEL: 'var_ctpop_i16'
47 ; NOPOPCNT-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %ctpop = call i16 @llvm.ctpop.i16(i16 %a)
48 ; NOPOPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i16 %ctpop
50 ; POPCNT-LABEL: 'var_ctpop_i16'
51 ; POPCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctpop = call i16 @llvm.ctpop.i16(i16 %a)
52 ; POPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i16 %ctpop
54 %ctpop = call i16 @llvm.ctpop.i16(i16 %a)
58 define i8 @var_ctpop_i8(i8 %a) {
59 ; NOPOPCNT-LABEL: 'var_ctpop_i8'
60 ; NOPOPCNT-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %ctpop = call i8 @llvm.ctpop.i8(i8 %a)
61 ; NOPOPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i8 %ctpop
63 ; POPCNT-LABEL: 'var_ctpop_i8'
64 ; POPCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctpop = call i8 @llvm.ctpop.i8(i8 %a)
65 ; POPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i8 %ctpop
67 %ctpop = call i8 @llvm.ctpop.i8(i8 %a)
71 ; Verify the cost of vector population count instructions.
73 declare <2 x i64> @llvm.ctpop.v2i64(<2 x i64>)
74 declare <4 x i32> @llvm.ctpop.v4i32(<4 x i32>)
75 declare <8 x i16> @llvm.ctpop.v8i16(<8 x i16>)
76 declare <16 x i8> @llvm.ctpop.v16i8(<16 x i8>)
78 declare <4 x i64> @llvm.ctpop.v4i64(<4 x i64>)
79 declare <8 x i32> @llvm.ctpop.v8i32(<8 x i32>)
80 declare <16 x i16> @llvm.ctpop.v16i16(<16 x i16>)
81 declare <32 x i8> @llvm.ctpop.v32i8(<32 x i8>)
83 declare <8 x i64> @llvm.ctpop.v8i64(<8 x i64>)
84 declare <16 x i32> @llvm.ctpop.v16i32(<16 x i32>)
85 declare <32 x i16> @llvm.ctpop.v32i16(<32 x i16>)
86 declare <64 x i8> @llvm.ctpop.v64i8(<64 x i8>)
88 define <2 x i64> @var_ctpop_v2i64(<2 x i64> %a) {
89 ; SSE2-LABEL: 'var_ctpop_v2i64'
90 ; SSE2-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %ctpop = call <2 x i64> @llvm.ctpop.v2i64(<2 x i64> %a)
91 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctpop
93 ; SSE42-LABEL: 'var_ctpop_v2i64'
94 ; SSE42-NEXT: Cost Model: Found an estimated cost of 13 for instruction: %ctpop = call <2 x i64> @llvm.ctpop.v2i64(<2 x i64> %a)
95 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctpop
97 ; AVX1-LABEL: 'var_ctpop_v2i64'
98 ; AVX1-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %ctpop = call <2 x i64> @llvm.ctpop.v2i64(<2 x i64> %a)
99 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctpop
101 ; AVX2-LABEL: 'var_ctpop_v2i64'
102 ; AVX2-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %ctpop = call <2 x i64> @llvm.ctpop.v2i64(<2 x i64> %a)
103 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctpop
105 ; AVX512F-LABEL: 'var_ctpop_v2i64'
106 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %ctpop = call <2 x i64> @llvm.ctpop.v2i64(<2 x i64> %a)
107 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctpop
109 ; AVX512BW-LABEL: 'var_ctpop_v2i64'
110 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %ctpop = call <2 x i64> @llvm.ctpop.v2i64(<2 x i64> %a)
111 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctpop
113 ; AVX512VPOPCNT-LABEL: 'var_ctpop_v2i64'
114 ; AVX512VPOPCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctpop = call <2 x i64> @llvm.ctpop.v2i64(<2 x i64> %a)
115 ; AVX512VPOPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctpop
117 ; AVX512BITALG-LABEL: 'var_ctpop_v2i64'
118 ; AVX512BITALG-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %ctpop = call <2 x i64> @llvm.ctpop.v2i64(<2 x i64> %a)
119 ; AVX512BITALG-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctpop
121 %ctpop = call <2 x i64> @llvm.ctpop.v2i64(<2 x i64> %a)
125 define <4 x i64> @var_ctpop_v4i64(<4 x i64> %a) {
126 ; SSE2-LABEL: 'var_ctpop_v4i64'
127 ; SSE2-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %ctpop = call <4 x i64> @llvm.ctpop.v4i64(<4 x i64> %a)
128 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctpop
130 ; SSE42-LABEL: 'var_ctpop_v4i64'
131 ; SSE42-NEXT: Cost Model: Found an estimated cost of 26 for instruction: %ctpop = call <4 x i64> @llvm.ctpop.v4i64(<4 x i64> %a)
132 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctpop
134 ; AVX1-LABEL: 'var_ctpop_v4i64'
135 ; AVX1-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %ctpop = call <4 x i64> @llvm.ctpop.v4i64(<4 x i64> %a)
136 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctpop
138 ; AVX2-LABEL: 'var_ctpop_v4i64'
139 ; AVX2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %ctpop = call <4 x i64> @llvm.ctpop.v4i64(<4 x i64> %a)
140 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctpop
142 ; AVX512F-LABEL: 'var_ctpop_v4i64'
143 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %ctpop = call <4 x i64> @llvm.ctpop.v4i64(<4 x i64> %a)
144 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctpop
146 ; AVX512BW-LABEL: 'var_ctpop_v4i64'
147 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %ctpop = call <4 x i64> @llvm.ctpop.v4i64(<4 x i64> %a)
148 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctpop
150 ; AVX512VPOPCNT-LABEL: 'var_ctpop_v4i64'
151 ; AVX512VPOPCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctpop = call <4 x i64> @llvm.ctpop.v4i64(<4 x i64> %a)
152 ; AVX512VPOPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctpop
154 ; AVX512BITALG-LABEL: 'var_ctpop_v4i64'
155 ; AVX512BITALG-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %ctpop = call <4 x i64> @llvm.ctpop.v4i64(<4 x i64> %a)
156 ; AVX512BITALG-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctpop
158 %ctpop = call <4 x i64> @llvm.ctpop.v4i64(<4 x i64> %a)
162 define <8 x i64> @var_ctpop_v8i64(<8 x i64> %a) {
163 ; SSE2-LABEL: 'var_ctpop_v8i64'
164 ; SSE2-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %ctpop = call <8 x i64> @llvm.ctpop.v8i64(<8 x i64> %a)
165 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctpop
167 ; SSE42-LABEL: 'var_ctpop_v8i64'
168 ; SSE42-NEXT: Cost Model: Found an estimated cost of 52 for instruction: %ctpop = call <8 x i64> @llvm.ctpop.v8i64(<8 x i64> %a)
169 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctpop
171 ; AVX1-LABEL: 'var_ctpop_v8i64'
172 ; AVX1-NEXT: Cost Model: Found an estimated cost of 28 for instruction: %ctpop = call <8 x i64> @llvm.ctpop.v8i64(<8 x i64> %a)
173 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctpop
175 ; AVX2-LABEL: 'var_ctpop_v8i64'
176 ; AVX2-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %ctpop = call <8 x i64> @llvm.ctpop.v8i64(<8 x i64> %a)
177 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctpop
179 ; AVX512F-LABEL: 'var_ctpop_v8i64'
180 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %ctpop = call <8 x i64> @llvm.ctpop.v8i64(<8 x i64> %a)
181 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctpop
183 ; AVX512BW-LABEL: 'var_ctpop_v8i64'
184 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %ctpop = call <8 x i64> @llvm.ctpop.v8i64(<8 x i64> %a)
185 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctpop
187 ; AVX512VPOPCNT-LABEL: 'var_ctpop_v8i64'
188 ; AVX512VPOPCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctpop = call <8 x i64> @llvm.ctpop.v8i64(<8 x i64> %a)
189 ; AVX512VPOPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctpop
191 ; AVX512BITALG-LABEL: 'var_ctpop_v8i64'
192 ; AVX512BITALG-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %ctpop = call <8 x i64> @llvm.ctpop.v8i64(<8 x i64> %a)
193 ; AVX512BITALG-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctpop
195 %ctpop = call <8 x i64> @llvm.ctpop.v8i64(<8 x i64> %a)
199 define <4 x i32> @var_ctpop_v4i32(<4 x i32> %a) {
200 ; SSE2-LABEL: 'var_ctpop_v4i32'
201 ; SSE2-NEXT: Cost Model: Found an estimated cost of 15 for instruction: %ctpop = call <4 x i32> @llvm.ctpop.v4i32(<4 x i32> %a)
202 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctpop
204 ; SSE42-LABEL: 'var_ctpop_v4i32'
205 ; SSE42-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %ctpop = call <4 x i32> @llvm.ctpop.v4i32(<4 x i32> %a)
206 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctpop
208 ; AVX1-LABEL: 'var_ctpop_v4i32'
209 ; AVX1-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %ctpop = call <4 x i32> @llvm.ctpop.v4i32(<4 x i32> %a)
210 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctpop
212 ; AVX2-LABEL: 'var_ctpop_v4i32'
213 ; AVX2-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %ctpop = call <4 x i32> @llvm.ctpop.v4i32(<4 x i32> %a)
214 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctpop
216 ; AVX512F-LABEL: 'var_ctpop_v4i32'
217 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %ctpop = call <4 x i32> @llvm.ctpop.v4i32(<4 x i32> %a)
218 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctpop
220 ; AVX512BW-LABEL: 'var_ctpop_v4i32'
221 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %ctpop = call <4 x i32> @llvm.ctpop.v4i32(<4 x i32> %a)
222 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctpop
224 ; AVX512VPOPCNT-LABEL: 'var_ctpop_v4i32'
225 ; AVX512VPOPCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctpop = call <4 x i32> @llvm.ctpop.v4i32(<4 x i32> %a)
226 ; AVX512VPOPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctpop
228 ; AVX512BITALG-LABEL: 'var_ctpop_v4i32'
229 ; AVX512BITALG-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %ctpop = call <4 x i32> @llvm.ctpop.v4i32(<4 x i32> %a)
230 ; AVX512BITALG-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctpop
232 %ctpop = call <4 x i32> @llvm.ctpop.v4i32(<4 x i32> %a)
236 define <8 x i32> @var_ctpop_v8i32(<8 x i32> %a) {
237 ; SSE2-LABEL: 'var_ctpop_v8i32'
238 ; SSE2-NEXT: Cost Model: Found an estimated cost of 30 for instruction: %ctpop = call <8 x i32> @llvm.ctpop.v8i32(<8 x i32> %a)
239 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctpop
241 ; SSE42-LABEL: 'var_ctpop_v8i32'
242 ; SSE42-NEXT: Cost Model: Found an estimated cost of 36 for instruction: %ctpop = call <8 x i32> @llvm.ctpop.v8i32(<8 x i32> %a)
243 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctpop
245 ; AVX1-LABEL: 'var_ctpop_v8i32'
246 ; AVX1-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %ctpop = call <8 x i32> @llvm.ctpop.v8i32(<8 x i32> %a)
247 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctpop
249 ; AVX2-LABEL: 'var_ctpop_v8i32'
250 ; AVX2-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %ctpop = call <8 x i32> @llvm.ctpop.v8i32(<8 x i32> %a)
251 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctpop
253 ; AVX512F-LABEL: 'var_ctpop_v8i32'
254 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %ctpop = call <8 x i32> @llvm.ctpop.v8i32(<8 x i32> %a)
255 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctpop
257 ; AVX512BW-LABEL: 'var_ctpop_v8i32'
258 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %ctpop = call <8 x i32> @llvm.ctpop.v8i32(<8 x i32> %a)
259 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctpop
261 ; AVX512VPOPCNT-LABEL: 'var_ctpop_v8i32'
262 ; AVX512VPOPCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctpop = call <8 x i32> @llvm.ctpop.v8i32(<8 x i32> %a)
263 ; AVX512VPOPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctpop
265 ; AVX512BITALG-LABEL: 'var_ctpop_v8i32'
266 ; AVX512BITALG-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %ctpop = call <8 x i32> @llvm.ctpop.v8i32(<8 x i32> %a)
267 ; AVX512BITALG-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctpop
269 %ctpop = call <8 x i32> @llvm.ctpop.v8i32(<8 x i32> %a)
273 define <16 x i32> @var_ctpop_v16i32(<16 x i32> %a) {
274 ; SSE2-LABEL: 'var_ctpop_v16i32'
275 ; SSE2-NEXT: Cost Model: Found an estimated cost of 60 for instruction: %ctpop = call <16 x i32> @llvm.ctpop.v16i32(<16 x i32> %a)
276 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctpop
278 ; SSE42-LABEL: 'var_ctpop_v16i32'
279 ; SSE42-NEXT: Cost Model: Found an estimated cost of 72 for instruction: %ctpop = call <16 x i32> @llvm.ctpop.v16i32(<16 x i32> %a)
280 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctpop
282 ; AVX1-LABEL: 'var_ctpop_v16i32'
283 ; AVX1-NEXT: Cost Model: Found an estimated cost of 36 for instruction: %ctpop = call <16 x i32> @llvm.ctpop.v16i32(<16 x i32> %a)
284 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctpop
286 ; AVX2-LABEL: 'var_ctpop_v16i32'
287 ; AVX2-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %ctpop = call <16 x i32> @llvm.ctpop.v16i32(<16 x i32> %a)
288 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctpop
290 ; AVX512F-LABEL: 'var_ctpop_v16i32'
291 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %ctpop = call <16 x i32> @llvm.ctpop.v16i32(<16 x i32> %a)
292 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctpop
294 ; AVX512BW-LABEL: 'var_ctpop_v16i32'
295 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %ctpop = call <16 x i32> @llvm.ctpop.v16i32(<16 x i32> %a)
296 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctpop
298 ; AVX512VPOPCNT-LABEL: 'var_ctpop_v16i32'
299 ; AVX512VPOPCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctpop = call <16 x i32> @llvm.ctpop.v16i32(<16 x i32> %a)
300 ; AVX512VPOPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctpop
302 ; AVX512BITALG-LABEL: 'var_ctpop_v16i32'
303 ; AVX512BITALG-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %ctpop = call <16 x i32> @llvm.ctpop.v16i32(<16 x i32> %a)
304 ; AVX512BITALG-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctpop
306 %ctpop = call <16 x i32> @llvm.ctpop.v16i32(<16 x i32> %a)
307 ret <16 x i32> %ctpop
310 define <8 x i16> @var_ctpop_v8i16(<8 x i16> %a) {
311 ; SSE2-LABEL: 'var_ctpop_v8i16'
312 ; SSE2-NEXT: Cost Model: Found an estimated cost of 13 for instruction: %ctpop = call <8 x i16> @llvm.ctpop.v8i16(<8 x i16> %a)
313 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctpop
315 ; SSE42-LABEL: 'var_ctpop_v8i16'
316 ; SSE42-NEXT: Cost Model: Found an estimated cost of 13 for instruction: %ctpop = call <8 x i16> @llvm.ctpop.v8i16(<8 x i16> %a)
317 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctpop
319 ; AVX1-LABEL: 'var_ctpop_v8i16'
320 ; AVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %ctpop = call <8 x i16> @llvm.ctpop.v8i16(<8 x i16> %a)
321 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctpop
323 ; AVX2-LABEL: 'var_ctpop_v8i16'
324 ; AVX2-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %ctpop = call <8 x i16> @llvm.ctpop.v8i16(<8 x i16> %a)
325 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctpop
327 ; AVX512F-LABEL: 'var_ctpop_v8i16'
328 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %ctpop = call <8 x i16> @llvm.ctpop.v8i16(<8 x i16> %a)
329 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctpop
331 ; AVX512BW-LABEL: 'var_ctpop_v8i16'
332 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %ctpop = call <8 x i16> @llvm.ctpop.v8i16(<8 x i16> %a)
333 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctpop
335 ; AVX512VPOPCNT-LABEL: 'var_ctpop_v8i16'
336 ; AVX512VPOPCNT-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %ctpop = call <8 x i16> @llvm.ctpop.v8i16(<8 x i16> %a)
337 ; AVX512VPOPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctpop
339 ; AVX512BITALG-LABEL: 'var_ctpop_v8i16'
340 ; AVX512BITALG-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctpop = call <8 x i16> @llvm.ctpop.v8i16(<8 x i16> %a)
341 ; AVX512BITALG-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctpop
343 %ctpop = call <8 x i16> @llvm.ctpop.v8i16(<8 x i16> %a)
347 define <16 x i16> @var_ctpop_v16i16(<16 x i16> %a) {
348 ; SSE2-LABEL: 'var_ctpop_v16i16'
349 ; SSE2-NEXT: Cost Model: Found an estimated cost of 26 for instruction: %ctpop = call <16 x i16> @llvm.ctpop.v16i16(<16 x i16> %a)
350 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctpop
352 ; SSE42-LABEL: 'var_ctpop_v16i16'
353 ; SSE42-NEXT: Cost Model: Found an estimated cost of 26 for instruction: %ctpop = call <16 x i16> @llvm.ctpop.v16i16(<16 x i16> %a)
354 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctpop
356 ; AVX1-LABEL: 'var_ctpop_v16i16'
357 ; AVX1-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %ctpop = call <16 x i16> @llvm.ctpop.v16i16(<16 x i16> %a)
358 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctpop
360 ; AVX2-LABEL: 'var_ctpop_v16i16'
361 ; AVX2-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %ctpop = call <16 x i16> @llvm.ctpop.v16i16(<16 x i16> %a)
362 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctpop
364 ; AVX512F-LABEL: 'var_ctpop_v16i16'
365 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %ctpop = call <16 x i16> @llvm.ctpop.v16i16(<16 x i16> %a)
366 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctpop
368 ; AVX512BW-LABEL: 'var_ctpop_v16i16'
369 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %ctpop = call <16 x i16> @llvm.ctpop.v16i16(<16 x i16> %a)
370 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctpop
372 ; AVX512VPOPCNT-LABEL: 'var_ctpop_v16i16'
373 ; AVX512VPOPCNT-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %ctpop = call <16 x i16> @llvm.ctpop.v16i16(<16 x i16> %a)
374 ; AVX512VPOPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctpop
376 ; AVX512BITALG-LABEL: 'var_ctpop_v16i16'
377 ; AVX512BITALG-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctpop = call <16 x i16> @llvm.ctpop.v16i16(<16 x i16> %a)
378 ; AVX512BITALG-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctpop
380 %ctpop = call <16 x i16> @llvm.ctpop.v16i16(<16 x i16> %a)
381 ret <16 x i16> %ctpop
384 define <32 x i16> @var_ctpop_v32i16(<32 x i16> %a) {
385 ; SSE2-LABEL: 'var_ctpop_v32i16'
386 ; SSE2-NEXT: Cost Model: Found an estimated cost of 52 for instruction: %ctpop = call <32 x i16> @llvm.ctpop.v32i16(<32 x i16> %a)
387 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctpop
389 ; SSE42-LABEL: 'var_ctpop_v32i16'
390 ; SSE42-NEXT: Cost Model: Found an estimated cost of 52 for instruction: %ctpop = call <32 x i16> @llvm.ctpop.v32i16(<32 x i16> %a)
391 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctpop
393 ; AVX1-LABEL: 'var_ctpop_v32i16'
394 ; AVX1-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %ctpop = call <32 x i16> @llvm.ctpop.v32i16(<32 x i16> %a)
395 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctpop
397 ; AVX2-LABEL: 'var_ctpop_v32i16'
398 ; AVX2-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %ctpop = call <32 x i16> @llvm.ctpop.v32i16(<32 x i16> %a)
399 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctpop
401 ; AVX512F-LABEL: 'var_ctpop_v32i16'
402 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %ctpop = call <32 x i16> @llvm.ctpop.v32i16(<32 x i16> %a)
403 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctpop
405 ; AVX512BW-LABEL: 'var_ctpop_v32i16'
406 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %ctpop = call <32 x i16> @llvm.ctpop.v32i16(<32 x i16> %a)
407 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctpop
409 ; AVX512VPOPCNT-LABEL: 'var_ctpop_v32i16'
410 ; AVX512VPOPCNT-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %ctpop = call <32 x i16> @llvm.ctpop.v32i16(<32 x i16> %a)
411 ; AVX512VPOPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctpop
413 ; AVX512BITALG-LABEL: 'var_ctpop_v32i16'
414 ; AVX512BITALG-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctpop = call <32 x i16> @llvm.ctpop.v32i16(<32 x i16> %a)
415 ; AVX512BITALG-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctpop
417 %ctpop = call <32 x i16> @llvm.ctpop.v32i16(<32 x i16> %a)
418 ret <32 x i16> %ctpop
421 define <16 x i8> @var_ctpop_v16i8(<16 x i8> %a) {
422 ; SSE2-LABEL: 'var_ctpop_v16i8'
423 ; SSE2-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %ctpop = call <16 x i8> @llvm.ctpop.v16i8(<16 x i8> %a)
424 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctpop
426 ; SSE42-LABEL: 'var_ctpop_v16i8'
427 ; SSE42-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %ctpop = call <16 x i8> @llvm.ctpop.v16i8(<16 x i8> %a)
428 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctpop
430 ; AVX1-LABEL: 'var_ctpop_v16i8'
431 ; AVX1-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %ctpop = call <16 x i8> @llvm.ctpop.v16i8(<16 x i8> %a)
432 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctpop
434 ; AVX2-LABEL: 'var_ctpop_v16i8'
435 ; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %ctpop = call <16 x i8> @llvm.ctpop.v16i8(<16 x i8> %a)
436 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctpop
438 ; AVX512F-LABEL: 'var_ctpop_v16i8'
439 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %ctpop = call <16 x i8> @llvm.ctpop.v16i8(<16 x i8> %a)
440 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctpop
442 ; AVX512BW-LABEL: 'var_ctpop_v16i8'
443 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %ctpop = call <16 x i8> @llvm.ctpop.v16i8(<16 x i8> %a)
444 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctpop
446 ; AVX512VPOPCNT-LABEL: 'var_ctpop_v16i8'
447 ; AVX512VPOPCNT-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %ctpop = call <16 x i8> @llvm.ctpop.v16i8(<16 x i8> %a)
448 ; AVX512VPOPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctpop
450 ; AVX512BITALG-LABEL: 'var_ctpop_v16i8'
451 ; AVX512BITALG-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctpop = call <16 x i8> @llvm.ctpop.v16i8(<16 x i8> %a)
452 ; AVX512BITALG-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctpop
454 %ctpop = call <16 x i8> @llvm.ctpop.v16i8(<16 x i8> %a)
458 define <32 x i8> @var_ctpop_v32i8(<32 x i8> %a) {
459 ; SSE2-LABEL: 'var_ctpop_v32i8'
460 ; SSE2-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %ctpop = call <32 x i8> @llvm.ctpop.v32i8(<32 x i8> %a)
461 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctpop
463 ; SSE42-LABEL: 'var_ctpop_v32i8'
464 ; SSE42-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %ctpop = call <32 x i8> @llvm.ctpop.v32i8(<32 x i8> %a)
465 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctpop
467 ; AVX1-LABEL: 'var_ctpop_v32i8'
468 ; AVX1-NEXT: Cost Model: Found an estimated cost of 13 for instruction: %ctpop = call <32 x i8> @llvm.ctpop.v32i8(<32 x i8> %a)
469 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctpop
471 ; AVX2-LABEL: 'var_ctpop_v32i8'
472 ; AVX2-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %ctpop = call <32 x i8> @llvm.ctpop.v32i8(<32 x i8> %a)
473 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctpop
475 ; AVX512F-LABEL: 'var_ctpop_v32i8'
476 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %ctpop = call <32 x i8> @llvm.ctpop.v32i8(<32 x i8> %a)
477 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctpop
479 ; AVX512BW-LABEL: 'var_ctpop_v32i8'
480 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %ctpop = call <32 x i8> @llvm.ctpop.v32i8(<32 x i8> %a)
481 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctpop
483 ; AVX512VPOPCNT-LABEL: 'var_ctpop_v32i8'
484 ; AVX512VPOPCNT-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %ctpop = call <32 x i8> @llvm.ctpop.v32i8(<32 x i8> %a)
485 ; AVX512VPOPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctpop
487 ; AVX512BITALG-LABEL: 'var_ctpop_v32i8'
488 ; AVX512BITALG-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctpop = call <32 x i8> @llvm.ctpop.v32i8(<32 x i8> %a)
489 ; AVX512BITALG-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctpop
491 %ctpop = call <32 x i8> @llvm.ctpop.v32i8(<32 x i8> %a)
495 define <64 x i8> @var_ctpop_v64i8(<64 x i8> %a) {
496 ; SSE2-LABEL: 'var_ctpop_v64i8'
497 ; SSE2-NEXT: Cost Model: Found an estimated cost of 40 for instruction: %ctpop = call <64 x i8> @llvm.ctpop.v64i8(<64 x i8> %a)
498 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctpop
500 ; SSE42-LABEL: 'var_ctpop_v64i8'
501 ; SSE42-NEXT: Cost Model: Found an estimated cost of 44 for instruction: %ctpop = call <64 x i8> @llvm.ctpop.v64i8(<64 x i8> %a)
502 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctpop
504 ; AVX1-LABEL: 'var_ctpop_v64i8'
505 ; AVX1-NEXT: Cost Model: Found an estimated cost of 26 for instruction: %ctpop = call <64 x i8> @llvm.ctpop.v64i8(<64 x i8> %a)
506 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctpop
508 ; AVX2-LABEL: 'var_ctpop_v64i8'
509 ; AVX2-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %ctpop = call <64 x i8> @llvm.ctpop.v64i8(<64 x i8> %a)
510 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctpop
512 ; AVX512F-LABEL: 'var_ctpop_v64i8'
513 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %ctpop = call <64 x i8> @llvm.ctpop.v64i8(<64 x i8> %a)
514 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctpop
516 ; AVX512BW-LABEL: 'var_ctpop_v64i8'
517 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %ctpop = call <64 x i8> @llvm.ctpop.v64i8(<64 x i8> %a)
518 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctpop
520 ; AVX512VPOPCNT-LABEL: 'var_ctpop_v64i8'
521 ; AVX512VPOPCNT-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %ctpop = call <64 x i8> @llvm.ctpop.v64i8(<64 x i8> %a)
522 ; AVX512VPOPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctpop
524 ; AVX512BITALG-LABEL: 'var_ctpop_v64i8'
525 ; AVX512BITALG-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctpop = call <64 x i8> @llvm.ctpop.v64i8(<64 x i8> %a)
526 ; AVX512BITALG-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctpop
528 %ctpop = call <64 x i8> @llvm.ctpop.v64i8(<64 x i8> %a)