[sanitizer] Improve FreeBSD ASLR detection
[llvm-project.git] / llvm / test / Analysis / CostModel / X86 / ctlz.ll
blob29772397ab87b0d14528534c5d9349b857bd815c
1 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=-lzcnt,+sse2 | FileCheck %s -check-prefixes=SSE2,NOLZCNT
3 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+lzcnt,+sse2 | FileCheck %s -check-prefixes=SSE2,LZCNT
4 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+lzcnt,+sse4.2 | FileCheck %s -check-prefixes=LZCNT,SSE42
5 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+lzcnt,+avx | FileCheck %s -check-prefixes=LZCNT,AVX1
6 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+lzcnt,+avx2 | FileCheck %s -check-prefixes=LZCNT,AVX2
7 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+lzcnt,+avx512f | FileCheck %s -check-prefixes=LZCNT,AVX512,AVX512F
8 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+lzcnt,+avx512vl,+avx512bw,+avx512dq | FileCheck %s -check-prefixes=LZCNT,AVX512,AVX512BW
9 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+lzcnt,+avx512vl,+avx512bw,+avx512dq,+avx512cd | FileCheck %s -check-prefixes=LZCNT,AVX512CD
11 ; Verify the cost of scalar leading zero count instructions.
13 declare i64 @llvm.ctlz.i64(i64, i1)
14 declare i32 @llvm.ctlz.i32(i32, i1)
15 declare i16 @llvm.ctlz.i16(i16, i1)
16 declare  i8 @llvm.ctlz.i8(i8, i1)
18 define i64 @var_ctlz_i64(i64 %a) {
19 ; NOLZCNT-LABEL: 'var_ctlz_i64'
20 ; NOLZCNT-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %ctlz = call i64 @llvm.ctlz.i64(i64 %a, i1 false)
21 ; NOLZCNT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %ctlz
23 ; LZCNT-LABEL: 'var_ctlz_i64'
24 ; LZCNT-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call i64 @llvm.ctlz.i64(i64 %a, i1 false)
25 ; LZCNT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %ctlz
27   %ctlz = call i64 @llvm.ctlz.i64(i64 %a, i1 0)
28   ret i64 %ctlz
31 define i64 @var_ctlz_i64u(i64 %a) {
32 ; NOLZCNT-LABEL: 'var_ctlz_i64u'
33 ; NOLZCNT-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %ctlz = call i64 @llvm.ctlz.i64(i64 %a, i1 true)
34 ; NOLZCNT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %ctlz
36 ; LZCNT-LABEL: 'var_ctlz_i64u'
37 ; LZCNT-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call i64 @llvm.ctlz.i64(i64 %a, i1 true)
38 ; LZCNT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %ctlz
40   %ctlz = call i64 @llvm.ctlz.i64(i64 %a, i1 1)
41   ret i64 %ctlz
44 define i32 @var_ctlz_i32(i32 %a) {
45 ; NOLZCNT-LABEL: 'var_ctlz_i32'
46 ; NOLZCNT-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %ctlz = call i32 @llvm.ctlz.i32(i32 %a, i1 false)
47 ; NOLZCNT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %ctlz
49 ; LZCNT-LABEL: 'var_ctlz_i32'
50 ; LZCNT-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call i32 @llvm.ctlz.i32(i32 %a, i1 false)
51 ; LZCNT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %ctlz
53   %ctlz = call i32 @llvm.ctlz.i32(i32 %a, i1 0)
54   ret i32 %ctlz
57 define i32 @var_ctlz_i32u(i32 %a) {
58 ; NOLZCNT-LABEL: 'var_ctlz_i32u'
59 ; NOLZCNT-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %ctlz = call i32 @llvm.ctlz.i32(i32 %a, i1 true)
60 ; NOLZCNT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %ctlz
62 ; LZCNT-LABEL: 'var_ctlz_i32u'
63 ; LZCNT-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call i32 @llvm.ctlz.i32(i32 %a, i1 true)
64 ; LZCNT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %ctlz
66   %ctlz = call i32 @llvm.ctlz.i32(i32 %a, i1 1)
67   ret i32 %ctlz
70 define i16 @var_ctlz_i16(i16 %a) {
71 ; NOLZCNT-LABEL: 'var_ctlz_i16'
72 ; NOLZCNT-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %ctlz = call i16 @llvm.ctlz.i16(i16 %a, i1 false)
73 ; NOLZCNT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %ctlz
75 ; LZCNT-LABEL: 'var_ctlz_i16'
76 ; LZCNT-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call i16 @llvm.ctlz.i16(i16 %a, i1 false)
77 ; LZCNT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %ctlz
79   %ctlz = call i16 @llvm.ctlz.i16(i16 %a, i1 0)
80   ret i16 %ctlz
83 define i16 @var_ctlz_i16u(i16 %a) {
84 ; NOLZCNT-LABEL: 'var_ctlz_i16u'
85 ; NOLZCNT-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %ctlz = call i16 @llvm.ctlz.i16(i16 %a, i1 true)
86 ; NOLZCNT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %ctlz
88 ; LZCNT-LABEL: 'var_ctlz_i16u'
89 ; LZCNT-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call i16 @llvm.ctlz.i16(i16 %a, i1 true)
90 ; LZCNT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %ctlz
92   %ctlz = call i16 @llvm.ctlz.i16(i16 %a, i1 1)
93   ret i16 %ctlz
96 define i8 @var_ctlz_i8(i8 %a) {
97 ; NOLZCNT-LABEL: 'var_ctlz_i8'
98 ; NOLZCNT-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %ctlz = call i8 @llvm.ctlz.i8(i8 %a, i1 false)
99 ; NOLZCNT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i8 %ctlz
101 ; LZCNT-LABEL: 'var_ctlz_i8'
102 ; LZCNT-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call i8 @llvm.ctlz.i8(i8 %a, i1 false)
103 ; LZCNT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i8 %ctlz
105   %ctlz = call i8 @llvm.ctlz.i8(i8 %a, i1 0)
106   ret i8 %ctlz
109 define i8 @var_ctlz_i8u(i8 %a) {
110 ; NOLZCNT-LABEL: 'var_ctlz_i8u'
111 ; NOLZCNT-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %ctlz = call i8 @llvm.ctlz.i8(i8 %a, i1 true)
112 ; NOLZCNT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i8 %ctlz
114 ; LZCNT-LABEL: 'var_ctlz_i8u'
115 ; LZCNT-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call i8 @llvm.ctlz.i8(i8 %a, i1 true)
116 ; LZCNT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i8 %ctlz
118   %ctlz = call i8 @llvm.ctlz.i8(i8 %a, i1 1)
119   ret i8 %ctlz
122 ; Verify the cost of vector leading zero count instructions.
124 declare <2 x i64> @llvm.ctlz.v2i64(<2 x i64>, i1)
125 declare <4 x i32> @llvm.ctlz.v4i32(<4 x i32>, i1)
126 declare <8 x i16> @llvm.ctlz.v8i16(<8 x i16>, i1)
127 declare <16 x i8> @llvm.ctlz.v16i8(<16 x i8>, i1)
129 declare <4 x i64> @llvm.ctlz.v4i64(<4 x i64>, i1)
130 declare <8 x i32> @llvm.ctlz.v8i32(<8 x i32>, i1)
131 declare <16 x i16> @llvm.ctlz.v16i16(<16 x i16>, i1)
132 declare <32 x i8> @llvm.ctlz.v32i8(<32 x i8>, i1)
134 declare <8 x i64> @llvm.ctlz.v8i64(<8 x i64>, i1)
135 declare <16 x i32> @llvm.ctlz.v16i32(<16 x i32>, i1)
136 declare <32 x i16> @llvm.ctlz.v32i16(<32 x i16>, i1)
137 declare <64 x i8> @llvm.ctlz.v64i8(<64 x i8>, i1)
139 define <2 x i64> @var_ctlz_v2i64(<2 x i64> %a) {
140 ; SSE2-LABEL: 'var_ctlz_v2i64'
141 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 25 for instruction: %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 false)
142 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctlz
144 ; SSE42-LABEL: 'var_ctlz_v2i64'
145 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 23 for instruction: %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 false)
146 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctlz
148 ; AVX1-LABEL: 'var_ctlz_v2i64'
149 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 23 for instruction: %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 false)
150 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctlz
152 ; AVX2-LABEL: 'var_ctlz_v2i64'
153 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 false)
154 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctlz
156 ; AVX512-LABEL: 'var_ctlz_v2i64'
157 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 false)
158 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctlz
160 ; AVX512CD-LABEL: 'var_ctlz_v2i64'
161 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 false)
162 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctlz
164 ; AVX-LABEL: 'var_ctlz_v2i64'
165 ; AVX-NEXT:  Cost Model: Found an estimated cost of 23 for instruction: %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 false)
166 ; AVX-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctlz
167   %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 0)
168   ret <2 x i64> %ctlz
171 define <2 x i64> @var_ctlz_v2i64u(<2 x i64> %a) {
172 ; SSE2-LABEL: 'var_ctlz_v2i64u'
173 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 25 for instruction: %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 true)
174 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctlz
176 ; SSE42-LABEL: 'var_ctlz_v2i64u'
177 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 23 for instruction: %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 true)
178 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctlz
180 ; AVX1-LABEL: 'var_ctlz_v2i64u'
181 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 23 for instruction: %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 true)
182 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctlz
184 ; AVX2-LABEL: 'var_ctlz_v2i64u'
185 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 true)
186 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctlz
188 ; AVX512-LABEL: 'var_ctlz_v2i64u'
189 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 true)
190 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctlz
192 ; AVX512CD-LABEL: 'var_ctlz_v2i64u'
193 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 true)
194 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctlz
196 ; AVX-LABEL: 'var_ctlz_v2i64u'
197 ; AVX-NEXT:  Cost Model: Found an estimated cost of 23 for instruction: %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 true)
198 ; AVX-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctlz
199   %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 1)
200   ret <2 x i64> %ctlz
203 define <4 x i64> @var_ctlz_v4i64(<4 x i64> %a) {
204 ; SSE2-LABEL: 'var_ctlz_v4i64'
205 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 false)
206 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctlz
208 ; SSE42-LABEL: 'var_ctlz_v4i64'
209 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 46 for instruction: %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 false)
210 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctlz
212 ; AVX1-LABEL: 'var_ctlz_v4i64'
213 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 48 for instruction: %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 false)
214 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctlz
216 ; AVX2-LABEL: 'var_ctlz_v4i64'
217 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 false)
218 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctlz
220 ; AVX512-LABEL: 'var_ctlz_v4i64'
221 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 false)
222 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctlz
224 ; AVX512CD-LABEL: 'var_ctlz_v4i64'
225 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 false)
226 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctlz
228   %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 0)
229   ret <4 x i64> %ctlz
232 define <4 x i64> @var_ctlz_v4i64u(<4 x i64> %a) {
233 ; SSE2-LABEL: 'var_ctlz_v4i64u'
234 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 true)
235 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctlz
237 ; SSE42-LABEL: 'var_ctlz_v4i64u'
238 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 46 for instruction: %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 true)
239 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctlz
241 ; AVX1-LABEL: 'var_ctlz_v4i64u'
242 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 48 for instruction: %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 true)
243 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctlz
245 ; AVX2-LABEL: 'var_ctlz_v4i64u'
246 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 true)
247 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctlz
249 ; AVX512-LABEL: 'var_ctlz_v4i64u'
250 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 true)
251 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctlz
253 ; AVX512CD-LABEL: 'var_ctlz_v4i64u'
254 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 true)
255 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctlz
257   %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 1)
258   ret <4 x i64> %ctlz
261 define <8 x i64> @var_ctlz_v8i64(<8 x i64> %a) {
262 ; SSE2-LABEL: 'var_ctlz_v8i64'
263 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 100 for instruction: %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 false)
264 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctlz
266 ; SSE42-LABEL: 'var_ctlz_v8i64'
267 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 92 for instruction: %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 false)
268 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctlz
270 ; AVX1-LABEL: 'var_ctlz_v8i64'
271 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 96 for instruction: %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 false)
272 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctlz
274 ; AVX2-LABEL: 'var_ctlz_v8i64'
275 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 false)
276 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctlz
278 ; AVX512F-LABEL: 'var_ctlz_v8i64'
279 ; AVX512F-NEXT:  Cost Model: Found an estimated cost of 29 for instruction: %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 false)
280 ; AVX512F-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctlz
282 ; AVX512BW-LABEL: 'var_ctlz_v8i64'
283 ; AVX512BW-NEXT:  Cost Model: Found an estimated cost of 23 for instruction: %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 false)
284 ; AVX512BW-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctlz
286 ; AVX512CD-LABEL: 'var_ctlz_v8i64'
287 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 false)
288 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctlz
290   %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 0)
291   ret <8 x i64> %ctlz
294 define <8 x i64> @var_ctlz_v8i64u(<8 x i64> %a) {
295 ; SSE2-LABEL: 'var_ctlz_v8i64u'
296 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 100 for instruction: %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 true)
297 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctlz
299 ; SSE42-LABEL: 'var_ctlz_v8i64u'
300 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 92 for instruction: %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 true)
301 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctlz
303 ; AVX1-LABEL: 'var_ctlz_v8i64u'
304 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 96 for instruction: %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 true)
305 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctlz
307 ; AVX2-LABEL: 'var_ctlz_v8i64u'
308 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 true)
309 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctlz
311 ; AVX512F-LABEL: 'var_ctlz_v8i64u'
312 ; AVX512F-NEXT:  Cost Model: Found an estimated cost of 29 for instruction: %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 true)
313 ; AVX512F-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctlz
315 ; AVX512BW-LABEL: 'var_ctlz_v8i64u'
316 ; AVX512BW-NEXT:  Cost Model: Found an estimated cost of 23 for instruction: %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 true)
317 ; AVX512BW-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctlz
319 ; AVX512CD-LABEL: 'var_ctlz_v8i64u'
320 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 true)
321 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctlz
323   %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 1)
324   ret <8 x i64> %ctlz
327 define <4 x i32> @var_ctlz_v4i32(<4 x i32> %a) {
328 ; SSE2-LABEL: 'var_ctlz_v4i32'
329 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 26 for instruction: %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 false)
330 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctlz
332 ; SSE42-LABEL: 'var_ctlz_v4i32'
333 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 18 for instruction: %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 false)
334 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctlz
336 ; AVX1-LABEL: 'var_ctlz_v4i32'
337 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 18 for instruction: %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 false)
338 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctlz
340 ; AVX2-LABEL: 'var_ctlz_v4i32'
341 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 false)
342 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctlz
344 ; AVX512-LABEL: 'var_ctlz_v4i32'
345 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 false)
346 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctlz
348 ; AVX512CD-LABEL: 'var_ctlz_v4i32'
349 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 false)
350 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctlz
352 ; AVX-LABEL: 'var_ctlz_v4i32'
353 ; AVX-NEXT:  Cost Model: Found an estimated cost of 18 for instruction: %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 false)
354 ; AVX-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctlz
355   %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 0)
356   ret <4 x i32> %ctlz
359 define <4 x i32> @var_ctlz_v4i32u(<4 x i32> %a) {
360 ; SSE2-LABEL: 'var_ctlz_v4i32u'
361 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 26 for instruction: %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 true)
362 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctlz
364 ; SSE42-LABEL: 'var_ctlz_v4i32u'
365 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 18 for instruction: %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 true)
366 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctlz
368 ; AVX1-LABEL: 'var_ctlz_v4i32u'
369 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 18 for instruction: %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 true)
370 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctlz
372 ; AVX2-LABEL: 'var_ctlz_v4i32u'
373 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 true)
374 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctlz
376 ; AVX512-LABEL: 'var_ctlz_v4i32u'
377 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 true)
378 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctlz
380 ; AVX512CD-LABEL: 'var_ctlz_v4i32u'
381 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 true)
382 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctlz
384 ; AVX-LABEL: 'var_ctlz_v4i32u'
385 ; AVX-NEXT:  Cost Model: Found an estimated cost of 18 for instruction: %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 true)
386 ; AVX-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctlz
387   %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 1)
388   ret <4 x i32> %ctlz
391 define <8 x i32> @var_ctlz_v8i32(<8 x i32> %a) {
392 ; SSE2-LABEL: 'var_ctlz_v8i32'
393 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 52 for instruction: %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 false)
394 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctlz
396 ; SSE42-LABEL: 'var_ctlz_v8i32'
397 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 36 for instruction: %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 false)
398 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctlz
400 ; AVX1-LABEL: 'var_ctlz_v8i32'
401 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 38 for instruction: %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 false)
402 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctlz
404 ; AVX2-LABEL: 'var_ctlz_v8i32'
405 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 false)
406 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctlz
408 ; AVX512-LABEL: 'var_ctlz_v8i32'
409 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 false)
410 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctlz
412 ; AVX512CD-LABEL: 'var_ctlz_v8i32'
413 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 false)
414 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctlz
416   %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 0)
417   ret <8 x i32> %ctlz
420 define <8 x i32> @var_ctlz_v8i32u(<8 x i32> %a) {
421 ; SSE2-LABEL: 'var_ctlz_v8i32u'
422 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 52 for instruction: %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 true)
423 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctlz
425 ; SSE42-LABEL: 'var_ctlz_v8i32u'
426 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 36 for instruction: %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 true)
427 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctlz
429 ; AVX1-LABEL: 'var_ctlz_v8i32u'
430 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 38 for instruction: %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 true)
431 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctlz
433 ; AVX2-LABEL: 'var_ctlz_v8i32u'
434 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 true)
435 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctlz
437 ; AVX512-LABEL: 'var_ctlz_v8i32u'
438 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 true)
439 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctlz
441 ; AVX512CD-LABEL: 'var_ctlz_v8i32u'
442 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 true)
443 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctlz
445   %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 1)
446   ret <8 x i32> %ctlz
449 define <16 x i32> @var_ctlz_v16i32(<16 x i32> %a) {
450 ; SSE2-LABEL: 'var_ctlz_v16i32'
451 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 104 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 false)
452 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctlz
454 ; SSE42-LABEL: 'var_ctlz_v16i32'
455 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 72 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 false)
456 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctlz
458 ; AVX1-LABEL: 'var_ctlz_v16i32'
459 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 76 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 false)
460 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctlz
462 ; AVX2-LABEL: 'var_ctlz_v16i32'
463 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 false)
464 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctlz
466 ; AVX512F-LABEL: 'var_ctlz_v16i32'
467 ; AVX512F-NEXT:  Cost Model: Found an estimated cost of 35 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 false)
468 ; AVX512F-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctlz
470 ; AVX512BW-LABEL: 'var_ctlz_v16i32'
471 ; AVX512BW-NEXT:  Cost Model: Found an estimated cost of 22 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 false)
472 ; AVX512BW-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctlz
474 ; AVX512CD-LABEL: 'var_ctlz_v16i32'
475 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 false)
476 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctlz
478   %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 0)
479   ret <16 x i32> %ctlz
482 define <16 x i32> @var_ctlz_v16i32u(<16 x i32> %a) {
483 ; SSE2-LABEL: 'var_ctlz_v16i32u'
484 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 104 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 true)
485 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctlz
487 ; SSE42-LABEL: 'var_ctlz_v16i32u'
488 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 72 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 true)
489 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctlz
491 ; AVX1-LABEL: 'var_ctlz_v16i32u'
492 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 76 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 true)
493 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctlz
495 ; AVX2-LABEL: 'var_ctlz_v16i32u'
496 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 true)
497 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctlz
499 ; AVX512F-LABEL: 'var_ctlz_v16i32u'
500 ; AVX512F-NEXT:  Cost Model: Found an estimated cost of 35 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 true)
501 ; AVX512F-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctlz
503 ; AVX512BW-LABEL: 'var_ctlz_v16i32u'
504 ; AVX512BW-NEXT:  Cost Model: Found an estimated cost of 22 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 true)
505 ; AVX512BW-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctlz
507 ; AVX512CD-LABEL: 'var_ctlz_v16i32u'
508 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 true)
509 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctlz
511   %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 1)
512   ret <16 x i32> %ctlz
515 define <8 x i16> @var_ctlz_v8i16(<8 x i16> %a) {
516 ; SSE2-LABEL: 'var_ctlz_v8i16'
517 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %ctlz = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> %a, i1 false)
518 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctlz
520 ; SSE42-LABEL: 'var_ctlz_v8i16'
521 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %ctlz = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> %a, i1 false)
522 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctlz
524 ; AVX1-LABEL: 'var_ctlz_v8i16'
525 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %ctlz = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> %a, i1 false)
526 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctlz
528 ; AVX2-LABEL: 'var_ctlz_v8i16'
529 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %ctlz = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> %a, i1 false)
530 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctlz
532 ; AVX512-LABEL: 'var_ctlz_v8i16'
533 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %ctlz = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> %a, i1 false)
534 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctlz
536 ; AVX512CD-LABEL: 'var_ctlz_v8i16'
537 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %ctlz = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> %a, i1 false)
538 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctlz
540 ; AVX-LABEL: 'var_ctlz_v8i16'
541 ; AVX-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %ctlz = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> %a, i1 false)
542 ; AVX-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctlz
543   %ctlz = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> %a, i1 0)
544   ret <8 x i16> %ctlz
547 define <8 x i16> @var_ctlz_v8i16u(<8 x i16> %a) {
548 ; SSE2-LABEL: 'var_ctlz_v8i16u'
549 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %ctlz = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> %a, i1 true)
550 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctlz
552 ; SSE42-LABEL: 'var_ctlz_v8i16u'
553 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %ctlz = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> %a, i1 true)
554 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctlz
556 ; AVX1-LABEL: 'var_ctlz_v8i16u'
557 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %ctlz = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> %a, i1 true)
558 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctlz
560 ; AVX2-LABEL: 'var_ctlz_v8i16u'
561 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %ctlz = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> %a, i1 true)
562 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctlz
564 ; AVX512-LABEL: 'var_ctlz_v8i16u'
565 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %ctlz = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> %a, i1 true)
566 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctlz
568 ; AVX512CD-LABEL: 'var_ctlz_v8i16u'
569 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %ctlz = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> %a, i1 true)
570 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctlz
572 ; AVX-LABEL: 'var_ctlz_v8i16u'
573 ; AVX-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %ctlz = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> %a, i1 true)
574 ; AVX-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctlz
575   %ctlz = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> %a, i1 1)
576   ret <8 x i16> %ctlz
579 define <16 x i16> @var_ctlz_v16i16(<16 x i16> %a) {
580 ; SSE2-LABEL: 'var_ctlz_v16i16'
581 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 false)
582 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctlz
584 ; SSE42-LABEL: 'var_ctlz_v16i16'
585 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 28 for instruction: %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 false)
586 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctlz
588 ; AVX1-LABEL: 'var_ctlz_v16i16'
589 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 30 for instruction: %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 false)
590 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctlz
592 ; AVX2-LABEL: 'var_ctlz_v16i16'
593 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 false)
594 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctlz
596 ; AVX512-LABEL: 'var_ctlz_v16i16'
597 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 false)
598 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctlz
600 ; AVX512CD-LABEL: 'var_ctlz_v16i16'
601 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 false)
602 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctlz
604   %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 0)
605   ret <16 x i16> %ctlz
608 define <16 x i16> @var_ctlz_v16i16u(<16 x i16> %a) {
609 ; SSE2-LABEL: 'var_ctlz_v16i16u'
610 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 true)
611 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctlz
613 ; SSE42-LABEL: 'var_ctlz_v16i16u'
614 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 28 for instruction: %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 true)
615 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctlz
617 ; AVX1-LABEL: 'var_ctlz_v16i16u'
618 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 30 for instruction: %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 true)
619 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctlz
621 ; AVX2-LABEL: 'var_ctlz_v16i16u'
622 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 true)
623 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctlz
625 ; AVX512-LABEL: 'var_ctlz_v16i16u'
626 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 true)
627 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctlz
629 ; AVX512CD-LABEL: 'var_ctlz_v16i16u'
630 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 true)
631 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctlz
633   %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 1)
634   ret <16 x i16> %ctlz
637 define <32 x i16> @var_ctlz_v32i16(<32 x i16> %a) {
638 ; SSE2-LABEL: 'var_ctlz_v32i16'
639 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 80 for instruction: %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 false)
640 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctlz
642 ; SSE42-LABEL: 'var_ctlz_v32i16'
643 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 56 for instruction: %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 false)
644 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctlz
646 ; AVX1-LABEL: 'var_ctlz_v32i16'
647 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 60 for instruction: %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 false)
648 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctlz
650 ; AVX2-LABEL: 'var_ctlz_v32i16'
651 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 false)
652 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctlz
654 ; AVX512F-LABEL: 'var_ctlz_v32i16'
655 ; AVX512F-NEXT:  Cost Model: Found an estimated cost of 28 for instruction: %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 false)
656 ; AVX512F-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctlz
658 ; AVX512BW-LABEL: 'var_ctlz_v32i16'
659 ; AVX512BW-NEXT:  Cost Model: Found an estimated cost of 18 for instruction: %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 false)
660 ; AVX512BW-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctlz
662 ; AVX512CD-LABEL: 'var_ctlz_v32i16'
663 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 false)
664 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctlz
666   %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 0)
667   ret <32 x i16> %ctlz
670 define <32 x i16> @var_ctlz_v32i16u(<32 x i16> %a) {
671 ; SSE2-LABEL: 'var_ctlz_v32i16u'
672 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 80 for instruction: %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 true)
673 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctlz
675 ; SSE42-LABEL: 'var_ctlz_v32i16u'
676 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 56 for instruction: %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 true)
677 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctlz
679 ; AVX1-LABEL: 'var_ctlz_v32i16u'
680 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 60 for instruction: %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 true)
681 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctlz
683 ; AVX2-LABEL: 'var_ctlz_v32i16u'
684 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 true)
685 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctlz
687 ; AVX512F-LABEL: 'var_ctlz_v32i16u'
688 ; AVX512F-NEXT:  Cost Model: Found an estimated cost of 28 for instruction: %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 true)
689 ; AVX512F-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctlz
691 ; AVX512BW-LABEL: 'var_ctlz_v32i16u'
692 ; AVX512BW-NEXT:  Cost Model: Found an estimated cost of 18 for instruction: %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 true)
693 ; AVX512BW-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctlz
695 ; AVX512CD-LABEL: 'var_ctlz_v32i16u'
696 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 true)
697 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctlz
699   %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 1)
700   ret <32 x i16> %ctlz
703 define <16 x i8> @var_ctlz_v16i8(<16 x i8> %a) {
704 ; SSE2-LABEL: 'var_ctlz_v16i8'
705 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 17 for instruction: %ctlz = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %a, i1 false)
706 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctlz
708 ; SSE42-LABEL: 'var_ctlz_v16i8'
709 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %ctlz = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %a, i1 false)
710 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctlz
712 ; AVX1-LABEL: 'var_ctlz_v16i8'
713 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %ctlz = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %a, i1 false)
714 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctlz
716 ; AVX2-LABEL: 'var_ctlz_v16i8'
717 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %ctlz = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %a, i1 false)
718 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctlz
720 ; AVX512-LABEL: 'var_ctlz_v16i8'
721 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %ctlz = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %a, i1 false)
722 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctlz
724 ; AVX512CD-LABEL: 'var_ctlz_v16i8'
725 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %ctlz = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %a, i1 false)
726 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctlz
728 ; AVX-LABEL: 'var_ctlz_v16i8'
729 ; AVX-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %ctlz = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %a, i1 false)
730 ; AVX-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctlz
731   %ctlz = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %a, i1 0)
732   ret <16 x i8> %ctlz
735 define <16 x i8> @var_ctlz_v16i8u(<16 x i8> %a) {
736 ; SSE2-LABEL: 'var_ctlz_v16i8u'
737 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 17 for instruction: %ctlz = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %a, i1 true)
738 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctlz
740 ; SSE42-LABEL: 'var_ctlz_v16i8u'
741 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %ctlz = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %a, i1 true)
742 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctlz
744 ; AVX1-LABEL: 'var_ctlz_v16i8u'
745 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %ctlz = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %a, i1 true)
746 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctlz
748 ; AVX2-LABEL: 'var_ctlz_v16i8u'
749 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %ctlz = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %a, i1 true)
750 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctlz
752 ; AVX512-LABEL: 'var_ctlz_v16i8u'
753 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %ctlz = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %a, i1 true)
754 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctlz
756 ; AVX512CD-LABEL: 'var_ctlz_v16i8u'
757 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %ctlz = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %a, i1 true)
758 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctlz
760 ; AVX-LABEL: 'var_ctlz_v16i8u'
761 ; AVX-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %ctlz = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %a, i1 true)
762 ; AVX-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctlz
763   %ctlz = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %a, i1 1)
764   ret <16 x i8> %ctlz
767 define <32 x i8> @var_ctlz_v32i8(<32 x i8> %a) {
768 ; SSE2-LABEL: 'var_ctlz_v32i8'
769 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 34 for instruction: %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 false)
770 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctlz
772 ; SSE42-LABEL: 'var_ctlz_v32i8'
773 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 18 for instruction: %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 false)
774 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctlz
776 ; AVX1-LABEL: 'var_ctlz_v32i8'
777 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 false)
778 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctlz
780 ; AVX2-LABEL: 'var_ctlz_v32i8'
781 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 false)
782 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctlz
784 ; AVX512-LABEL: 'var_ctlz_v32i8'
785 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 false)
786 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctlz
788 ; AVX512CD-LABEL: 'var_ctlz_v32i8'
789 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 false)
790 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctlz
792   %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 0)
793   ret <32 x i8> %ctlz
796 define <32 x i8> @var_ctlz_v32i8u(<32 x i8> %a) {
797 ; SSE2-LABEL: 'var_ctlz_v32i8u'
798 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 34 for instruction: %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 true)
799 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctlz
801 ; SSE42-LABEL: 'var_ctlz_v32i8u'
802 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 18 for instruction: %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 true)
803 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctlz
805 ; AVX1-LABEL: 'var_ctlz_v32i8u'
806 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 true)
807 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctlz
809 ; AVX2-LABEL: 'var_ctlz_v32i8u'
810 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 true)
811 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctlz
813 ; AVX512-LABEL: 'var_ctlz_v32i8u'
814 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 true)
815 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctlz
817 ; AVX512CD-LABEL: 'var_ctlz_v32i8u'
818 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 true)
819 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctlz
821   %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 1)
822   ret <32 x i8> %ctlz
825 define <64 x i8> @var_ctlz_v64i8(<64 x i8> %a) {
826 ; SSE2-LABEL: 'var_ctlz_v64i8'
827 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 68 for instruction: %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 false)
828 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctlz
830 ; SSE42-LABEL: 'var_ctlz_v64i8'
831 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 36 for instruction: %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 false)
832 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctlz
834 ; AVX1-LABEL: 'var_ctlz_v64i8'
835 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 false)
836 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctlz
838 ; AVX2-LABEL: 'var_ctlz_v64i8'
839 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 false)
840 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctlz
842 ; AVX512F-LABEL: 'var_ctlz_v64i8'
843 ; AVX512F-NEXT:  Cost Model: Found an estimated cost of 18 for instruction: %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 false)
844 ; AVX512F-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctlz
846 ; AVX512BW-LABEL: 'var_ctlz_v64i8'
847 ; AVX512BW-NEXT:  Cost Model: Found an estimated cost of 17 for instruction: %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 false)
848 ; AVX512BW-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctlz
850 ; AVX512CD-LABEL: 'var_ctlz_v64i8'
851 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 false)
852 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctlz
854   %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 0)
855   ret <64 x i8> %ctlz
858 define <64 x i8> @var_ctlz_v64i8u(<64 x i8> %a) {
859 ; SSE2-LABEL: 'var_ctlz_v64i8u'
860 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 68 for instruction: %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 true)
861 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctlz
863 ; SSE42-LABEL: 'var_ctlz_v64i8u'
864 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 36 for instruction: %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 true)
865 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctlz
867 ; AVX1-LABEL: 'var_ctlz_v64i8u'
868 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 true)
869 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctlz
871 ; AVX2-LABEL: 'var_ctlz_v64i8u'
872 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 true)
873 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctlz
875 ; AVX512F-LABEL: 'var_ctlz_v64i8u'
876 ; AVX512F-NEXT:  Cost Model: Found an estimated cost of 18 for instruction: %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 true)
877 ; AVX512F-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctlz
879 ; AVX512BW-LABEL: 'var_ctlz_v64i8u'
880 ; AVX512BW-NEXT:  Cost Model: Found an estimated cost of 17 for instruction: %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 true)
881 ; AVX512BW-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctlz
883 ; AVX512CD-LABEL: 'var_ctlz_v64i8u'
884 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 true)
885 ; AVX512CD-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctlz
887   %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 1)
888   ret <64 x i8> %ctlz