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=CHECK,SSE,SSE2,NOLZCNT
3 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+lzcnt,+sse2 | FileCheck %s -check-prefixes=CHECK,SSE,SSE2,LZCNT
4 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+lzcnt,+sse4.2 | FileCheck %s -check-prefixes=CHECK,LZCNT,SSE,SSE42
5 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+lzcnt,+avx | FileCheck %s -check-prefixes=CHECK,LZCNT,AVX,AVX1
6 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+lzcnt,+avx2 | FileCheck %s -check-prefixes=CHECK,LZCNT,AVX,AVX2
7 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+lzcnt,+avx512f | FileCheck %s -check-prefixes=CHECK,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=CHECK,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=CHECK,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)
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)
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)
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)
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)
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)
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)
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)
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 ; AVX-LABEL: 'var_ctlz_v2i64'
149 ; 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)
150 ; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctlz
152 ; AVX512-LABEL: 'var_ctlz_v2i64'
153 ; AVX512-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)
154 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctlz
156 ; AVX512CD-LABEL: 'var_ctlz_v2i64'
157 ; 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)
158 ; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctlz
160 %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 0)
164 define <2 x i64> @var_ctlz_v2i64u(<2 x i64> %a) {
165 ; SSE2-LABEL: 'var_ctlz_v2i64u'
166 ; 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)
167 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctlz
169 ; SSE42-LABEL: 'var_ctlz_v2i64u'
170 ; 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)
171 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctlz
173 ; AVX-LABEL: 'var_ctlz_v2i64u'
174 ; 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)
175 ; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctlz
177 ; AVX512-LABEL: 'var_ctlz_v2i64u'
178 ; AVX512-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)
179 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctlz
181 ; AVX512CD-LABEL: 'var_ctlz_v2i64u'
182 ; 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)
183 ; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctlz
185 %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 1)
189 define <4 x i64> @var_ctlz_v4i64(<4 x i64> %a) {
190 ; SSE2-LABEL: 'var_ctlz_v4i64'
191 ; 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)
192 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctlz
194 ; SSE42-LABEL: 'var_ctlz_v4i64'
195 ; 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)
196 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctlz
198 ; AVX1-LABEL: 'var_ctlz_v4i64'
199 ; 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)
200 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctlz
202 ; AVX2-LABEL: 'var_ctlz_v4i64'
203 ; AVX2-NEXT: Cost Model: Found an estimated cost of 23 for instruction: %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 false)
204 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctlz
206 ; AVX512-LABEL: 'var_ctlz_v4i64'
207 ; AVX512-NEXT: Cost Model: Found an estimated cost of 23 for instruction: %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 false)
208 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctlz
210 ; AVX512CD-LABEL: 'var_ctlz_v4i64'
211 ; 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)
212 ; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctlz
214 %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 0)
218 define <4 x i64> @var_ctlz_v4i64u(<4 x i64> %a) {
219 ; SSE2-LABEL: 'var_ctlz_v4i64u'
220 ; 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)
221 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctlz
223 ; SSE42-LABEL: 'var_ctlz_v4i64u'
224 ; 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)
225 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctlz
227 ; AVX1-LABEL: 'var_ctlz_v4i64u'
228 ; 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)
229 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctlz
231 ; AVX2-LABEL: 'var_ctlz_v4i64u'
232 ; AVX2-NEXT: Cost Model: Found an estimated cost of 23 for instruction: %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 true)
233 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctlz
235 ; AVX512-LABEL: 'var_ctlz_v4i64u'
236 ; AVX512-NEXT: Cost Model: Found an estimated cost of 23 for instruction: %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 true)
237 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctlz
239 ; AVX512CD-LABEL: 'var_ctlz_v4i64u'
240 ; 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)
241 ; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctlz
243 %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 1)
247 define <8 x i64> @var_ctlz_v8i64(<8 x i64> %a) {
248 ; SSE2-LABEL: 'var_ctlz_v8i64'
249 ; 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)
250 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctlz
252 ; SSE42-LABEL: 'var_ctlz_v8i64'
253 ; 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)
254 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctlz
256 ; AVX1-LABEL: 'var_ctlz_v8i64'
257 ; 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)
258 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctlz
260 ; AVX2-LABEL: 'var_ctlz_v8i64'
261 ; AVX2-NEXT: Cost Model: Found an estimated cost of 46 for instruction: %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 false)
262 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctlz
264 ; AVX512F-LABEL: 'var_ctlz_v8i64'
265 ; 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)
266 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctlz
268 ; AVX512BW-LABEL: 'var_ctlz_v8i64'
269 ; 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)
270 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctlz
272 ; AVX512CD-LABEL: 'var_ctlz_v8i64'
273 ; 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)
274 ; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctlz
276 %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 0)
280 define <8 x i64> @var_ctlz_v8i64u(<8 x i64> %a) {
281 ; SSE2-LABEL: 'var_ctlz_v8i64u'
282 ; 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)
283 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctlz
285 ; SSE42-LABEL: 'var_ctlz_v8i64u'
286 ; 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)
287 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctlz
289 ; AVX1-LABEL: 'var_ctlz_v8i64u'
290 ; 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)
291 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctlz
293 ; AVX2-LABEL: 'var_ctlz_v8i64u'
294 ; AVX2-NEXT: Cost Model: Found an estimated cost of 46 for instruction: %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 true)
295 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctlz
297 ; AVX512F-LABEL: 'var_ctlz_v8i64u'
298 ; 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)
299 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctlz
301 ; AVX512BW-LABEL: 'var_ctlz_v8i64u'
302 ; 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)
303 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctlz
305 ; AVX512CD-LABEL: 'var_ctlz_v8i64u'
306 ; 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)
307 ; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctlz
309 %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 1)
313 define <4 x i32> @var_ctlz_v4i32(<4 x i32> %a) {
314 ; SSE2-LABEL: 'var_ctlz_v4i32'
315 ; 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)
316 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctlz
318 ; SSE42-LABEL: 'var_ctlz_v4i32'
319 ; 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)
320 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctlz
322 ; AVX-LABEL: 'var_ctlz_v4i32'
323 ; 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)
324 ; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctlz
326 ; AVX512-LABEL: 'var_ctlz_v4i32'
327 ; AVX512-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)
328 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctlz
330 ; AVX512CD-LABEL: 'var_ctlz_v4i32'
331 ; 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)
332 ; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctlz
334 %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 0)
338 define <4 x i32> @var_ctlz_v4i32u(<4 x i32> %a) {
339 ; SSE2-LABEL: 'var_ctlz_v4i32u'
340 ; 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)
341 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctlz
343 ; SSE42-LABEL: 'var_ctlz_v4i32u'
344 ; 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)
345 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctlz
347 ; AVX-LABEL: 'var_ctlz_v4i32u'
348 ; 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)
349 ; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctlz
351 ; AVX512-LABEL: 'var_ctlz_v4i32u'
352 ; AVX512-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)
353 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctlz
355 ; AVX512CD-LABEL: 'var_ctlz_v4i32u'
356 ; 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)
357 ; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctlz
359 %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 1)
363 define <8 x i32> @var_ctlz_v8i32(<8 x i32> %a) {
364 ; SSE2-LABEL: 'var_ctlz_v8i32'
365 ; 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)
366 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctlz
368 ; SSE42-LABEL: 'var_ctlz_v8i32'
369 ; 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)
370 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctlz
372 ; AVX1-LABEL: 'var_ctlz_v8i32'
373 ; 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)
374 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctlz
376 ; AVX2-LABEL: 'var_ctlz_v8i32'
377 ; AVX2-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 false)
378 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctlz
380 ; AVX512-LABEL: 'var_ctlz_v8i32'
381 ; AVX512-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 false)
382 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctlz
384 ; AVX512CD-LABEL: 'var_ctlz_v8i32'
385 ; 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)
386 ; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctlz
388 %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 0)
392 define <8 x i32> @var_ctlz_v8i32u(<8 x i32> %a) {
393 ; SSE2-LABEL: 'var_ctlz_v8i32u'
394 ; 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)
395 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctlz
397 ; SSE42-LABEL: 'var_ctlz_v8i32u'
398 ; 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)
399 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctlz
401 ; AVX1-LABEL: 'var_ctlz_v8i32u'
402 ; 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)
403 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctlz
405 ; AVX2-LABEL: 'var_ctlz_v8i32u'
406 ; AVX2-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 true)
407 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctlz
409 ; AVX512-LABEL: 'var_ctlz_v8i32u'
410 ; AVX512-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 true)
411 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctlz
413 ; AVX512CD-LABEL: 'var_ctlz_v8i32u'
414 ; 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)
415 ; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctlz
417 %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 1)
421 define <16 x i32> @var_ctlz_v16i32(<16 x i32> %a) {
422 ; SSE2-LABEL: 'var_ctlz_v16i32'
423 ; 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)
424 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctlz
426 ; SSE42-LABEL: 'var_ctlz_v16i32'
427 ; 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)
428 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctlz
430 ; AVX1-LABEL: 'var_ctlz_v16i32'
431 ; 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)
432 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctlz
434 ; AVX2-LABEL: 'var_ctlz_v16i32'
435 ; AVX2-NEXT: Cost Model: Found an estimated cost of 36 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 false)
436 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctlz
438 ; AVX512F-LABEL: 'var_ctlz_v16i32'
439 ; 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)
440 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctlz
442 ; AVX512BW-LABEL: 'var_ctlz_v16i32'
443 ; 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)
444 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctlz
446 ; AVX512CD-LABEL: 'var_ctlz_v16i32'
447 ; 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)
448 ; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctlz
450 %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 0)
454 define <16 x i32> @var_ctlz_v16i32u(<16 x i32> %a) {
455 ; SSE2-LABEL: 'var_ctlz_v16i32u'
456 ; 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)
457 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctlz
459 ; SSE42-LABEL: 'var_ctlz_v16i32u'
460 ; 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)
461 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctlz
463 ; AVX1-LABEL: 'var_ctlz_v16i32u'
464 ; 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)
465 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctlz
467 ; AVX2-LABEL: 'var_ctlz_v16i32u'
468 ; AVX2-NEXT: Cost Model: Found an estimated cost of 36 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 true)
469 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctlz
471 ; AVX512F-LABEL: 'var_ctlz_v16i32u'
472 ; 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)
473 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctlz
475 ; AVX512BW-LABEL: 'var_ctlz_v16i32u'
476 ; 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)
477 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctlz
479 ; AVX512CD-LABEL: 'var_ctlz_v16i32u'
480 ; 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)
481 ; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctlz
483 %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 1)
487 define <8 x i16> @var_ctlz_v8i16(<8 x i16> %a) {
488 ; SSE2-LABEL: 'var_ctlz_v8i16'
489 ; 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)
490 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctlz
492 ; SSE42-LABEL: 'var_ctlz_v8i16'
493 ; 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)
494 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctlz
496 ; AVX-LABEL: 'var_ctlz_v8i16'
497 ; 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)
498 ; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctlz
500 ; AVX512-LABEL: 'var_ctlz_v8i16'
501 ; AVX512-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)
502 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctlz
504 ; AVX512CD-LABEL: 'var_ctlz_v8i16'
505 ; 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)
506 ; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctlz
508 %ctlz = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> %a, i1 0)
512 define <8 x i16> @var_ctlz_v8i16u(<8 x i16> %a) {
513 ; SSE2-LABEL: 'var_ctlz_v8i16u'
514 ; 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)
515 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctlz
517 ; SSE42-LABEL: 'var_ctlz_v8i16u'
518 ; 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)
519 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctlz
521 ; AVX-LABEL: 'var_ctlz_v8i16u'
522 ; 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)
523 ; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctlz
525 ; AVX512-LABEL: 'var_ctlz_v8i16u'
526 ; AVX512-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)
527 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctlz
529 ; AVX512CD-LABEL: 'var_ctlz_v8i16u'
530 ; 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)
531 ; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctlz
533 %ctlz = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> %a, i1 1)
537 define <16 x i16> @var_ctlz_v16i16(<16 x i16> %a) {
538 ; SSE2-LABEL: 'var_ctlz_v16i16'
539 ; 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)
540 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctlz
542 ; SSE42-LABEL: 'var_ctlz_v16i16'
543 ; 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)
544 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctlz
546 ; AVX1-LABEL: 'var_ctlz_v16i16'
547 ; 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)
548 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctlz
550 ; AVX2-LABEL: 'var_ctlz_v16i16'
551 ; AVX2-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 false)
552 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctlz
554 ; AVX512-LABEL: 'var_ctlz_v16i16'
555 ; AVX512-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 false)
556 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctlz
558 ; AVX512CD-LABEL: 'var_ctlz_v16i16'
559 ; 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)
560 ; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctlz
562 %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 0)
566 define <16 x i16> @var_ctlz_v16i16u(<16 x i16> %a) {
567 ; SSE2-LABEL: 'var_ctlz_v16i16u'
568 ; 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)
569 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctlz
571 ; SSE42-LABEL: 'var_ctlz_v16i16u'
572 ; 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)
573 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctlz
575 ; AVX1-LABEL: 'var_ctlz_v16i16u'
576 ; 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)
577 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctlz
579 ; AVX2-LABEL: 'var_ctlz_v16i16u'
580 ; AVX2-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 true)
581 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctlz
583 ; AVX512-LABEL: 'var_ctlz_v16i16u'
584 ; AVX512-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 true)
585 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctlz
587 ; AVX512CD-LABEL: 'var_ctlz_v16i16u'
588 ; 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)
589 ; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctlz
591 %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 1)
595 define <32 x i16> @var_ctlz_v32i16(<32 x i16> %a) {
596 ; SSE2-LABEL: 'var_ctlz_v32i16'
597 ; 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)
598 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctlz
600 ; SSE42-LABEL: 'var_ctlz_v32i16'
601 ; 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)
602 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctlz
604 ; AVX1-LABEL: 'var_ctlz_v32i16'
605 ; 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)
606 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctlz
608 ; AVX2-LABEL: 'var_ctlz_v32i16'
609 ; AVX2-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)
610 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctlz
612 ; AVX512F-LABEL: 'var_ctlz_v32i16'
613 ; 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)
614 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctlz
616 ; AVX512BW-LABEL: 'var_ctlz_v32i16'
617 ; 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)
618 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctlz
620 ; AVX512CD-LABEL: 'var_ctlz_v32i16'
621 ; 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)
622 ; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctlz
624 %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 0)
628 define <32 x i16> @var_ctlz_v32i16u(<32 x i16> %a) {
629 ; SSE2-LABEL: 'var_ctlz_v32i16u'
630 ; 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)
631 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctlz
633 ; SSE42-LABEL: 'var_ctlz_v32i16u'
634 ; 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)
635 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctlz
637 ; AVX1-LABEL: 'var_ctlz_v32i16u'
638 ; 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)
639 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctlz
641 ; AVX2-LABEL: 'var_ctlz_v32i16u'
642 ; AVX2-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)
643 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctlz
645 ; AVX512F-LABEL: 'var_ctlz_v32i16u'
646 ; 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)
647 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctlz
649 ; AVX512BW-LABEL: 'var_ctlz_v32i16u'
650 ; 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)
651 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctlz
653 ; AVX512CD-LABEL: 'var_ctlz_v32i16u'
654 ; 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)
655 ; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctlz
657 %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 1)
661 define <16 x i8> @var_ctlz_v16i8(<16 x i8> %a) {
662 ; SSE2-LABEL: 'var_ctlz_v16i8'
663 ; 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)
664 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctlz
666 ; SSE42-LABEL: 'var_ctlz_v16i8'
667 ; 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)
668 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctlz
670 ; AVX-LABEL: 'var_ctlz_v16i8'
671 ; 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)
672 ; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctlz
674 ; AVX512-LABEL: 'var_ctlz_v16i8'
675 ; AVX512-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)
676 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctlz
678 ; AVX512CD-LABEL: 'var_ctlz_v16i8'
679 ; 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)
680 ; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctlz
682 %ctlz = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %a, i1 0)
686 define <16 x i8> @var_ctlz_v16i8u(<16 x i8> %a) {
687 ; SSE2-LABEL: 'var_ctlz_v16i8u'
688 ; 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)
689 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctlz
691 ; SSE42-LABEL: 'var_ctlz_v16i8u'
692 ; 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)
693 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctlz
695 ; AVX-LABEL: 'var_ctlz_v16i8u'
696 ; 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)
697 ; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctlz
699 ; AVX512-LABEL: 'var_ctlz_v16i8u'
700 ; AVX512-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)
701 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctlz
703 ; AVX512CD-LABEL: 'var_ctlz_v16i8u'
704 ; 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)
705 ; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctlz
707 %ctlz = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %a, i1 1)
711 define <32 x i8> @var_ctlz_v32i8(<32 x i8> %a) {
712 ; SSE2-LABEL: 'var_ctlz_v32i8'
713 ; 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)
714 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctlz
716 ; SSE42-LABEL: 'var_ctlz_v32i8'
717 ; 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)
718 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctlz
720 ; AVX1-LABEL: 'var_ctlz_v32i8'
721 ; 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)
722 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctlz
724 ; AVX2-LABEL: 'var_ctlz_v32i8'
725 ; AVX2-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 false)
726 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctlz
728 ; AVX512-LABEL: 'var_ctlz_v32i8'
729 ; AVX512-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 false)
730 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctlz
732 ; AVX512CD-LABEL: 'var_ctlz_v32i8'
733 ; 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)
734 ; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctlz
736 %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 0)
740 define <32 x i8> @var_ctlz_v32i8u(<32 x i8> %a) {
741 ; SSE2-LABEL: 'var_ctlz_v32i8u'
742 ; 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)
743 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctlz
745 ; SSE42-LABEL: 'var_ctlz_v32i8u'
746 ; 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)
747 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctlz
749 ; AVX1-LABEL: 'var_ctlz_v32i8u'
750 ; 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)
751 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctlz
753 ; AVX2-LABEL: 'var_ctlz_v32i8u'
754 ; AVX2-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 true)
755 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctlz
757 ; AVX512-LABEL: 'var_ctlz_v32i8u'
758 ; AVX512-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 true)
759 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctlz
761 ; AVX512CD-LABEL: 'var_ctlz_v32i8u'
762 ; 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)
763 ; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctlz
765 %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 1)
769 define <64 x i8> @var_ctlz_v64i8(<64 x i8> %a) {
770 ; SSE2-LABEL: 'var_ctlz_v64i8'
771 ; 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)
772 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctlz
774 ; SSE42-LABEL: 'var_ctlz_v64i8'
775 ; 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)
776 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctlz
778 ; AVX1-LABEL: 'var_ctlz_v64i8'
779 ; 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)
780 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctlz
782 ; AVX2-LABEL: 'var_ctlz_v64i8'
783 ; AVX2-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)
784 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctlz
786 ; AVX512F-LABEL: 'var_ctlz_v64i8'
787 ; 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)
788 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctlz
790 ; AVX512BW-LABEL: 'var_ctlz_v64i8'
791 ; 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)
792 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctlz
794 ; AVX512CD-LABEL: 'var_ctlz_v64i8'
795 ; 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)
796 ; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctlz
798 %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 0)
802 define <64 x i8> @var_ctlz_v64i8u(<64 x i8> %a) {
803 ; SSE2-LABEL: 'var_ctlz_v64i8u'
804 ; 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)
805 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctlz
807 ; SSE42-LABEL: 'var_ctlz_v64i8u'
808 ; 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)
809 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctlz
811 ; AVX1-LABEL: 'var_ctlz_v64i8u'
812 ; 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)
813 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctlz
815 ; AVX2-LABEL: 'var_ctlz_v64i8u'
816 ; AVX2-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)
817 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctlz
819 ; AVX512F-LABEL: 'var_ctlz_v64i8u'
820 ; 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)
821 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctlz
823 ; AVX512BW-LABEL: 'var_ctlz_v64i8u'
824 ; 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)
825 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctlz
827 ; AVX512CD-LABEL: 'var_ctlz_v64i8u'
828 ; 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)
829 ; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctlz
831 %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 1)