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 -cost-kind=size-latency -mattr=-bmi,+sse2 | FileCheck %s -check-prefixes=CHECK,NOBMI
3 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=size-latency -mattr=+bmi,+sse2 | FileCheck %s -check-prefixes=CHECK,BMI,SSE2
4 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=size-latency -mattr=+bmi,+sse4.2 | FileCheck %s -check-prefixes=CHECK,BMI,SSE42
5 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=size-latency -mattr=+bmi,+avx | FileCheck %s -check-prefixes=CHECK,BMI,AVX1
6 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=size-latency -mattr=+bmi,+avx2 | FileCheck %s -check-prefixes=CHECK,BMI,AVX2
7 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=size-latency -mattr=+bmi,+avx512f | FileCheck %s -check-prefixes=CHECK,BMI,AVX512
8 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=size-latency -mattr=+bmi,+avx512vl,+avx512bw,+avx512dq | FileCheck %s -check-prefixes=CHECK,BMI,AVX512
9 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=size-latency -mattr=+bmi,+avx512vl,+avx512vpopcntdq | FileCheck %s -check-prefixes=CHECK,BMI,AVX512
10 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=size-latency -mattr=+bmi,+avx512vl,+avx512bitalg | FileCheck %s -check-prefixes=CHECK,BMI,AVX512
12 ; Verify the cost of scalar trailing zero count instructions.
14 declare i64 @llvm.cttz.i64(i64, i1)
15 declare i32 @llvm.cttz.i32(i32, i1)
16 declare i16 @llvm.cttz.i16(i16, i1)
17 declare i8 @llvm.cttz.i8(i8, i1)
19 define i64 @var_cttz_i64(i64 %a) {
20 ; NOBMI-LABEL: 'var_cttz_i64'
21 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %cttz = call i64 @llvm.cttz.i64(i64 %a, i1 false)
22 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i64 %cttz
24 ; BMI-LABEL: 'var_cttz_i64'
25 ; BMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %cttz = call i64 @llvm.cttz.i64(i64 %a, i1 false)
26 ; BMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i64 %cttz
28 %cttz = call i64 @llvm.cttz.i64(i64 %a, i1 0)
32 define i64 @var_cttz_i64u(i64 %a) {
33 ; NOBMI-LABEL: 'var_cttz_i64u'
34 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %cttz = call i64 @llvm.cttz.i64(i64 %a, i1 true)
35 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i64 %cttz
37 ; BMI-LABEL: 'var_cttz_i64u'
38 ; BMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %cttz = call i64 @llvm.cttz.i64(i64 %a, i1 true)
39 ; BMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i64 %cttz
41 %cttz = call i64 @llvm.cttz.i64(i64 %a, i1 1)
45 define i32 @var_cttz_i32(i32 %a) {
46 ; NOBMI-LABEL: 'var_cttz_i32'
47 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %cttz = call i32 @llvm.cttz.i32(i32 %a, i1 false)
48 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 %cttz
50 ; BMI-LABEL: 'var_cttz_i32'
51 ; BMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %cttz = call i32 @llvm.cttz.i32(i32 %a, i1 false)
52 ; BMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 %cttz
54 %cttz = call i32 @llvm.cttz.i32(i32 %a, i1 0)
58 define i32 @var_cttz_i32u(i32 %a) {
59 ; NOBMI-LABEL: 'var_cttz_i32u'
60 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %cttz = call i32 @llvm.cttz.i32(i32 %a, i1 true)
61 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 %cttz
63 ; BMI-LABEL: 'var_cttz_i32u'
64 ; BMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %cttz = call i32 @llvm.cttz.i32(i32 %a, i1 true)
65 ; BMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 %cttz
67 %cttz = call i32 @llvm.cttz.i32(i32 %a, i1 1)
71 define i16 @var_cttz_i16(i16 %a) {
72 ; NOBMI-LABEL: 'var_cttz_i16'
73 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %cttz = call i16 @llvm.cttz.i16(i16 %a, i1 false)
74 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i16 %cttz
76 ; BMI-LABEL: 'var_cttz_i16'
77 ; BMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %cttz = call i16 @llvm.cttz.i16(i16 %a, i1 false)
78 ; BMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i16 %cttz
80 %cttz = call i16 @llvm.cttz.i16(i16 %a, i1 0)
84 define i16 @var_cttz_i16u(i16 %a) {
85 ; NOBMI-LABEL: 'var_cttz_i16u'
86 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %cttz = call i16 @llvm.cttz.i16(i16 %a, i1 true)
87 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i16 %cttz
89 ; BMI-LABEL: 'var_cttz_i16u'
90 ; BMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %cttz = call i16 @llvm.cttz.i16(i16 %a, i1 true)
91 ; BMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i16 %cttz
93 %cttz = call i16 @llvm.cttz.i16(i16 %a, i1 1)
97 define i8 @var_cttz_i8(i8 %a) {
98 ; NOBMI-LABEL: 'var_cttz_i8'
99 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %cttz = call i8 @llvm.cttz.i8(i8 %a, i1 false)
100 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i8 %cttz
102 ; BMI-LABEL: 'var_cttz_i8'
103 ; BMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %cttz = call i8 @llvm.cttz.i8(i8 %a, i1 false)
104 ; BMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i8 %cttz
106 %cttz = call i8 @llvm.cttz.i8(i8 %a, i1 0)
110 define i8 @var_cttz_i8u(i8 %a) {
111 ; NOBMI-LABEL: 'var_cttz_i8u'
112 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %cttz = call i8 @llvm.cttz.i8(i8 %a, i1 true)
113 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i8 %cttz
115 ; BMI-LABEL: 'var_cttz_i8u'
116 ; BMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %cttz = call i8 @llvm.cttz.i8(i8 %a, i1 true)
117 ; BMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i8 %cttz
119 %cttz = call i8 @llvm.cttz.i8(i8 %a, i1 1)
123 ; Verify the cost of vector trailing zero count instructions.
125 declare <2 x i64> @llvm.cttz.v2i64(<2 x i64>, i1)
126 declare <4 x i32> @llvm.cttz.v4i32(<4 x i32>, i1)
127 declare <8 x i16> @llvm.cttz.v8i16(<8 x i16>, i1)
128 declare <16 x i8> @llvm.cttz.v16i8(<16 x i8>, i1)
130 declare <4 x i64> @llvm.cttz.v4i64(<4 x i64>, i1)
131 declare <8 x i32> @llvm.cttz.v8i32(<8 x i32>, i1)
132 declare <16 x i16> @llvm.cttz.v16i16(<16 x i16>, i1)
133 declare <32 x i8> @llvm.cttz.v32i8(<32 x i8>, i1)
135 declare <8 x i64> @llvm.cttz.v8i64(<8 x i64>, i1)
136 declare <16 x i32> @llvm.cttz.v16i32(<16 x i32>, i1)
137 declare <32 x i16> @llvm.cttz.v32i16(<32 x i16>, i1)
138 declare <64 x i8> @llvm.cttz.v64i8(<64 x i8>, i1)
140 define <2 x i64> @var_cttz_v2i64(<2 x i64> %a) {
141 ; NOBMI-LABEL: 'var_cttz_v2i64'
142 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 21 for instruction: %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 false)
143 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %cttz
145 ; SSE2-LABEL: 'var_cttz_v2i64'
146 ; SSE2-NEXT: Cost Model: Found an estimated cost of 21 for instruction: %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 false)
147 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %cttz
149 ; SSE42-LABEL: 'var_cttz_v2i64'
150 ; SSE42-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 false)
151 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %cttz
153 ; AVX1-LABEL: 'var_cttz_v2i64'
154 ; AVX1-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 false)
155 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %cttz
157 ; AVX2-LABEL: 'var_cttz_v2i64'
158 ; AVX2-NEXT: Cost Model: Found an estimated cost of 13 for instruction: %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 false)
159 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %cttz
161 ; AVX512-LABEL: 'var_cttz_v2i64'
162 ; AVX512-NEXT: Cost Model: Found an estimated cost of 13 for instruction: %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 false)
163 ; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %cttz
165 %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 0)
169 define <2 x i64> @var_cttz_v2i64u(<2 x i64> %a) {
170 ; NOBMI-LABEL: 'var_cttz_v2i64u'
171 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 21 for instruction: %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 true)
172 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %cttz
174 ; SSE2-LABEL: 'var_cttz_v2i64u'
175 ; SSE2-NEXT: Cost Model: Found an estimated cost of 21 for instruction: %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 true)
176 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %cttz
178 ; SSE42-LABEL: 'var_cttz_v2i64u'
179 ; SSE42-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 true)
180 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %cttz
182 ; AVX1-LABEL: 'var_cttz_v2i64u'
183 ; AVX1-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 true)
184 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %cttz
186 ; AVX2-LABEL: 'var_cttz_v2i64u'
187 ; AVX2-NEXT: Cost Model: Found an estimated cost of 13 for instruction: %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 true)
188 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %cttz
190 ; AVX512-LABEL: 'var_cttz_v2i64u'
191 ; AVX512-NEXT: Cost Model: Found an estimated cost of 13 for instruction: %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 true)
192 ; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %cttz
194 %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 1)
198 define <4 x i64> @var_cttz_v4i64(<4 x i64> %a) {
199 ; NOBMI-LABEL: 'var_cttz_v4i64'
200 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 42 for instruction: %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 false)
201 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %cttz
203 ; SSE2-LABEL: 'var_cttz_v4i64'
204 ; SSE2-NEXT: Cost Model: Found an estimated cost of 42 for instruction: %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 false)
205 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %cttz
207 ; SSE42-LABEL: 'var_cttz_v4i64'
208 ; SSE42-NEXT: Cost Model: Found an estimated cost of 44 for instruction: %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 false)
209 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %cttz
211 ; AVX1-LABEL: 'var_cttz_v4i64'
212 ; AVX1-NEXT: Cost Model: Found an estimated cost of 33 for instruction: %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 false)
213 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %cttz
215 ; AVX2-LABEL: 'var_cttz_v4i64'
216 ; AVX2-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)
217 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %cttz
219 ; AVX512-LABEL: 'var_cttz_v4i64'
220 ; AVX512-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)
221 ; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %cttz
223 %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 0)
227 define <4 x i64> @var_cttz_v4i64u(<4 x i64> %a) {
228 ; NOBMI-LABEL: 'var_cttz_v4i64u'
229 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 42 for instruction: %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 true)
230 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %cttz
232 ; SSE2-LABEL: 'var_cttz_v4i64u'
233 ; SSE2-NEXT: Cost Model: Found an estimated cost of 42 for instruction: %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 true)
234 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %cttz
236 ; SSE42-LABEL: 'var_cttz_v4i64u'
237 ; SSE42-NEXT: Cost Model: Found an estimated cost of 44 for instruction: %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 true)
238 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %cttz
240 ; AVX1-LABEL: 'var_cttz_v4i64u'
241 ; AVX1-NEXT: Cost Model: Found an estimated cost of 33 for instruction: %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 true)
242 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %cttz
244 ; AVX2-LABEL: 'var_cttz_v4i64u'
245 ; AVX2-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)
246 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %cttz
248 ; AVX512-LABEL: 'var_cttz_v4i64u'
249 ; AVX512-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)
250 ; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %cttz
252 %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 1)
256 define <8 x i64> @var_cttz_v8i64(<8 x i64> %a) {
257 ; NOBMI-LABEL: 'var_cttz_v8i64'
258 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 84 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 false)
259 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %cttz
261 ; SSE2-LABEL: 'var_cttz_v8i64'
262 ; SSE2-NEXT: Cost Model: Found an estimated cost of 84 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 false)
263 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %cttz
265 ; SSE42-LABEL: 'var_cttz_v8i64'
266 ; SSE42-NEXT: Cost Model: Found an estimated cost of 88 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 false)
267 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %cttz
269 ; AVX1-LABEL: 'var_cttz_v8i64'
270 ; AVX1-NEXT: Cost Model: Found an estimated cost of 66 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 false)
271 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %cttz
273 ; AVX2-LABEL: 'var_cttz_v8i64'
274 ; AVX2-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)
275 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %cttz
277 ; AVX512-LABEL: 'var_cttz_v8i64'
278 ; AVX512-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 false)
279 ; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %cttz
281 %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 0)
285 define <8 x i64> @var_cttz_v8i64u(<8 x i64> %a) {
286 ; NOBMI-LABEL: 'var_cttz_v8i64u'
287 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 84 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 true)
288 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %cttz
290 ; SSE2-LABEL: 'var_cttz_v8i64u'
291 ; SSE2-NEXT: Cost Model: Found an estimated cost of 84 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 true)
292 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %cttz
294 ; SSE42-LABEL: 'var_cttz_v8i64u'
295 ; SSE42-NEXT: Cost Model: Found an estimated cost of 88 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 true)
296 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %cttz
298 ; AVX1-LABEL: 'var_cttz_v8i64u'
299 ; AVX1-NEXT: Cost Model: Found an estimated cost of 66 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 true)
300 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %cttz
302 ; AVX2-LABEL: 'var_cttz_v8i64u'
303 ; AVX2-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)
304 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %cttz
306 ; AVX512-LABEL: 'var_cttz_v8i64u'
307 ; AVX512-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 true)
308 ; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %cttz
310 %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 1)
314 define <4 x i32> @var_cttz_v4i32(<4 x i32> %a) {
315 ; NOBMI-LABEL: 'var_cttz_v4i32'
316 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 26 for instruction: %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 false)
317 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %cttz
319 ; SSE2-LABEL: 'var_cttz_v4i32'
320 ; SSE2-NEXT: Cost Model: Found an estimated cost of 26 for instruction: %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 false)
321 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %cttz
323 ; SSE42-LABEL: 'var_cttz_v4i32'
324 ; SSE42-NEXT: Cost Model: Found an estimated cost of 25 for instruction: %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 false)
325 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %cttz
327 ; AVX1-LABEL: 'var_cttz_v4i32'
328 ; AVX1-NEXT: Cost Model: Found an estimated cost of 21 for instruction: %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 false)
329 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %cttz
331 ; AVX2-LABEL: 'var_cttz_v4i32'
332 ; AVX2-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 false)
333 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %cttz
335 ; AVX512-LABEL: 'var_cttz_v4i32'
336 ; AVX512-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 false)
337 ; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %cttz
339 %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 0)
343 define <4 x i32> @var_cttz_v4i32u(<4 x i32> %a) {
344 ; NOBMI-LABEL: 'var_cttz_v4i32u'
345 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 26 for instruction: %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 true)
346 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %cttz
348 ; SSE2-LABEL: 'var_cttz_v4i32u'
349 ; SSE2-NEXT: Cost Model: Found an estimated cost of 26 for instruction: %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 true)
350 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %cttz
352 ; SSE42-LABEL: 'var_cttz_v4i32u'
353 ; SSE42-NEXT: Cost Model: Found an estimated cost of 25 for instruction: %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 true)
354 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %cttz
356 ; AVX1-LABEL: 'var_cttz_v4i32u'
357 ; AVX1-NEXT: Cost Model: Found an estimated cost of 21 for instruction: %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 true)
358 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %cttz
360 ; AVX2-LABEL: 'var_cttz_v4i32u'
361 ; AVX2-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 true)
362 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %cttz
364 ; AVX512-LABEL: 'var_cttz_v4i32u'
365 ; AVX512-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 true)
366 ; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %cttz
368 %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 1)
372 define <8 x i32> @var_cttz_v8i32(<8 x i32> %a) {
373 ; NOBMI-LABEL: 'var_cttz_v8i32'
374 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 52 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 false)
375 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %cttz
377 ; SSE2-LABEL: 'var_cttz_v8i32'
378 ; SSE2-NEXT: Cost Model: Found an estimated cost of 52 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 false)
379 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %cttz
381 ; SSE42-LABEL: 'var_cttz_v8i32'
382 ; SSE42-NEXT: Cost Model: Found an estimated cost of 50 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 false)
383 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %cttz
385 ; AVX1-LABEL: 'var_cttz_v8i32'
386 ; AVX1-NEXT: Cost Model: Found an estimated cost of 41 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 false)
387 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %cttz
389 ; AVX2-LABEL: 'var_cttz_v8i32'
390 ; AVX2-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 false)
391 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %cttz
393 ; AVX512-LABEL: 'var_cttz_v8i32'
394 ; AVX512-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 false)
395 ; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %cttz
397 %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 0)
401 define <8 x i32> @var_cttz_v8i32u(<8 x i32> %a) {
402 ; NOBMI-LABEL: 'var_cttz_v8i32u'
403 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 52 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 true)
404 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %cttz
406 ; SSE2-LABEL: 'var_cttz_v8i32u'
407 ; SSE2-NEXT: Cost Model: Found an estimated cost of 52 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 true)
408 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %cttz
410 ; SSE42-LABEL: 'var_cttz_v8i32u'
411 ; SSE42-NEXT: Cost Model: Found an estimated cost of 50 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 true)
412 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %cttz
414 ; AVX1-LABEL: 'var_cttz_v8i32u'
415 ; AVX1-NEXT: Cost Model: Found an estimated cost of 41 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 true)
416 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %cttz
418 ; AVX2-LABEL: 'var_cttz_v8i32u'
419 ; AVX2-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 true)
420 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %cttz
422 ; AVX512-LABEL: 'var_cttz_v8i32u'
423 ; AVX512-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 true)
424 ; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %cttz
426 %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 1)
430 define <16 x i32> @var_cttz_v16i32(<16 x i32> %a) {
431 ; NOBMI-LABEL: 'var_cttz_v16i32'
432 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 104 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 false)
433 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %cttz
435 ; SSE2-LABEL: 'var_cttz_v16i32'
436 ; SSE2-NEXT: Cost Model: Found an estimated cost of 104 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 false)
437 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %cttz
439 ; SSE42-LABEL: 'var_cttz_v16i32'
440 ; SSE42-NEXT: Cost Model: Found an estimated cost of 100 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 false)
441 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %cttz
443 ; AVX1-LABEL: 'var_cttz_v16i32'
444 ; AVX1-NEXT: Cost Model: Found an estimated cost of 82 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 false)
445 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %cttz
447 ; AVX2-LABEL: 'var_cttz_v16i32'
448 ; AVX2-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 false)
449 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %cttz
451 ; AVX512-LABEL: 'var_cttz_v16i32'
452 ; AVX512-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 false)
453 ; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %cttz
455 %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 0)
459 define <16 x i32> @var_cttz_v16i32u(<16 x i32> %a) {
460 ; NOBMI-LABEL: 'var_cttz_v16i32u'
461 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 104 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 true)
462 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %cttz
464 ; SSE2-LABEL: 'var_cttz_v16i32u'
465 ; SSE2-NEXT: Cost Model: Found an estimated cost of 104 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 true)
466 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %cttz
468 ; SSE42-LABEL: 'var_cttz_v16i32u'
469 ; SSE42-NEXT: Cost Model: Found an estimated cost of 100 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 true)
470 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %cttz
472 ; AVX1-LABEL: 'var_cttz_v16i32u'
473 ; AVX1-NEXT: Cost Model: Found an estimated cost of 82 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 true)
474 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %cttz
476 ; AVX2-LABEL: 'var_cttz_v16i32u'
477 ; AVX2-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 true)
478 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %cttz
480 ; AVX512-LABEL: 'var_cttz_v16i32u'
481 ; AVX512-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 true)
482 ; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %cttz
484 %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 1)
488 define <8 x i16> @var_cttz_v8i16(<8 x i16> %a) {
489 ; NOBMI-LABEL: 'var_cttz_v8i16'
490 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 23 for instruction: %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 false)
491 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %cttz
493 ; SSE2-LABEL: 'var_cttz_v8i16'
494 ; SSE2-NEXT: Cost Model: Found an estimated cost of 23 for instruction: %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 false)
495 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %cttz
497 ; SSE42-LABEL: 'var_cttz_v8i16'
498 ; SSE42-NEXT: Cost Model: Found an estimated cost of 23 for instruction: %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 false)
499 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %cttz
501 ; AVX1-LABEL: 'var_cttz_v8i16'
502 ; AVX1-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 false)
503 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %cttz
505 ; AVX2-LABEL: 'var_cttz_v8i16'
506 ; AVX2-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 false)
507 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %cttz
509 ; AVX512-LABEL: 'var_cttz_v8i16'
510 ; AVX512-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 false)
511 ; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %cttz
513 %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 0)
517 define <8 x i16> @var_cttz_v8i16u(<8 x i16> %a) {
518 ; NOBMI-LABEL: 'var_cttz_v8i16u'
519 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 23 for instruction: %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 true)
520 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %cttz
522 ; SSE2-LABEL: 'var_cttz_v8i16u'
523 ; SSE2-NEXT: Cost Model: Found an estimated cost of 23 for instruction: %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 true)
524 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %cttz
526 ; SSE42-LABEL: 'var_cttz_v8i16u'
527 ; SSE42-NEXT: Cost Model: Found an estimated cost of 23 for instruction: %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 true)
528 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %cttz
530 ; AVX1-LABEL: 'var_cttz_v8i16u'
531 ; AVX1-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 true)
532 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %cttz
534 ; AVX2-LABEL: 'var_cttz_v8i16u'
535 ; AVX2-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 true)
536 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %cttz
538 ; AVX512-LABEL: 'var_cttz_v8i16u'
539 ; AVX512-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 true)
540 ; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %cttz
542 %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 1)
546 define <16 x i16> @var_cttz_v16i16(<16 x i16> %a) {
547 ; NOBMI-LABEL: 'var_cttz_v16i16'
548 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 46 for instruction: %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 false)
549 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %cttz
551 ; SSE2-LABEL: 'var_cttz_v16i16'
552 ; SSE2-NEXT: Cost Model: Found an estimated cost of 46 for instruction: %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 false)
553 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %cttz
555 ; SSE42-LABEL: 'var_cttz_v16i16'
556 ; SSE42-NEXT: Cost Model: Found an estimated cost of 46 for instruction: %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 false)
557 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %cttz
559 ; AVX1-LABEL: 'var_cttz_v16i16'
560 ; AVX1-NEXT: Cost Model: Found an estimated cost of 36 for instruction: %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 false)
561 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %cttz
563 ; AVX2-LABEL: 'var_cttz_v16i16'
564 ; AVX2-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)
565 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %cttz
567 %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 0)
571 define <16 x i16> @var_cttz_v16i16u(<16 x i16> %a) {
572 ; NOBMI-LABEL: 'var_cttz_v16i16u'
573 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 46 for instruction: %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 true)
574 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %cttz
576 ; SSE2-LABEL: 'var_cttz_v16i16u'
577 ; SSE2-NEXT: Cost Model: Found an estimated cost of 46 for instruction: %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 true)
578 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %cttz
580 ; SSE42-LABEL: 'var_cttz_v16i16u'
581 ; SSE42-NEXT: Cost Model: Found an estimated cost of 46 for instruction: %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 true)
582 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %cttz
584 ; AVX1-LABEL: 'var_cttz_v16i16u'
585 ; AVX1-NEXT: Cost Model: Found an estimated cost of 36 for instruction: %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 true)
586 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %cttz
588 ; AVX2-LABEL: 'var_cttz_v16i16u'
589 ; AVX2-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)
590 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %cttz
592 %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 1)
596 define <32 x i16> @var_cttz_v32i16(<32 x i16> %a) {
597 ; NOBMI-LABEL: 'var_cttz_v32i16'
598 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 92 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 false)
599 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %cttz
601 ; SSE2-LABEL: 'var_cttz_v32i16'
602 ; SSE2-NEXT: Cost Model: Found an estimated cost of 92 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 false)
603 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %cttz
605 ; SSE42-LABEL: 'var_cttz_v32i16'
606 ; SSE42-NEXT: Cost Model: Found an estimated cost of 92 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 false)
607 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %cttz
609 ; AVX1-LABEL: 'var_cttz_v32i16'
610 ; AVX1-NEXT: Cost Model: Found an estimated cost of 72 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 false)
611 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %cttz
613 ; AVX2-LABEL: 'var_cttz_v32i16'
614 ; AVX2-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)
615 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %cttz
617 %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 0)
621 define <32 x i16> @var_cttz_v32i16u(<32 x i16> %a) {
622 ; NOBMI-LABEL: 'var_cttz_v32i16u'
623 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 92 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 true)
624 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %cttz
626 ; SSE2-LABEL: 'var_cttz_v32i16u'
627 ; SSE2-NEXT: Cost Model: Found an estimated cost of 92 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 true)
628 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %cttz
630 ; SSE42-LABEL: 'var_cttz_v32i16u'
631 ; SSE42-NEXT: Cost Model: Found an estimated cost of 92 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 true)
632 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %cttz
634 ; AVX1-LABEL: 'var_cttz_v32i16u'
635 ; AVX1-NEXT: Cost Model: Found an estimated cost of 72 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 true)
636 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %cttz
638 ; AVX2-LABEL: 'var_cttz_v32i16u'
639 ; AVX2-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)
640 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %cttz
642 %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 1)
646 define <16 x i8> @var_cttz_v16i8(<16 x i8> %a) {
647 ; NOBMI-LABEL: 'var_cttz_v16i8'
648 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 19 for instruction: %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 false)
649 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %cttz
651 ; SSE2-LABEL: 'var_cttz_v16i8'
652 ; SSE2-NEXT: Cost Model: Found an estimated cost of 19 for instruction: %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 false)
653 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %cttz
655 ; SSE42-LABEL: 'var_cttz_v16i8'
656 ; SSE42-NEXT: Cost Model: Found an estimated cost of 19 for instruction: %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 false)
657 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %cttz
659 ; AVX1-LABEL: 'var_cttz_v16i8'
660 ; AVX1-NEXT: Cost Model: Found an estimated cost of 15 for instruction: %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 false)
661 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %cttz
663 ; AVX2-LABEL: 'var_cttz_v16i8'
664 ; AVX2-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 false)
665 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %cttz
667 ; AVX512-LABEL: 'var_cttz_v16i8'
668 ; AVX512-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 false)
669 ; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %cttz
671 %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 0)
675 define <16 x i8> @var_cttz_v16i8u(<16 x i8> %a) {
676 ; NOBMI-LABEL: 'var_cttz_v16i8u'
677 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 19 for instruction: %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 true)
678 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %cttz
680 ; SSE2-LABEL: 'var_cttz_v16i8u'
681 ; SSE2-NEXT: Cost Model: Found an estimated cost of 19 for instruction: %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 true)
682 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %cttz
684 ; SSE42-LABEL: 'var_cttz_v16i8u'
685 ; SSE42-NEXT: Cost Model: Found an estimated cost of 19 for instruction: %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 true)
686 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %cttz
688 ; AVX1-LABEL: 'var_cttz_v16i8u'
689 ; AVX1-NEXT: Cost Model: Found an estimated cost of 15 for instruction: %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 true)
690 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %cttz
692 ; AVX2-LABEL: 'var_cttz_v16i8u'
693 ; AVX2-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 true)
694 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %cttz
696 ; AVX512-LABEL: 'var_cttz_v16i8u'
697 ; AVX512-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 true)
698 ; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %cttz
700 %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 1)
704 define <32 x i8> @var_cttz_v32i8(<32 x i8> %a) {
705 ; NOBMI-LABEL: 'var_cttz_v32i8'
706 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 38 for instruction: %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 false)
707 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %cttz
709 ; SSE2-LABEL: 'var_cttz_v32i8'
710 ; SSE2-NEXT: Cost Model: Found an estimated cost of 38 for instruction: %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 false)
711 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %cttz
713 ; SSE42-LABEL: 'var_cttz_v32i8'
714 ; SSE42-NEXT: Cost Model: Found an estimated cost of 38 for instruction: %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 false)
715 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %cttz
717 ; AVX1-LABEL: 'var_cttz_v32i8'
718 ; AVX1-NEXT: Cost Model: Found an estimated cost of 30 for instruction: %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 false)
719 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %cttz
721 ; AVX2-LABEL: 'var_cttz_v32i8'
722 ; AVX2-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)
723 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %cttz
725 %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 0)
729 define <32 x i8> @var_cttz_v32i8u(<32 x i8> %a) {
730 ; NOBMI-LABEL: 'var_cttz_v32i8u'
731 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 38 for instruction: %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 true)
732 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %cttz
734 ; SSE2-LABEL: 'var_cttz_v32i8u'
735 ; SSE2-NEXT: Cost Model: Found an estimated cost of 38 for instruction: %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 true)
736 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %cttz
738 ; SSE42-LABEL: 'var_cttz_v32i8u'
739 ; SSE42-NEXT: Cost Model: Found an estimated cost of 38 for instruction: %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 true)
740 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %cttz
742 ; AVX1-LABEL: 'var_cttz_v32i8u'
743 ; AVX1-NEXT: Cost Model: Found an estimated cost of 30 for instruction: %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 true)
744 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %cttz
746 ; AVX2-LABEL: 'var_cttz_v32i8u'
747 ; AVX2-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)
748 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %cttz
750 %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 1)
754 define <64 x i8> @var_cttz_v64i8(<64 x i8> %a) {
755 ; NOBMI-LABEL: 'var_cttz_v64i8'
756 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 76 for instruction: %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 false)
757 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %cttz
759 ; SSE2-LABEL: 'var_cttz_v64i8'
760 ; SSE2-NEXT: Cost Model: Found an estimated cost of 76 for instruction: %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 false)
761 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %cttz
763 ; SSE42-LABEL: 'var_cttz_v64i8'
764 ; SSE42-NEXT: Cost Model: Found an estimated cost of 76 for instruction: %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 false)
765 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %cttz
767 ; AVX1-LABEL: 'var_cttz_v64i8'
768 ; AVX1-NEXT: Cost Model: Found an estimated cost of 60 for instruction: %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 false)
769 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %cttz
771 ; AVX2-LABEL: 'var_cttz_v64i8'
772 ; AVX2-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)
773 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %cttz
775 %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 0)
779 define <64 x i8> @var_cttz_v64i8u(<64 x i8> %a) {
780 ; NOBMI-LABEL: 'var_cttz_v64i8u'
781 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 76 for instruction: %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 true)
782 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %cttz
784 ; SSE2-LABEL: 'var_cttz_v64i8u'
785 ; SSE2-NEXT: Cost Model: Found an estimated cost of 76 for instruction: %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 true)
786 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %cttz
788 ; SSE42-LABEL: 'var_cttz_v64i8u'
789 ; SSE42-NEXT: Cost Model: Found an estimated cost of 76 for instruction: %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 true)
790 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %cttz
792 ; AVX1-LABEL: 'var_cttz_v64i8u'
793 ; AVX1-NEXT: Cost Model: Found an estimated cost of 60 for instruction: %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 true)
794 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %cttz
796 ; AVX2-LABEL: 'var_cttz_v64i8u'
797 ; AVX2-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)
798 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %cttz
800 %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 1)
803 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: