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=-bmi,+sse2 | FileCheck %s -check-prefixes=SSE2,NOBMI
3 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+bmi,+sse2 | FileCheck %s -check-prefixes=SSE2,BMI
4 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+bmi,+sse4.2 | FileCheck %s -check-prefixes=BMI,SSE42
5 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+bmi,+avx | FileCheck %s -check-prefixes=BMI,AVX1
6 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+bmi,+avx2 | FileCheck %s -check-prefixes=BMI,AVX2
7 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+bmi,+avx512f | FileCheck %s -check-prefixes=BMI,AVX512,AVX512F
8 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+bmi,+avx512vl,+avx512bw,+avx512dq | FileCheck %s -check-prefixes=BMI,AVX512,AVX512BW
9 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+bmi,+avx512vl,+avx512bw,+avx512dq | FileCheck %s -check-prefixes=BMI,AVX512,AVX512BW
10 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+bmi,+avx512vl,+avx512vpopcntdq | FileCheck %s -check-prefixes=BMI,AVX512,AVX512VPOPCNT
11 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+bmi,+avx512vl,+avx512bitalg | FileCheck %s -check-prefixes=BMI,AVX512,AVX512BITALG
13 ; Verify the cost of scalar trailing zero count instructions.
15 declare i64 @llvm.cttz.i64(i64, i1)
16 declare i32 @llvm.cttz.i32(i32, i1)
17 declare i16 @llvm.cttz.i16(i16, i1)
18 declare i8 @llvm.cttz.i8(i8, i1)
20 define i64 @var_cttz_i64(i64 %a) {
21 ; NOBMI-LABEL: 'var_cttz_i64'
22 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %cttz = call i64 @llvm.cttz.i64(i64 %a, i1 false)
23 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i64 %cttz
25 ; BMI-LABEL: 'var_cttz_i64'
26 ; BMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %cttz = call i64 @llvm.cttz.i64(i64 %a, i1 false)
27 ; BMI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i64 %cttz
29 %cttz = call i64 @llvm.cttz.i64(i64 %a, i1 0)
33 define i64 @var_cttz_i64u(i64 %a) {
34 ; NOBMI-LABEL: 'var_cttz_i64u'
35 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %cttz = call i64 @llvm.cttz.i64(i64 %a, i1 true)
36 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i64 %cttz
38 ; BMI-LABEL: 'var_cttz_i64u'
39 ; BMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %cttz = call i64 @llvm.cttz.i64(i64 %a, i1 true)
40 ; BMI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i64 %cttz
42 %cttz = call i64 @llvm.cttz.i64(i64 %a, i1 1)
46 define i32 @var_cttz_i32(i32 %a) {
47 ; NOBMI-LABEL: 'var_cttz_i32'
48 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %cttz = call i32 @llvm.cttz.i32(i32 %a, i1 false)
49 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 %cttz
51 ; BMI-LABEL: 'var_cttz_i32'
52 ; BMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %cttz = call i32 @llvm.cttz.i32(i32 %a, i1 false)
53 ; BMI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 %cttz
55 %cttz = call i32 @llvm.cttz.i32(i32 %a, i1 0)
59 define i32 @var_cttz_i32u(i32 %a) {
60 ; NOBMI-LABEL: 'var_cttz_i32u'
61 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %cttz = call i32 @llvm.cttz.i32(i32 %a, i1 true)
62 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 %cttz
64 ; BMI-LABEL: 'var_cttz_i32u'
65 ; BMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %cttz = call i32 @llvm.cttz.i32(i32 %a, i1 true)
66 ; BMI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 %cttz
68 %cttz = call i32 @llvm.cttz.i32(i32 %a, i1 1)
72 define i16 @var_cttz_i16(i16 %a) {
73 ; NOBMI-LABEL: 'var_cttz_i16'
74 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %cttz = call i16 @llvm.cttz.i16(i16 %a, i1 false)
75 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i16 %cttz
77 ; BMI-LABEL: 'var_cttz_i16'
78 ; BMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %cttz = call i16 @llvm.cttz.i16(i16 %a, i1 false)
79 ; BMI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i16 %cttz
81 %cttz = call i16 @llvm.cttz.i16(i16 %a, i1 0)
85 define i16 @var_cttz_i16u(i16 %a) {
86 ; NOBMI-LABEL: 'var_cttz_i16u'
87 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %cttz = call i16 @llvm.cttz.i16(i16 %a, i1 true)
88 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i16 %cttz
90 ; BMI-LABEL: 'var_cttz_i16u'
91 ; BMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %cttz = call i16 @llvm.cttz.i16(i16 %a, i1 true)
92 ; BMI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i16 %cttz
94 %cttz = call i16 @llvm.cttz.i16(i16 %a, i1 1)
98 define i8 @var_cttz_i8(i8 %a) {
99 ; NOBMI-LABEL: 'var_cttz_i8'
100 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %cttz = call i8 @llvm.cttz.i8(i8 %a, i1 false)
101 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i8 %cttz
103 ; BMI-LABEL: 'var_cttz_i8'
104 ; BMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %cttz = call i8 @llvm.cttz.i8(i8 %a, i1 false)
105 ; BMI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i8 %cttz
107 %cttz = call i8 @llvm.cttz.i8(i8 %a, i1 0)
111 define i8 @var_cttz_i8u(i8 %a) {
112 ; NOBMI-LABEL: 'var_cttz_i8u'
113 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %cttz = call i8 @llvm.cttz.i8(i8 %a, i1 true)
114 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i8 %cttz
116 ; BMI-LABEL: 'var_cttz_i8u'
117 ; BMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %cttz = call i8 @llvm.cttz.i8(i8 %a, i1 true)
118 ; BMI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i8 %cttz
120 %cttz = call i8 @llvm.cttz.i8(i8 %a, i1 1)
124 ; Verify the cost of vector trailing zero count instructions.
126 declare <2 x i64> @llvm.cttz.v2i64(<2 x i64>, i1)
127 declare <4 x i32> @llvm.cttz.v4i32(<4 x i32>, i1)
128 declare <8 x i16> @llvm.cttz.v8i16(<8 x i16>, i1)
129 declare <16 x i8> @llvm.cttz.v16i8(<16 x i8>, i1)
131 declare <4 x i64> @llvm.cttz.v4i64(<4 x i64>, i1)
132 declare <8 x i32> @llvm.cttz.v8i32(<8 x i32>, i1)
133 declare <16 x i16> @llvm.cttz.v16i16(<16 x i16>, i1)
134 declare <32 x i8> @llvm.cttz.v32i8(<32 x i8>, i1)
136 declare <8 x i64> @llvm.cttz.v8i64(<8 x i64>, i1)
137 declare <16 x i32> @llvm.cttz.v16i32(<16 x i32>, i1)
138 declare <32 x i16> @llvm.cttz.v32i16(<32 x i16>, i1)
139 declare <64 x i8> @llvm.cttz.v64i8(<64 x i8>, i1)
141 define <2 x i64> @var_cttz_v2i64(<2 x i64> %a) {
142 ; SSE2-LABEL: 'var_cttz_v2i64'
143 ; SSE2-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 false)
144 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %cttz
146 ; SSE42-LABEL: 'var_cttz_v2i64'
147 ; SSE42-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 false)
148 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %cttz
150 ; AVX1-LABEL: 'var_cttz_v2i64'
151 ; AVX1-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 false)
152 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %cttz
154 ; AVX2-LABEL: 'var_cttz_v2i64'
155 ; AVX2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 false)
156 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %cttz
158 ; AVX512-LABEL: 'var_cttz_v2i64'
159 ; AVX512-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 false)
160 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %cttz
162 %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 0)
166 define <2 x i64> @var_cttz_v2i64u(<2 x i64> %a) {
167 ; SSE2-LABEL: 'var_cttz_v2i64u'
168 ; SSE2-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 true)
169 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %cttz
171 ; SSE42-LABEL: 'var_cttz_v2i64u'
172 ; SSE42-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 true)
173 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %cttz
175 ; AVX1-LABEL: 'var_cttz_v2i64u'
176 ; AVX1-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 true)
177 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %cttz
179 ; AVX2-LABEL: 'var_cttz_v2i64u'
180 ; AVX2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 true)
181 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %cttz
183 ; AVX512-LABEL: 'var_cttz_v2i64u'
184 ; AVX512-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 true)
185 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %cttz
187 %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 1)
191 define <4 x i64> @var_cttz_v4i64(<4 x i64> %a) {
192 ; SSE2-LABEL: 'var_cttz_v4i64'
193 ; SSE2-NEXT: Cost Model: Found an estimated cost of 28 for instruction: %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 false)
194 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %cttz
196 ; SSE42-LABEL: 'var_cttz_v4i64'
197 ; SSE42-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 false)
198 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %cttz
200 ; AVX1-LABEL: 'var_cttz_v4i64'
201 ; AVX1-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 false)
202 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %cttz
204 ; AVX2-LABEL: 'var_cttz_v4i64'
205 ; AVX2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 false)
206 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %cttz
208 ; AVX512-LABEL: 'var_cttz_v4i64'
209 ; AVX512-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 false)
210 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %cttz
212 %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 0)
216 define <4 x i64> @var_cttz_v4i64u(<4 x i64> %a) {
217 ; SSE2-LABEL: 'var_cttz_v4i64u'
218 ; SSE2-NEXT: Cost Model: Found an estimated cost of 28 for instruction: %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 true)
219 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %cttz
221 ; SSE42-LABEL: 'var_cttz_v4i64u'
222 ; SSE42-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 true)
223 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %cttz
225 ; AVX1-LABEL: 'var_cttz_v4i64u'
226 ; AVX1-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 true)
227 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %cttz
229 ; AVX2-LABEL: 'var_cttz_v4i64u'
230 ; AVX2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 true)
231 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %cttz
233 ; AVX512-LABEL: 'var_cttz_v4i64u'
234 ; AVX512-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 true)
235 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %cttz
237 %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 1)
241 define <8 x i64> @var_cttz_v8i64(<8 x i64> %a) {
242 ; SSE2-LABEL: 'var_cttz_v8i64'
243 ; SSE2-NEXT: Cost Model: Found an estimated cost of 56 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 false)
244 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %cttz
246 ; SSE42-LABEL: 'var_cttz_v8i64'
247 ; SSE42-NEXT: Cost Model: Found an estimated cost of 40 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 false)
248 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %cttz
250 ; AVX1-LABEL: 'var_cttz_v8i64'
251 ; AVX1-NEXT: Cost Model: Found an estimated cost of 44 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 false)
252 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %cttz
254 ; AVX2-LABEL: 'var_cttz_v8i64'
255 ; AVX2-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 false)
256 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %cttz
258 ; AVX512F-LABEL: 'var_cttz_v8i64'
259 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 false)
260 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %cttz
262 ; AVX512BW-LABEL: 'var_cttz_v8i64'
263 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 false)
264 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %cttz
266 ; AVX512VPOPCNT-LABEL: 'var_cttz_v8i64'
267 ; AVX512VPOPCNT-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 false)
268 ; AVX512VPOPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %cttz
270 ; AVX512BITALG-LABEL: 'var_cttz_v8i64'
271 ; AVX512BITALG-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 false)
272 ; AVX512BITALG-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %cttz
274 %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 0)
278 define <8 x i64> @var_cttz_v8i64u(<8 x i64> %a) {
279 ; SSE2-LABEL: 'var_cttz_v8i64u'
280 ; SSE2-NEXT: Cost Model: Found an estimated cost of 56 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 true)
281 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %cttz
283 ; SSE42-LABEL: 'var_cttz_v8i64u'
284 ; SSE42-NEXT: Cost Model: Found an estimated cost of 40 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 true)
285 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %cttz
287 ; AVX1-LABEL: 'var_cttz_v8i64u'
288 ; AVX1-NEXT: Cost Model: Found an estimated cost of 44 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 true)
289 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %cttz
291 ; AVX2-LABEL: 'var_cttz_v8i64u'
292 ; AVX2-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 true)
293 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %cttz
295 ; AVX512F-LABEL: 'var_cttz_v8i64u'
296 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 true)
297 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %cttz
299 ; AVX512BW-LABEL: 'var_cttz_v8i64u'
300 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 true)
301 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %cttz
303 ; AVX512VPOPCNT-LABEL: 'var_cttz_v8i64u'
304 ; AVX512VPOPCNT-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 true)
305 ; AVX512VPOPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %cttz
307 ; AVX512BITALG-LABEL: 'var_cttz_v8i64u'
308 ; AVX512BITALG-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 true)
309 ; AVX512BITALG-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %cttz
311 %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 1)
315 define <4 x i32> @var_cttz_v4i32(<4 x i32> %a) {
316 ; SSE2-LABEL: 'var_cttz_v4i32'
317 ; SSE2-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 false)
318 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %cttz
320 ; SSE42-LABEL: 'var_cttz_v4i32'
321 ; SSE42-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 false)
322 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %cttz
324 ; AVX1-LABEL: 'var_cttz_v4i32'
325 ; AVX1-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 false)
326 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %cttz
328 ; AVX2-LABEL: 'var_cttz_v4i32'
329 ; AVX2-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 false)
330 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %cttz
332 ; AVX512-LABEL: 'var_cttz_v4i32'
333 ; AVX512-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 false)
334 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %cttz
336 %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 0)
340 define <4 x i32> @var_cttz_v4i32u(<4 x i32> %a) {
341 ; SSE2-LABEL: 'var_cttz_v4i32u'
342 ; SSE2-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 true)
343 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %cttz
345 ; SSE42-LABEL: 'var_cttz_v4i32u'
346 ; SSE42-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 true)
347 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %cttz
349 ; AVX1-LABEL: 'var_cttz_v4i32u'
350 ; AVX1-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 true)
351 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %cttz
353 ; AVX2-LABEL: 'var_cttz_v4i32u'
354 ; AVX2-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 true)
355 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %cttz
357 ; AVX512-LABEL: 'var_cttz_v4i32u'
358 ; AVX512-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 true)
359 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %cttz
361 %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 1)
365 define <8 x i32> @var_cttz_v8i32(<8 x i32> %a) {
366 ; SSE2-LABEL: 'var_cttz_v8i32'
367 ; SSE2-NEXT: Cost Model: Found an estimated cost of 36 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 false)
368 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %cttz
370 ; SSE42-LABEL: 'var_cttz_v8i32'
371 ; SSE42-NEXT: Cost Model: Found an estimated cost of 28 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 false)
372 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %cttz
374 ; AVX1-LABEL: 'var_cttz_v8i32'
375 ; AVX1-NEXT: Cost Model: Found an estimated cost of 30 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 false)
376 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %cttz
378 ; AVX2-LABEL: 'var_cttz_v8i32'
379 ; AVX2-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 false)
380 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %cttz
382 ; AVX512-LABEL: 'var_cttz_v8i32'
383 ; AVX512-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 false)
384 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %cttz
386 %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 0)
390 define <8 x i32> @var_cttz_v8i32u(<8 x i32> %a) {
391 ; SSE2-LABEL: 'var_cttz_v8i32u'
392 ; SSE2-NEXT: Cost Model: Found an estimated cost of 36 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 true)
393 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %cttz
395 ; SSE42-LABEL: 'var_cttz_v8i32u'
396 ; SSE42-NEXT: Cost Model: Found an estimated cost of 28 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 true)
397 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %cttz
399 ; AVX1-LABEL: 'var_cttz_v8i32u'
400 ; AVX1-NEXT: Cost Model: Found an estimated cost of 30 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 true)
401 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %cttz
403 ; AVX2-LABEL: 'var_cttz_v8i32u'
404 ; AVX2-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 true)
405 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %cttz
407 ; AVX512-LABEL: 'var_cttz_v8i32u'
408 ; AVX512-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 true)
409 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %cttz
411 %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 1)
415 define <16 x i32> @var_cttz_v16i32(<16 x i32> %a) {
416 ; SSE2-LABEL: 'var_cttz_v16i32'
417 ; SSE2-NEXT: Cost Model: Found an estimated cost of 72 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 false)
418 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %cttz
420 ; SSE42-LABEL: 'var_cttz_v16i32'
421 ; SSE42-NEXT: Cost Model: Found an estimated cost of 56 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 false)
422 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %cttz
424 ; AVX1-LABEL: 'var_cttz_v16i32'
425 ; AVX1-NEXT: Cost Model: Found an estimated cost of 60 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 false)
426 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %cttz
428 ; AVX2-LABEL: 'var_cttz_v16i32'
429 ; AVX2-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 false)
430 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %cttz
432 ; AVX512F-LABEL: 'var_cttz_v16i32'
433 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 28 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 false)
434 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %cttz
436 ; AVX512BW-LABEL: 'var_cttz_v16i32'
437 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 false)
438 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %cttz
440 ; AVX512VPOPCNT-LABEL: 'var_cttz_v16i32'
441 ; AVX512VPOPCNT-NEXT: Cost Model: Found an estimated cost of 28 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 false)
442 ; AVX512VPOPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %cttz
444 ; AVX512BITALG-LABEL: 'var_cttz_v16i32'
445 ; AVX512BITALG-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 false)
446 ; AVX512BITALG-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %cttz
448 %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 0)
452 define <16 x i32> @var_cttz_v16i32u(<16 x i32> %a) {
453 ; SSE2-LABEL: 'var_cttz_v16i32u'
454 ; SSE2-NEXT: Cost Model: Found an estimated cost of 72 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 true)
455 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %cttz
457 ; SSE42-LABEL: 'var_cttz_v16i32u'
458 ; SSE42-NEXT: Cost Model: Found an estimated cost of 56 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 true)
459 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %cttz
461 ; AVX1-LABEL: 'var_cttz_v16i32u'
462 ; AVX1-NEXT: Cost Model: Found an estimated cost of 60 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 true)
463 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %cttz
465 ; AVX2-LABEL: 'var_cttz_v16i32u'
466 ; AVX2-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 true)
467 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %cttz
469 ; AVX512F-LABEL: 'var_cttz_v16i32u'
470 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 28 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 true)
471 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %cttz
473 ; AVX512BW-LABEL: 'var_cttz_v16i32u'
474 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 true)
475 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %cttz
477 ; AVX512VPOPCNT-LABEL: 'var_cttz_v16i32u'
478 ; AVX512VPOPCNT-NEXT: Cost Model: Found an estimated cost of 28 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 true)
479 ; AVX512VPOPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %cttz
481 ; AVX512BITALG-LABEL: 'var_cttz_v16i32u'
482 ; AVX512BITALG-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 true)
483 ; AVX512BITALG-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %cttz
485 %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 1)
489 define <8 x i16> @var_cttz_v8i16(<8 x i16> %a) {
490 ; SSE2-LABEL: 'var_cttz_v8i16'
491 ; SSE2-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 false)
492 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %cttz
494 ; SSE42-LABEL: 'var_cttz_v8i16'
495 ; SSE42-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 false)
496 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %cttz
498 ; AVX1-LABEL: 'var_cttz_v8i16'
499 ; AVX1-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 false)
500 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %cttz
502 ; AVX2-LABEL: 'var_cttz_v8i16'
503 ; AVX2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 false)
504 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %cttz
506 ; AVX512-LABEL: 'var_cttz_v8i16'
507 ; AVX512-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 false)
508 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %cttz
510 %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 0)
514 define <8 x i16> @var_cttz_v8i16u(<8 x i16> %a) {
515 ; SSE2-LABEL: 'var_cttz_v8i16u'
516 ; SSE2-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 true)
517 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %cttz
519 ; SSE42-LABEL: 'var_cttz_v8i16u'
520 ; SSE42-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 true)
521 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %cttz
523 ; AVX1-LABEL: 'var_cttz_v8i16u'
524 ; AVX1-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 true)
525 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %cttz
527 ; AVX2-LABEL: 'var_cttz_v8i16u'
528 ; AVX2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 true)
529 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %cttz
531 ; AVX512-LABEL: 'var_cttz_v8i16u'
532 ; AVX512-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 true)
533 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %cttz
535 %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 1)
539 define <16 x i16> @var_cttz_v16i16(<16 x i16> %a) {
540 ; SSE2-LABEL: 'var_cttz_v16i16'
541 ; SSE2-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 false)
542 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %cttz
544 ; SSE42-LABEL: 'var_cttz_v16i16'
545 ; SSE42-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 false)
546 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %cttz
548 ; AVX1-LABEL: 'var_cttz_v16i16'
549 ; AVX1-NEXT: Cost Model: Found an estimated cost of 26 for instruction: %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 false)
550 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %cttz
552 ; AVX2-LABEL: 'var_cttz_v16i16'
553 ; AVX2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 false)
554 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %cttz
556 ; AVX512-LABEL: 'var_cttz_v16i16'
557 ; AVX512-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 false)
558 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %cttz
560 %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 0)
564 define <16 x i16> @var_cttz_v16i16u(<16 x i16> %a) {
565 ; SSE2-LABEL: 'var_cttz_v16i16u'
566 ; SSE2-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 true)
567 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %cttz
569 ; SSE42-LABEL: 'var_cttz_v16i16u'
570 ; SSE42-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 true)
571 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %cttz
573 ; AVX1-LABEL: 'var_cttz_v16i16u'
574 ; AVX1-NEXT: Cost Model: Found an estimated cost of 26 for instruction: %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 true)
575 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %cttz
577 ; AVX2-LABEL: 'var_cttz_v16i16u'
578 ; AVX2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 true)
579 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %cttz
581 ; AVX512-LABEL: 'var_cttz_v16i16u'
582 ; AVX512-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 true)
583 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %cttz
585 %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 1)
589 define <32 x i16> @var_cttz_v32i16(<32 x i16> %a) {
590 ; SSE2-LABEL: 'var_cttz_v32i16'
591 ; SSE2-NEXT: Cost Model: Found an estimated cost of 64 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 false)
592 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %cttz
594 ; SSE42-LABEL: 'var_cttz_v32i16'
595 ; SSE42-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 false)
596 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %cttz
598 ; AVX1-LABEL: 'var_cttz_v32i16'
599 ; AVX1-NEXT: Cost Model: Found an estimated cost of 52 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 false)
600 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %cttz
602 ; AVX2-LABEL: 'var_cttz_v32i16'
603 ; AVX2-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 false)
604 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %cttz
606 ; AVX512F-LABEL: 'var_cttz_v32i16'
607 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 false)
608 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %cttz
610 ; AVX512BW-LABEL: 'var_cttz_v32i16'
611 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 false)
612 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %cttz
614 ; AVX512VPOPCNT-LABEL: 'var_cttz_v32i16'
615 ; AVX512VPOPCNT-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 false)
616 ; AVX512VPOPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %cttz
618 ; AVX512BITALG-LABEL: 'var_cttz_v32i16'
619 ; AVX512BITALG-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 false)
620 ; AVX512BITALG-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %cttz
622 %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 0)
626 define <32 x i16> @var_cttz_v32i16u(<32 x i16> %a) {
627 ; SSE2-LABEL: 'var_cttz_v32i16u'
628 ; SSE2-NEXT: Cost Model: Found an estimated cost of 64 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 true)
629 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %cttz
631 ; SSE42-LABEL: 'var_cttz_v32i16u'
632 ; SSE42-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 true)
633 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %cttz
635 ; AVX1-LABEL: 'var_cttz_v32i16u'
636 ; AVX1-NEXT: Cost Model: Found an estimated cost of 52 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 true)
637 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %cttz
639 ; AVX2-LABEL: 'var_cttz_v32i16u'
640 ; AVX2-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 true)
641 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %cttz
643 ; AVX512F-LABEL: 'var_cttz_v32i16u'
644 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 true)
645 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %cttz
647 ; AVX512BW-LABEL: 'var_cttz_v32i16u'
648 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 true)
649 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %cttz
651 ; AVX512VPOPCNT-LABEL: 'var_cttz_v32i16u'
652 ; AVX512VPOPCNT-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 true)
653 ; AVX512VPOPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %cttz
655 ; AVX512BITALG-LABEL: 'var_cttz_v32i16u'
656 ; AVX512BITALG-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 true)
657 ; AVX512BITALG-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %cttz
659 %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 1)
663 define <16 x i8> @var_cttz_v16i8(<16 x i8> %a) {
664 ; SSE2-LABEL: 'var_cttz_v16i8'
665 ; SSE2-NEXT: Cost Model: Found an estimated cost of 13 for instruction: %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 false)
666 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %cttz
668 ; SSE42-LABEL: 'var_cttz_v16i8'
669 ; SSE42-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 false)
670 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %cttz
672 ; AVX1-LABEL: 'var_cttz_v16i8'
673 ; AVX1-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 false)
674 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %cttz
676 ; AVX2-LABEL: 'var_cttz_v16i8'
677 ; AVX2-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 false)
678 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %cttz
680 ; AVX512-LABEL: 'var_cttz_v16i8'
681 ; AVX512-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 false)
682 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %cttz
684 %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 0)
688 define <16 x i8> @var_cttz_v16i8u(<16 x i8> %a) {
689 ; SSE2-LABEL: 'var_cttz_v16i8u'
690 ; SSE2-NEXT: Cost Model: Found an estimated cost of 13 for instruction: %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 true)
691 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %cttz
693 ; SSE42-LABEL: 'var_cttz_v16i8u'
694 ; SSE42-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 true)
695 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %cttz
697 ; AVX1-LABEL: 'var_cttz_v16i8u'
698 ; AVX1-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 true)
699 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %cttz
701 ; AVX2-LABEL: 'var_cttz_v16i8u'
702 ; AVX2-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 true)
703 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %cttz
705 ; AVX512-LABEL: 'var_cttz_v16i8u'
706 ; AVX512-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 true)
707 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %cttz
709 %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 1)
713 define <32 x i8> @var_cttz_v32i8(<32 x i8> %a) {
714 ; SSE2-LABEL: 'var_cttz_v32i8'
715 ; SSE2-NEXT: Cost Model: Found an estimated cost of 26 for instruction: %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 false)
716 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %cttz
718 ; SSE42-LABEL: 'var_cttz_v32i8'
719 ; SSE42-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 false)
720 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %cttz
722 ; AVX1-LABEL: 'var_cttz_v32i8'
723 ; AVX1-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 false)
724 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %cttz
726 ; AVX2-LABEL: 'var_cttz_v32i8'
727 ; AVX2-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 false)
728 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %cttz
730 ; AVX512-LABEL: 'var_cttz_v32i8'
731 ; AVX512-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 false)
732 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %cttz
734 %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 0)
738 define <32 x i8> @var_cttz_v32i8u(<32 x i8> %a) {
739 ; SSE2-LABEL: 'var_cttz_v32i8u'
740 ; SSE2-NEXT: Cost Model: Found an estimated cost of 26 for instruction: %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 true)
741 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %cttz
743 ; SSE42-LABEL: 'var_cttz_v32i8u'
744 ; SSE42-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 true)
745 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %cttz
747 ; AVX1-LABEL: 'var_cttz_v32i8u'
748 ; AVX1-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 true)
749 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %cttz
751 ; AVX2-LABEL: 'var_cttz_v32i8u'
752 ; AVX2-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 true)
753 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %cttz
755 ; AVX512-LABEL: 'var_cttz_v32i8u'
756 ; AVX512-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 true)
757 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %cttz
759 %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 1)
763 define <64 x i8> @var_cttz_v64i8(<64 x i8> %a) {
764 ; SSE2-LABEL: 'var_cttz_v64i8'
765 ; SSE2-NEXT: Cost Model: Found an estimated cost of 52 for instruction: %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 false)
766 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %cttz
768 ; SSE42-LABEL: 'var_cttz_v64i8'
769 ; SSE42-NEXT: Cost Model: Found an estimated cost of 36 for instruction: %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 false)
770 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %cttz
772 ; AVX1-LABEL: 'var_cttz_v64i8'
773 ; AVX1-NEXT: Cost Model: Found an estimated cost of 40 for instruction: %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 false)
774 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %cttz
776 ; AVX2-LABEL: 'var_cttz_v64i8'
777 ; AVX2-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 false)
778 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %cttz
780 ; AVX512F-LABEL: 'var_cttz_v64i8'
781 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 false)
782 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %cttz
784 ; AVX512BW-LABEL: 'var_cttz_v64i8'
785 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 false)
786 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %cttz
788 ; AVX512VPOPCNT-LABEL: 'var_cttz_v64i8'
789 ; AVX512VPOPCNT-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 false)
790 ; AVX512VPOPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %cttz
792 ; AVX512BITALG-LABEL: 'var_cttz_v64i8'
793 ; AVX512BITALG-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 false)
794 ; AVX512BITALG-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %cttz
796 %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 0)
800 define <64 x i8> @var_cttz_v64i8u(<64 x i8> %a) {
801 ; SSE2-LABEL: 'var_cttz_v64i8u'
802 ; SSE2-NEXT: Cost Model: Found an estimated cost of 52 for instruction: %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 true)
803 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %cttz
805 ; SSE42-LABEL: 'var_cttz_v64i8u'
806 ; SSE42-NEXT: Cost Model: Found an estimated cost of 36 for instruction: %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 true)
807 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %cttz
809 ; AVX1-LABEL: 'var_cttz_v64i8u'
810 ; AVX1-NEXT: Cost Model: Found an estimated cost of 40 for instruction: %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 true)
811 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %cttz
813 ; AVX2-LABEL: 'var_cttz_v64i8u'
814 ; AVX2-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 true)
815 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %cttz
817 ; AVX512F-LABEL: 'var_cttz_v64i8u'
818 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 true)
819 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %cttz
821 ; AVX512BW-LABEL: 'var_cttz_v64i8u'
822 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 true)
823 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %cttz
825 ; AVX512VPOPCNT-LABEL: 'var_cttz_v64i8u'
826 ; AVX512VPOPCNT-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 true)
827 ; AVX512VPOPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %cttz
829 ; AVX512BITALG-LABEL: 'var_cttz_v64i8u'
830 ; AVX512BITALG-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 true)
831 ; AVX512BITALG-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %cttz
833 %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 1)