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=code-size -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=code-size -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=code-size -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=code-size -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=code-size -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=code-size -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=code-size -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=code-size -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=code-size -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 3 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 ; CHECK-LABEL: 'var_cttz_i64u'
34 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %cttz = call i64 @llvm.cttz.i64(i64 %a, i1 true)
35 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i64 %cttz
37 %cttz = call i64 @llvm.cttz.i64(i64 %a, i1 1)
41 define i32 @var_cttz_i32(i32 %a) {
42 ; NOBMI-LABEL: 'var_cttz_i32'
43 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %cttz = call i32 @llvm.cttz.i32(i32 %a, i1 false)
44 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 %cttz
46 ; BMI-LABEL: 'var_cttz_i32'
47 ; BMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %cttz = call i32 @llvm.cttz.i32(i32 %a, i1 false)
48 ; BMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 %cttz
50 %cttz = call i32 @llvm.cttz.i32(i32 %a, i1 0)
54 define i32 @var_cttz_i32u(i32 %a) {
55 ; CHECK-LABEL: 'var_cttz_i32u'
56 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %cttz = call i32 @llvm.cttz.i32(i32 %a, i1 true)
57 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 %cttz
59 %cttz = call i32 @llvm.cttz.i32(i32 %a, i1 1)
63 define i16 @var_cttz_i16(i16 %a) {
64 ; NOBMI-LABEL: 'var_cttz_i16'
65 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %cttz = call i16 @llvm.cttz.i16(i16 %a, i1 false)
66 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i16 %cttz
68 ; BMI-LABEL: 'var_cttz_i16'
69 ; BMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %cttz = call i16 @llvm.cttz.i16(i16 %a, i1 false)
70 ; BMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i16 %cttz
72 %cttz = call i16 @llvm.cttz.i16(i16 %a, i1 0)
76 define i16 @var_cttz_i16u(i16 %a) {
77 ; CHECK-LABEL: 'var_cttz_i16u'
78 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %cttz = call i16 @llvm.cttz.i16(i16 %a, i1 true)
79 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i16 %cttz
81 %cttz = call i16 @llvm.cttz.i16(i16 %a, i1 1)
85 define i8 @var_cttz_i8(i8 %a) {
86 ; NOBMI-LABEL: 'var_cttz_i8'
87 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %cttz = call i8 @llvm.cttz.i8(i8 %a, i1 false)
88 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i8 %cttz
90 ; BMI-LABEL: 'var_cttz_i8'
91 ; BMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %cttz = call i8 @llvm.cttz.i8(i8 %a, i1 false)
92 ; BMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i8 %cttz
94 %cttz = call i8 @llvm.cttz.i8(i8 %a, i1 0)
98 define i8 @var_cttz_i8u(i8 %a) {
99 ; CHECK-LABEL: 'var_cttz_i8u'
100 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %cttz = call i8 @llvm.cttz.i8(i8 %a, i1 true)
101 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i8 %cttz
103 %cttz = call i8 @llvm.cttz.i8(i8 %a, i1 1)
107 ; Verify the cost of vector trailing zero count instructions.
109 declare <2 x i64> @llvm.cttz.v2i64(<2 x i64>, i1)
110 declare <4 x i32> @llvm.cttz.v4i32(<4 x i32>, i1)
111 declare <8 x i16> @llvm.cttz.v8i16(<8 x i16>, i1)
112 declare <16 x i8> @llvm.cttz.v16i8(<16 x i8>, i1)
114 declare <4 x i64> @llvm.cttz.v4i64(<4 x i64>, i1)
115 declare <8 x i32> @llvm.cttz.v8i32(<8 x i32>, i1)
116 declare <16 x i16> @llvm.cttz.v16i16(<16 x i16>, i1)
117 declare <32 x i8> @llvm.cttz.v32i8(<32 x i8>, i1)
119 declare <8 x i64> @llvm.cttz.v8i64(<8 x i64>, i1)
120 declare <16 x i32> @llvm.cttz.v16i32(<16 x i32>, i1)
121 declare <32 x i16> @llvm.cttz.v32i16(<32 x i16>, i1)
122 declare <64 x i8> @llvm.cttz.v64i8(<64 x i8>, i1)
124 define <2 x i64> @var_cttz_v2i64(<2 x i64> %a) {
125 ; NOBMI-LABEL: 'var_cttz_v2i64'
126 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 19 for instruction: %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 false)
127 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %cttz
129 ; SSE2-LABEL: 'var_cttz_v2i64'
130 ; SSE2-NEXT: Cost Model: Found an estimated cost of 19 for instruction: %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 false)
131 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %cttz
133 ; SSE42-LABEL: 'var_cttz_v2i64'
134 ; SSE42-NEXT: Cost Model: Found an estimated cost of 15 for instruction: %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 false)
135 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %cttz
137 ; AVX1-LABEL: 'var_cttz_v2i64'
138 ; AVX1-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)
139 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %cttz
141 ; AVX2-LABEL: 'var_cttz_v2i64'
142 ; 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)
143 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %cttz
145 ; AVX512-LABEL: 'var_cttz_v2i64'
146 ; 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)
147 ; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %cttz
149 %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 0)
153 define <2 x i64> @var_cttz_v2i64u(<2 x i64> %a) {
154 ; NOBMI-LABEL: 'var_cttz_v2i64u'
155 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 19 for instruction: %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 true)
156 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %cttz
158 ; SSE2-LABEL: 'var_cttz_v2i64u'
159 ; SSE2-NEXT: Cost Model: Found an estimated cost of 19 for instruction: %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 true)
160 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %cttz
162 ; SSE42-LABEL: 'var_cttz_v2i64u'
163 ; SSE42-NEXT: Cost Model: Found an estimated cost of 15 for instruction: %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 true)
164 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %cttz
166 ; AVX1-LABEL: 'var_cttz_v2i64u'
167 ; AVX1-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)
168 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %cttz
170 ; AVX2-LABEL: 'var_cttz_v2i64u'
171 ; 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)
172 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %cttz
174 ; AVX512-LABEL: 'var_cttz_v2i64u'
175 ; 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)
176 ; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %cttz
178 %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 1)
182 define <4 x i64> @var_cttz_v4i64(<4 x i64> %a) {
183 ; NOBMI-LABEL: 'var_cttz_v4i64'
184 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 38 for instruction: %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 false)
185 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %cttz
187 ; SSE2-LABEL: 'var_cttz_v4i64'
188 ; SSE2-NEXT: Cost Model: Found an estimated cost of 38 for instruction: %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 false)
189 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %cttz
191 ; SSE42-LABEL: 'var_cttz_v4i64'
192 ; SSE42-NEXT: Cost Model: Found an estimated cost of 30 for instruction: %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 false)
193 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %cttz
195 ; AVX1-LABEL: 'var_cttz_v4i64'
196 ; AVX1-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 false)
197 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %cttz
199 ; AVX2-LABEL: 'var_cttz_v4i64'
200 ; AVX2-NEXT: Cost Model: Found an estimated cost of 13 for instruction: %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 false)
201 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %cttz
203 ; AVX512-LABEL: 'var_cttz_v4i64'
204 ; AVX512-NEXT: Cost Model: Found an estimated cost of 13 for instruction: %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 false)
205 ; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %cttz
207 %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 0)
211 define <4 x i64> @var_cttz_v4i64u(<4 x i64> %a) {
212 ; NOBMI-LABEL: 'var_cttz_v4i64u'
213 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 38 for instruction: %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 true)
214 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %cttz
216 ; SSE2-LABEL: 'var_cttz_v4i64u'
217 ; SSE2-NEXT: Cost Model: Found an estimated cost of 38 for instruction: %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 true)
218 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %cttz
220 ; SSE42-LABEL: 'var_cttz_v4i64u'
221 ; SSE42-NEXT: Cost Model: Found an estimated cost of 30 for instruction: %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 true)
222 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %cttz
224 ; AVX1-LABEL: 'var_cttz_v4i64u'
225 ; AVX1-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 true)
226 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %cttz
228 ; AVX2-LABEL: 'var_cttz_v4i64u'
229 ; AVX2-NEXT: Cost Model: Found an estimated cost of 13 for instruction: %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 true)
230 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %cttz
232 ; AVX512-LABEL: 'var_cttz_v4i64u'
233 ; AVX512-NEXT: Cost Model: Found an estimated cost of 13 for instruction: %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 true)
234 ; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %cttz
236 %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 1)
240 define <8 x i64> @var_cttz_v8i64(<8 x i64> %a) {
241 ; NOBMI-LABEL: 'var_cttz_v8i64'
242 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 76 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 false)
243 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %cttz
245 ; SSE2-LABEL: 'var_cttz_v8i64'
246 ; SSE2-NEXT: Cost Model: Found an estimated cost of 76 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 false)
247 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %cttz
249 ; SSE42-LABEL: 'var_cttz_v8i64'
250 ; SSE42-NEXT: Cost Model: Found an estimated cost of 60 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 false)
251 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %cttz
253 ; AVX1-LABEL: 'var_cttz_v8i64'
254 ; AVX1-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 false)
255 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %cttz
257 ; AVX2-LABEL: 'var_cttz_v8i64'
258 ; AVX2-NEXT: Cost Model: Found an estimated cost of 26 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 false)
259 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %cttz
261 ; AVX512-LABEL: 'var_cttz_v8i64'
262 ; AVX512-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 false)
263 ; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %cttz
265 %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 0)
269 define <8 x i64> @var_cttz_v8i64u(<8 x i64> %a) {
270 ; NOBMI-LABEL: 'var_cttz_v8i64u'
271 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 76 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 true)
272 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %cttz
274 ; SSE2-LABEL: 'var_cttz_v8i64u'
275 ; SSE2-NEXT: Cost Model: Found an estimated cost of 76 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 true)
276 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %cttz
278 ; SSE42-LABEL: 'var_cttz_v8i64u'
279 ; SSE42-NEXT: Cost Model: Found an estimated cost of 60 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 true)
280 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %cttz
282 ; AVX1-LABEL: 'var_cttz_v8i64u'
283 ; AVX1-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 true)
284 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %cttz
286 ; AVX2-LABEL: 'var_cttz_v8i64u'
287 ; AVX2-NEXT: Cost Model: Found an estimated cost of 26 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 true)
288 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %cttz
290 ; AVX512-LABEL: 'var_cttz_v8i64u'
291 ; AVX512-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 true)
292 ; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %cttz
294 %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 1)
298 define <4 x i32> @var_cttz_v4i32(<4 x i32> %a) {
299 ; NOBMI-LABEL: 'var_cttz_v4i32'
300 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 false)
301 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %cttz
303 ; SSE2-LABEL: 'var_cttz_v4i32'
304 ; SSE2-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 false)
305 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %cttz
307 ; SSE42-LABEL: 'var_cttz_v4i32'
308 ; SSE42-NEXT: Cost Model: Found an estimated cost of 19 for instruction: %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 false)
309 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %cttz
311 ; AVX1-LABEL: 'var_cttz_v4i32'
312 ; AVX1-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)
313 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %cttz
315 ; AVX2-LABEL: 'var_cttz_v4i32'
316 ; 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)
317 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %cttz
319 ; AVX512-LABEL: 'var_cttz_v4i32'
320 ; 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)
321 ; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %cttz
323 %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 0)
327 define <4 x i32> @var_cttz_v4i32u(<4 x i32> %a) {
328 ; NOBMI-LABEL: 'var_cttz_v4i32u'
329 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 true)
330 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %cttz
332 ; SSE2-LABEL: 'var_cttz_v4i32u'
333 ; SSE2-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 true)
334 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %cttz
336 ; SSE42-LABEL: 'var_cttz_v4i32u'
337 ; SSE42-NEXT: Cost Model: Found an estimated cost of 19 for instruction: %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 true)
338 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %cttz
340 ; AVX1-LABEL: 'var_cttz_v4i32u'
341 ; AVX1-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)
342 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %cttz
344 ; AVX2-LABEL: 'var_cttz_v4i32u'
345 ; 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)
346 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %cttz
348 ; AVX512-LABEL: 'var_cttz_v4i32u'
349 ; 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)
350 ; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %cttz
352 %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 1)
356 define <8 x i32> @var_cttz_v8i32(<8 x i32> %a) {
357 ; NOBMI-LABEL: 'var_cttz_v8i32'
358 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 false)
359 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %cttz
361 ; SSE2-LABEL: 'var_cttz_v8i32'
362 ; SSE2-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 false)
363 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %cttz
365 ; SSE42-LABEL: 'var_cttz_v8i32'
366 ; SSE42-NEXT: Cost Model: Found an estimated cost of 38 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 false)
367 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %cttz
369 ; AVX1-LABEL: 'var_cttz_v8i32'
370 ; AVX1-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 false)
371 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %cttz
373 ; AVX2-LABEL: 'var_cttz_v8i32'
374 ; AVX2-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 false)
375 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %cttz
377 ; AVX512-LABEL: 'var_cttz_v8i32'
378 ; AVX512-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 false)
379 ; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %cttz
381 %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 0)
385 define <8 x i32> @var_cttz_v8i32u(<8 x i32> %a) {
386 ; NOBMI-LABEL: 'var_cttz_v8i32u'
387 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 true)
388 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %cttz
390 ; SSE2-LABEL: 'var_cttz_v8i32u'
391 ; SSE2-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 true)
392 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %cttz
394 ; SSE42-LABEL: 'var_cttz_v8i32u'
395 ; SSE42-NEXT: Cost Model: Found an estimated cost of 38 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 true)
396 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %cttz
398 ; AVX1-LABEL: 'var_cttz_v8i32u'
399 ; AVX1-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 true)
400 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %cttz
402 ; AVX2-LABEL: 'var_cttz_v8i32u'
403 ; AVX2-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 true)
404 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %cttz
406 ; AVX512-LABEL: 'var_cttz_v8i32u'
407 ; AVX512-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 true)
408 ; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %cttz
410 %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 1)
414 define <16 x i32> @var_cttz_v16i32(<16 x i32> %a) {
415 ; NOBMI-LABEL: 'var_cttz_v16i32'
416 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 96 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 false)
417 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %cttz
419 ; SSE2-LABEL: 'var_cttz_v16i32'
420 ; SSE2-NEXT: Cost Model: Found an estimated cost of 96 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 false)
421 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %cttz
423 ; SSE42-LABEL: 'var_cttz_v16i32'
424 ; SSE42-NEXT: Cost Model: Found an estimated cost of 76 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 false)
425 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %cttz
427 ; AVX1-LABEL: 'var_cttz_v16i32'
428 ; AVX1-NEXT: Cost Model: Found an estimated cost of 64 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 false)
429 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %cttz
431 ; AVX2-LABEL: 'var_cttz_v16i32'
432 ; AVX2-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 false)
433 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %cttz
435 ; AVX512-LABEL: 'var_cttz_v16i32'
436 ; AVX512-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 false)
437 ; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %cttz
439 %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 0)
443 define <16 x i32> @var_cttz_v16i32u(<16 x i32> %a) {
444 ; NOBMI-LABEL: 'var_cttz_v16i32u'
445 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 96 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 true)
446 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %cttz
448 ; SSE2-LABEL: 'var_cttz_v16i32u'
449 ; SSE2-NEXT: Cost Model: Found an estimated cost of 96 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 true)
450 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %cttz
452 ; SSE42-LABEL: 'var_cttz_v16i32u'
453 ; SSE42-NEXT: Cost Model: Found an estimated cost of 76 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 true)
454 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %cttz
456 ; AVX1-LABEL: 'var_cttz_v16i32u'
457 ; AVX1-NEXT: Cost Model: Found an estimated cost of 64 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 true)
458 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %cttz
460 ; AVX2-LABEL: 'var_cttz_v16i32u'
461 ; AVX2-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 true)
462 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %cttz
464 ; AVX512-LABEL: 'var_cttz_v16i32u'
465 ; AVX512-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 true)
466 ; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %cttz
468 %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 1)
472 define <8 x i16> @var_cttz_v8i16(<8 x i16> %a) {
473 ; NOBMI-LABEL: 'var_cttz_v8i16'
474 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 21 for instruction: %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 false)
475 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %cttz
477 ; SSE2-LABEL: 'var_cttz_v8i16'
478 ; SSE2-NEXT: Cost Model: Found an estimated cost of 21 for instruction: %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 false)
479 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %cttz
481 ; SSE42-LABEL: 'var_cttz_v8i16'
482 ; SSE42-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 false)
483 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %cttz
485 ; AVX1-LABEL: 'var_cttz_v8i16'
486 ; AVX1-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)
487 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %cttz
489 ; AVX2-LABEL: 'var_cttz_v8i16'
490 ; 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)
491 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %cttz
493 ; AVX512-LABEL: 'var_cttz_v8i16'
494 ; 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)
495 ; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %cttz
497 %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 0)
501 define <8 x i16> @var_cttz_v8i16u(<8 x i16> %a) {
502 ; NOBMI-LABEL: 'var_cttz_v8i16u'
503 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 21 for instruction: %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 true)
504 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %cttz
506 ; SSE2-LABEL: 'var_cttz_v8i16u'
507 ; SSE2-NEXT: Cost Model: Found an estimated cost of 21 for instruction: %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 true)
508 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %cttz
510 ; SSE42-LABEL: 'var_cttz_v8i16u'
511 ; SSE42-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 true)
512 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %cttz
514 ; AVX1-LABEL: 'var_cttz_v8i16u'
515 ; AVX1-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)
516 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %cttz
518 ; AVX2-LABEL: 'var_cttz_v8i16u'
519 ; 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)
520 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %cttz
522 ; AVX512-LABEL: 'var_cttz_v8i16u'
523 ; 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)
524 ; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %cttz
526 %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 1)
530 define <16 x i16> @var_cttz_v16i16(<16 x i16> %a) {
531 ; NOBMI-LABEL: 'var_cttz_v16i16'
532 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 42 for instruction: %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 false)
533 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %cttz
535 ; SSE2-LABEL: 'var_cttz_v16i16'
536 ; SSE2-NEXT: Cost Model: Found an estimated cost of 42 for instruction: %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 false)
537 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %cttz
539 ; SSE42-LABEL: 'var_cttz_v16i16'
540 ; SSE42-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 false)
541 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %cttz
543 ; AVX1-LABEL: 'var_cttz_v16i16'
544 ; AVX1-NEXT: Cost Model: Found an estimated cost of 27 for instruction: %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 false)
545 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %cttz
547 ; AVX2-LABEL: 'var_cttz_v16i16'
548 ; AVX2-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 false)
549 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %cttz
551 ; AVX512-LABEL: 'var_cttz_v16i16'
552 ; AVX512-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 false)
553 ; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %cttz
555 %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 0)
559 define <16 x i16> @var_cttz_v16i16u(<16 x i16> %a) {
560 ; NOBMI-LABEL: 'var_cttz_v16i16u'
561 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 42 for instruction: %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 true)
562 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %cttz
564 ; SSE2-LABEL: 'var_cttz_v16i16u'
565 ; SSE2-NEXT: Cost Model: Found an estimated cost of 42 for instruction: %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 true)
566 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %cttz
568 ; SSE42-LABEL: 'var_cttz_v16i16u'
569 ; SSE42-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 true)
570 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %cttz
572 ; AVX1-LABEL: 'var_cttz_v16i16u'
573 ; AVX1-NEXT: Cost Model: Found an estimated cost of 27 for instruction: %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 true)
574 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %cttz
576 ; AVX2-LABEL: 'var_cttz_v16i16u'
577 ; AVX2-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 true)
578 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %cttz
580 ; AVX512-LABEL: 'var_cttz_v16i16u'
581 ; AVX512-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 true)
582 ; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %cttz
584 %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 1)
588 define <32 x i16> @var_cttz_v32i16(<32 x i16> %a) {
589 ; NOBMI-LABEL: 'var_cttz_v32i16'
590 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 84 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 false)
591 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %cttz
593 ; SSE2-LABEL: 'var_cttz_v32i16'
594 ; SSE2-NEXT: Cost Model: Found an estimated cost of 84 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 false)
595 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %cttz
597 ; SSE42-LABEL: 'var_cttz_v32i16'
598 ; SSE42-NEXT: Cost Model: Found an estimated cost of 68 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 false)
599 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %cttz
601 ; AVX1-LABEL: 'var_cttz_v32i16'
602 ; AVX1-NEXT: Cost Model: Found an estimated cost of 54 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 false)
603 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %cttz
605 ; AVX2-LABEL: 'var_cttz_v32i16'
606 ; AVX2-NEXT: Cost Model: Found an estimated cost of 28 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 false)
607 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %cttz
609 %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 0)
613 define <32 x i16> @var_cttz_v32i16u(<32 x i16> %a) {
614 ; NOBMI-LABEL: 'var_cttz_v32i16u'
615 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 84 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 true)
616 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %cttz
618 ; SSE2-LABEL: 'var_cttz_v32i16u'
619 ; SSE2-NEXT: Cost Model: Found an estimated cost of 84 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 true)
620 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %cttz
622 ; SSE42-LABEL: 'var_cttz_v32i16u'
623 ; SSE42-NEXT: Cost Model: Found an estimated cost of 68 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 true)
624 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %cttz
626 ; AVX1-LABEL: 'var_cttz_v32i16u'
627 ; AVX1-NEXT: Cost Model: Found an estimated cost of 54 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 true)
628 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %cttz
630 ; AVX2-LABEL: 'var_cttz_v32i16u'
631 ; AVX2-NEXT: Cost Model: Found an estimated cost of 28 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 true)
632 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %cttz
634 %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 1)
638 define <16 x i8> @var_cttz_v16i8(<16 x i8> %a) {
639 ; NOBMI-LABEL: 'var_cttz_v16i8'
640 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 false)
641 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %cttz
643 ; SSE2-LABEL: 'var_cttz_v16i8'
644 ; SSE2-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 false)
645 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %cttz
647 ; SSE42-LABEL: 'var_cttz_v16i8'
648 ; SSE42-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)
649 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %cttz
651 ; AVX1-LABEL: 'var_cttz_v16i8'
652 ; AVX1-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)
653 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %cttz
655 ; AVX2-LABEL: 'var_cttz_v16i8'
656 ; 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)
657 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %cttz
659 ; AVX512-LABEL: 'var_cttz_v16i8'
660 ; 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)
661 ; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %cttz
663 %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 0)
667 define <16 x i8> @var_cttz_v16i8u(<16 x i8> %a) {
668 ; NOBMI-LABEL: 'var_cttz_v16i8u'
669 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 true)
670 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %cttz
672 ; SSE2-LABEL: 'var_cttz_v16i8u'
673 ; SSE2-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 true)
674 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %cttz
676 ; SSE42-LABEL: 'var_cttz_v16i8u'
677 ; SSE42-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)
678 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %cttz
680 ; AVX1-LABEL: 'var_cttz_v16i8u'
681 ; AVX1-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)
682 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %cttz
684 ; AVX2-LABEL: 'var_cttz_v16i8u'
685 ; 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)
686 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %cttz
688 ; AVX512-LABEL: 'var_cttz_v16i8u'
689 ; 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)
690 ; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %cttz
692 %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 1)
696 define <32 x i8> @var_cttz_v32i8(<32 x i8> %a) {
697 ; NOBMI-LABEL: 'var_cttz_v32i8'
698 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 false)
699 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %cttz
701 ; SSE2-LABEL: 'var_cttz_v32i8'
702 ; SSE2-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 false)
703 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %cttz
705 ; SSE42-LABEL: 'var_cttz_v32i8'
706 ; SSE42-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)
707 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %cttz
709 ; AVX1-LABEL: 'var_cttz_v32i8'
710 ; AVX1-NEXT: Cost Model: Found an estimated cost of 21 for instruction: %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 false)
711 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %cttz
713 ; AVX2-LABEL: 'var_cttz_v32i8'
714 ; AVX2-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 false)
715 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %cttz
717 ; AVX512-LABEL: 'var_cttz_v32i8'
718 ; AVX512-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 false)
719 ; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %cttz
721 %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 0)
725 define <32 x i8> @var_cttz_v32i8u(<32 x i8> %a) {
726 ; NOBMI-LABEL: 'var_cttz_v32i8u'
727 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 true)
728 ; NOBMI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %cttz
730 ; SSE2-LABEL: 'var_cttz_v32i8u'
731 ; SSE2-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 true)
732 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %cttz
734 ; SSE42-LABEL: 'var_cttz_v32i8u'
735 ; SSE42-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)
736 ; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %cttz
738 ; AVX1-LABEL: 'var_cttz_v32i8u'
739 ; AVX1-NEXT: Cost Model: Found an estimated cost of 21 for instruction: %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 true)
740 ; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %cttz
742 ; AVX2-LABEL: 'var_cttz_v32i8u'
743 ; AVX2-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 true)
744 ; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %cttz
746 ; AVX512-LABEL: 'var_cttz_v32i8u'
747 ; AVX512-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 true)
748 ; AVX512-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 68 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 68 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 52 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 42 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 22 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 68 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 68 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 52 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 42 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 22 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)