xref: /aosp_15_r20/external/llvm/test/Analysis/CostModel/X86/ctbits-cost.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=pentium4 -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=SSE -check-prefix=SSE2
2*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=corei7 -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=SSE -check-prefix=SSE42
3*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=corei7-avx -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=AVX -check-prefix=AVX1
4*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=core-avx2 -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=AVX -check-prefix=AVX2
5*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=bdver2 -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=XOP -check-prefix=XOPAVX1
6*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=bdver4 -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=XOP -check-prefix=XOPAVX2
7*9880d681SAndroid Build Coastguard Worker
8*9880d681SAndroid Build Coastguard Worker; Verify the cost of vector population count instructions.
9*9880d681SAndroid Build Coastguard Worker
10*9880d681SAndroid Build Coastguard Workerdeclare <2 x i64> @llvm.ctpop.v2i64(<2 x i64>)
11*9880d681SAndroid Build Coastguard Workerdeclare <4 x i32> @llvm.ctpop.v4i32(<4 x i32>)
12*9880d681SAndroid Build Coastguard Workerdeclare <8 x i16> @llvm.ctpop.v8i16(<8 x i16>)
13*9880d681SAndroid Build Coastguard Workerdeclare <16 x i8> @llvm.ctpop.v16i8(<16 x i8>)
14*9880d681SAndroid Build Coastguard Worker
15*9880d681SAndroid Build Coastguard Workerdeclare <4 x i64> @llvm.ctpop.v4i64(<4 x i64>)
16*9880d681SAndroid Build Coastguard Workerdeclare <8 x i32> @llvm.ctpop.v8i32(<8 x i32>)
17*9880d681SAndroid Build Coastguard Workerdeclare <16 x i16> @llvm.ctpop.v16i16(<16 x i16>)
18*9880d681SAndroid Build Coastguard Workerdeclare <32 x i8> @llvm.ctpop.v32i8(<32 x i8>)
19*9880d681SAndroid Build Coastguard Worker
20*9880d681SAndroid Build Coastguard Workerdefine <2 x i64> @var_ctpop_v2i64(<2 x i64> %a) {
21*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_ctpop_v2i64':
22*9880d681SAndroid Build Coastguard Worker; SSE: Found an estimated cost of 2 for instruction:   %ctpop
23*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 2 for instruction:   %ctpop
24*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 2 for instruction:   %ctpop
25*9880d681SAndroid Build Coastguard Worker  %ctpop = call <2 x i64> @llvm.ctpop.v2i64(<2 x i64> %a)
26*9880d681SAndroid Build Coastguard Worker  ret <2 x i64> %ctpop
27*9880d681SAndroid Build Coastguard Worker}
28*9880d681SAndroid Build Coastguard Worker
29*9880d681SAndroid Build Coastguard Workerdefine <4 x i64> @var_ctpop_v4i64(<4 x i64> %a) {
30*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_ctpop_v4i64':
31*9880d681SAndroid Build Coastguard Worker; SSE: Found an estimated cost of 4 for instruction:   %ctpop
32*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 2 for instruction:   %ctpop
33*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 2 for instruction:   %ctpop
34*9880d681SAndroid Build Coastguard Worker  %ctpop = call <4 x i64> @llvm.ctpop.v4i64(<4 x i64> %a)
35*9880d681SAndroid Build Coastguard Worker  ret <4 x i64> %ctpop
36*9880d681SAndroid Build Coastguard Worker}
37*9880d681SAndroid Build Coastguard Worker
38*9880d681SAndroid Build Coastguard Workerdefine <4 x i32> @var_ctpop_v4i32(<4 x i32> %a) {
39*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_ctpop_v4i32':
40*9880d681SAndroid Build Coastguard Worker; SSE: Found an estimated cost of 2 for instruction:   %ctpop
41*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 2 for instruction:   %ctpop
42*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 2 for instruction:   %ctpop
43*9880d681SAndroid Build Coastguard Worker  %ctpop = call <4 x i32> @llvm.ctpop.v4i32(<4 x i32> %a)
44*9880d681SAndroid Build Coastguard Worker  ret <4 x i32> %ctpop
45*9880d681SAndroid Build Coastguard Worker}
46*9880d681SAndroid Build Coastguard Worker
47*9880d681SAndroid Build Coastguard Workerdefine <8 x i32> @var_ctpop_v8i32(<8 x i32> %a) {
48*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_ctpop_v8i32':
49*9880d681SAndroid Build Coastguard Worker; SSE: Found an estimated cost of 4 for instruction:   %ctpop
50*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 2 for instruction:   %ctpop
51*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 2 for instruction:   %ctpop
52*9880d681SAndroid Build Coastguard Worker  %ctpop = call <8 x i32> @llvm.ctpop.v8i32(<8 x i32> %a)
53*9880d681SAndroid Build Coastguard Worker  ret <8 x i32> %ctpop
54*9880d681SAndroid Build Coastguard Worker}
55*9880d681SAndroid Build Coastguard Worker
56*9880d681SAndroid Build Coastguard Workerdefine <8 x i16> @var_ctpop_v8i16(<8 x i16> %a) {
57*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_ctpop_v8i16':
58*9880d681SAndroid Build Coastguard Worker; SSE: Found an estimated cost of 2 for instruction:   %ctpop
59*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 2 for instruction:   %ctpop
60*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 2 for instruction:   %ctpop
61*9880d681SAndroid Build Coastguard Worker  %ctpop = call <8 x i16> @llvm.ctpop.v8i16(<8 x i16> %a)
62*9880d681SAndroid Build Coastguard Worker  ret <8 x i16> %ctpop
63*9880d681SAndroid Build Coastguard Worker}
64*9880d681SAndroid Build Coastguard Worker
65*9880d681SAndroid Build Coastguard Workerdefine <16 x i16> @var_ctpop_v16i16(<16 x i16> %a) {
66*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_ctpop_v16i16':
67*9880d681SAndroid Build Coastguard Worker; SSE: Found an estimated cost of 4 for instruction:   %ctpop
68*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 2 for instruction:   %ctpop
69*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 2 for instruction:   %ctpop
70*9880d681SAndroid Build Coastguard Worker  %ctpop = call <16 x i16> @llvm.ctpop.v16i16(<16 x i16> %a)
71*9880d681SAndroid Build Coastguard Worker  ret <16 x i16> %ctpop
72*9880d681SAndroid Build Coastguard Worker}
73*9880d681SAndroid Build Coastguard Worker
74*9880d681SAndroid Build Coastguard Workerdefine <16 x i8> @var_ctpop_v16i8(<16 x i8> %a) {
75*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_ctpop_v16i8':
76*9880d681SAndroid Build Coastguard Worker; SSE: Found an estimated cost of 2 for instruction:   %ctpop
77*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 2 for instruction:   %ctpop
78*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 2 for instruction:   %ctpop
79*9880d681SAndroid Build Coastguard Worker  %ctpop = call <16 x i8> @llvm.ctpop.v16i8(<16 x i8> %a)
80*9880d681SAndroid Build Coastguard Worker  ret <16 x i8> %ctpop
81*9880d681SAndroid Build Coastguard Worker}
82*9880d681SAndroid Build Coastguard Worker
83*9880d681SAndroid Build Coastguard Workerdefine <32 x i8> @var_ctpop_v32i8(<32 x i8> %a) {
84*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_ctpop_v32i8':
85*9880d681SAndroid Build Coastguard Worker; SSE: Found an estimated cost of 4 for instruction:   %ctpop
86*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 2 for instruction:   %ctpop
87*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 2 for instruction:   %ctpop
88*9880d681SAndroid Build Coastguard Worker  %ctpop = call <32 x i8> @llvm.ctpop.v32i8(<32 x i8> %a)
89*9880d681SAndroid Build Coastguard Worker  ret <32 x i8> %ctpop
90*9880d681SAndroid Build Coastguard Worker}
91*9880d681SAndroid Build Coastguard Worker
92*9880d681SAndroid Build Coastguard Worker; Verify the cost of vector leading zero count instructions.
93*9880d681SAndroid Build Coastguard Worker
94*9880d681SAndroid Build Coastguard Workerdeclare <2 x i64> @llvm.ctlz.v2i64(<2 x i64>, i1)
95*9880d681SAndroid Build Coastguard Workerdeclare <4 x i32> @llvm.ctlz.v4i32(<4 x i32>, i1)
96*9880d681SAndroid Build Coastguard Workerdeclare <8 x i16> @llvm.ctlz.v8i16(<8 x i16>, i1)
97*9880d681SAndroid Build Coastguard Workerdeclare <16 x i8> @llvm.ctlz.v16i8(<16 x i8>, i1)
98*9880d681SAndroid Build Coastguard Worker
99*9880d681SAndroid Build Coastguard Workerdeclare <4 x i64> @llvm.ctlz.v4i64(<4 x i64>, i1)
100*9880d681SAndroid Build Coastguard Workerdeclare <8 x i32> @llvm.ctlz.v8i32(<8 x i32>, i1)
101*9880d681SAndroid Build Coastguard Workerdeclare <16 x i16> @llvm.ctlz.v16i16(<16 x i16>, i1)
102*9880d681SAndroid Build Coastguard Workerdeclare <32 x i8> @llvm.ctlz.v32i8(<32 x i8>, i1)
103*9880d681SAndroid Build Coastguard Worker
104*9880d681SAndroid Build Coastguard Workerdefine <2 x i64> @var_ctlz_v2i64(<2 x i64> %a) {
105*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_ctlz_v2i64':
106*9880d681SAndroid Build Coastguard Worker; SSE: Found an estimated cost of 6 for instruction:   %ctlz
107*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 6 for instruction:   %ctlz
108*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 6 for instruction:   %ctlz
109*9880d681SAndroid Build Coastguard Worker  %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 0)
110*9880d681SAndroid Build Coastguard Worker  ret <2 x i64> %ctlz
111*9880d681SAndroid Build Coastguard Worker}
112*9880d681SAndroid Build Coastguard Worker
113*9880d681SAndroid Build Coastguard Workerdefine <2 x i64> @var_ctlz_v2i64u(<2 x i64> %a) {
114*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_ctlz_v2i64u':
115*9880d681SAndroid Build Coastguard Worker; SSE: Found an estimated cost of 6 for instruction:   %ctlz
116*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 6 for instruction:   %ctlz
117*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 6 for instruction:   %ctlz
118*9880d681SAndroid Build Coastguard Worker  %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 1)
119*9880d681SAndroid Build Coastguard Worker  ret <2 x i64> %ctlz
120*9880d681SAndroid Build Coastguard Worker}
121*9880d681SAndroid Build Coastguard Worker
122*9880d681SAndroid Build Coastguard Workerdefine <4 x i64> @var_ctlz_v4i64(<4 x i64> %a) {
123*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_ctlz_v4i64':
124*9880d681SAndroid Build Coastguard Worker; SSE: Found an estimated cost of 12 for instruction:   %ctlz
125*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 12 for instruction:   %ctlz
126*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 12 for instruction:   %ctlz
127*9880d681SAndroid Build Coastguard Worker  %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 0)
128*9880d681SAndroid Build Coastguard Worker  ret <4 x i64> %ctlz
129*9880d681SAndroid Build Coastguard Worker}
130*9880d681SAndroid Build Coastguard Worker
131*9880d681SAndroid Build Coastguard Workerdefine <4 x i64> @var_ctlz_v4i64u(<4 x i64> %a) {
132*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_ctlz_v4i64u':
133*9880d681SAndroid Build Coastguard Worker; SSE: Found an estimated cost of 12 for instruction:   %ctlz
134*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 12 for instruction:   %ctlz
135*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 12 for instruction:   %ctlz
136*9880d681SAndroid Build Coastguard Worker  %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 1)
137*9880d681SAndroid Build Coastguard Worker  ret <4 x i64> %ctlz
138*9880d681SAndroid Build Coastguard Worker}
139*9880d681SAndroid Build Coastguard Worker
140*9880d681SAndroid Build Coastguard Workerdefine <4 x i32> @var_ctlz_v4i32(<4 x i32> %a) {
141*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_ctlz_v4i32':
142*9880d681SAndroid Build Coastguard Worker; SSE: Found an estimated cost of 12 for instruction:   %ctlz
143*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 12 for instruction:   %ctlz
144*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 12 for instruction:   %ctlz
145*9880d681SAndroid Build Coastguard Worker  %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 0)
146*9880d681SAndroid Build Coastguard Worker  ret <4 x i32> %ctlz
147*9880d681SAndroid Build Coastguard Worker}
148*9880d681SAndroid Build Coastguard Worker
149*9880d681SAndroid Build Coastguard Workerdefine <4 x i32> @var_ctlz_v4i32u(<4 x i32> %a) {
150*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_ctlz_v4i32u':
151*9880d681SAndroid Build Coastguard Worker; SSE: Found an estimated cost of 12 for instruction:   %ctlz
152*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 12 for instruction:   %ctlz
153*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 12 for instruction:   %ctlz
154*9880d681SAndroid Build Coastguard Worker  %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 1)
155*9880d681SAndroid Build Coastguard Worker  ret <4 x i32> %ctlz
156*9880d681SAndroid Build Coastguard Worker}
157*9880d681SAndroid Build Coastguard Worker
158*9880d681SAndroid Build Coastguard Workerdefine <8 x i32> @var_ctlz_v8i32(<8 x i32> %a) {
159*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_ctlz_v8i32':
160*9880d681SAndroid Build Coastguard Worker; SSE: Found an estimated cost of 24 for instruction:   %ctlz
161*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 24 for instruction:   %ctlz
162*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 24 for instruction:   %ctlz
163*9880d681SAndroid Build Coastguard Worker  %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 0)
164*9880d681SAndroid Build Coastguard Worker  ret <8 x i32> %ctlz
165*9880d681SAndroid Build Coastguard Worker}
166*9880d681SAndroid Build Coastguard Worker
167*9880d681SAndroid Build Coastguard Workerdefine <8 x i32> @var_ctlz_v8i32u(<8 x i32> %a) {
168*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_ctlz_v8i32u':
169*9880d681SAndroid Build Coastguard Worker; SSE: Found an estimated cost of 24 for instruction:   %ctlz
170*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 24 for instruction:   %ctlz
171*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 24 for instruction:   %ctlz
172*9880d681SAndroid Build Coastguard Worker  %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 1)
173*9880d681SAndroid Build Coastguard Worker  ret <8 x i32> %ctlz
174*9880d681SAndroid Build Coastguard Worker}
175*9880d681SAndroid Build Coastguard Worker
176*9880d681SAndroid Build Coastguard Workerdefine <8 x i16> @var_ctlz_v8i16(<8 x i16> %a) {
177*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_ctlz_v8i16':
178*9880d681SAndroid Build Coastguard Worker; SSE: Found an estimated cost of 24 for instruction:   %ctlz
179*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 24 for instruction:   %ctlz
180*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 24 for instruction:   %ctlz
181*9880d681SAndroid Build Coastguard Worker  %ctlz = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> %a, i1 0)
182*9880d681SAndroid Build Coastguard Worker  ret <8 x i16> %ctlz
183*9880d681SAndroid Build Coastguard Worker}
184*9880d681SAndroid Build Coastguard Worker
185*9880d681SAndroid Build Coastguard Workerdefine <8 x i16> @var_ctlz_v8i16u(<8 x i16> %a) {
186*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_ctlz_v8i16u':
187*9880d681SAndroid Build Coastguard Worker; SSE: Found an estimated cost of 24 for instruction:   %ctlz
188*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 24 for instruction:   %ctlz
189*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 24 for instruction:   %ctlz
190*9880d681SAndroid Build Coastguard Worker  %ctlz = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> %a, i1 1)
191*9880d681SAndroid Build Coastguard Worker  ret <8 x i16> %ctlz
192*9880d681SAndroid Build Coastguard Worker}
193*9880d681SAndroid Build Coastguard Worker
194*9880d681SAndroid Build Coastguard Workerdefine <16 x i16> @var_ctlz_v16i16(<16 x i16> %a) {
195*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_ctlz_v16i16':
196*9880d681SAndroid Build Coastguard Worker; SSE: Found an estimated cost of 48 for instruction:   %ctlz
197*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 48 for instruction:   %ctlz
198*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 48 for instruction:   %ctlz
199*9880d681SAndroid Build Coastguard Worker  %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 0)
200*9880d681SAndroid Build Coastguard Worker  ret <16 x i16> %ctlz
201*9880d681SAndroid Build Coastguard Worker}
202*9880d681SAndroid Build Coastguard Worker
203*9880d681SAndroid Build Coastguard Workerdefine <16 x i16> @var_ctlz_v16i16u(<16 x i16> %a) {
204*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_ctlz_v16i16u':
205*9880d681SAndroid Build Coastguard Worker; SSE: Found an estimated cost of 48 for instruction:   %ctlz
206*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 48 for instruction:   %ctlz
207*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 48 for instruction:   %ctlz
208*9880d681SAndroid Build Coastguard Worker  %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 1)
209*9880d681SAndroid Build Coastguard Worker  ret <16 x i16> %ctlz
210*9880d681SAndroid Build Coastguard Worker}
211*9880d681SAndroid Build Coastguard Worker
212*9880d681SAndroid Build Coastguard Workerdefine <16 x i8> @var_ctlz_v16i8(<16 x i8> %a) {
213*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_ctlz_v16i8':
214*9880d681SAndroid Build Coastguard Worker; SSE: Found an estimated cost of 48 for instruction:   %ctlz
215*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 48 for instruction:   %ctlz
216*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 48 for instruction:   %ctlz
217*9880d681SAndroid Build Coastguard Worker  %ctlz = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %a, i1 0)
218*9880d681SAndroid Build Coastguard Worker  ret <16 x i8> %ctlz
219*9880d681SAndroid Build Coastguard Worker}
220*9880d681SAndroid Build Coastguard Worker
221*9880d681SAndroid Build Coastguard Workerdefine <16 x i8> @var_ctlz_v16i8u(<16 x i8> %a) {
222*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_ctlz_v16i8u':
223*9880d681SAndroid Build Coastguard Worker; SSE: Found an estimated cost of 48 for instruction:   %ctlz
224*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 48 for instruction:   %ctlz
225*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 48 for instruction:   %ctlz
226*9880d681SAndroid Build Coastguard Worker  %ctlz = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %a, i1 1)
227*9880d681SAndroid Build Coastguard Worker  ret <16 x i8> %ctlz
228*9880d681SAndroid Build Coastguard Worker}
229*9880d681SAndroid Build Coastguard Worker
230*9880d681SAndroid Build Coastguard Workerdefine <32 x i8> @var_ctlz_v32i8(<32 x i8> %a) {
231*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_ctlz_v32i8':
232*9880d681SAndroid Build Coastguard Worker; SSE: Found an estimated cost of 96 for instruction:   %ctlz
233*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 96 for instruction:   %ctlz
234*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 96 for instruction:   %ctlz
235*9880d681SAndroid Build Coastguard Worker  %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 0)
236*9880d681SAndroid Build Coastguard Worker  ret <32 x i8> %ctlz
237*9880d681SAndroid Build Coastguard Worker}
238*9880d681SAndroid Build Coastguard Worker
239*9880d681SAndroid Build Coastguard Workerdefine <32 x i8> @var_ctlz_v32i8u(<32 x i8> %a) {
240*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_ctlz_v32i8u':
241*9880d681SAndroid Build Coastguard Worker; SSE: Found an estimated cost of 96 for instruction:   %ctlz
242*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 96 for instruction:   %ctlz
243*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 96 for instruction:   %ctlz
244*9880d681SAndroid Build Coastguard Worker  %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 1)
245*9880d681SAndroid Build Coastguard Worker  ret <32 x i8> %ctlz
246*9880d681SAndroid Build Coastguard Worker}
247*9880d681SAndroid Build Coastguard Worker
248*9880d681SAndroid Build Coastguard Worker; Verify the cost of vector trailing zero count instructions.
249*9880d681SAndroid Build Coastguard Worker
250*9880d681SAndroid Build Coastguard Workerdeclare <2 x i64> @llvm.cttz.v2i64(<2 x i64>, i1)
251*9880d681SAndroid Build Coastguard Workerdeclare <4 x i32> @llvm.cttz.v4i32(<4 x i32>, i1)
252*9880d681SAndroid Build Coastguard Workerdeclare <8 x i16> @llvm.cttz.v8i16(<8 x i16>, i1)
253*9880d681SAndroid Build Coastguard Workerdeclare <16 x i8> @llvm.cttz.v16i8(<16 x i8>, i1)
254*9880d681SAndroid Build Coastguard Worker
255*9880d681SAndroid Build Coastguard Workerdeclare <4 x i64> @llvm.cttz.v4i64(<4 x i64>, i1)
256*9880d681SAndroid Build Coastguard Workerdeclare <8 x i32> @llvm.cttz.v8i32(<8 x i32>, i1)
257*9880d681SAndroid Build Coastguard Workerdeclare <16 x i16> @llvm.cttz.v16i16(<16 x i16>, i1)
258*9880d681SAndroid Build Coastguard Workerdeclare <32 x i8> @llvm.cttz.v32i8(<32 x i8>, i1)
259*9880d681SAndroid Build Coastguard Worker
260*9880d681SAndroid Build Coastguard Workerdefine <2 x i64> @var_cttz_v2i64(<2 x i64> %a) {
261*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_cttz_v2i64':
262*9880d681SAndroid Build Coastguard Worker; SSE: Found an estimated cost of 6 for instruction:   %cttz
263*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 6 for instruction:   %cttz
264*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 6 for instruction:   %cttz
265*9880d681SAndroid Build Coastguard Worker  %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 0)
266*9880d681SAndroid Build Coastguard Worker  ret <2 x i64> %cttz
267*9880d681SAndroid Build Coastguard Worker}
268*9880d681SAndroid Build Coastguard Worker
269*9880d681SAndroid Build Coastguard Workerdefine <2 x i64> @var_cttz_v2i64u(<2 x i64> %a) {
270*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_cttz_v2i64u':
271*9880d681SAndroid Build Coastguard Worker; SSE: Found an estimated cost of 6 for instruction:   %cttz
272*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 6 for instruction:   %cttz
273*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 6 for instruction:   %cttz
274*9880d681SAndroid Build Coastguard Worker  %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 1)
275*9880d681SAndroid Build Coastguard Worker  ret <2 x i64> %cttz
276*9880d681SAndroid Build Coastguard Worker}
277*9880d681SAndroid Build Coastguard Worker
278*9880d681SAndroid Build Coastguard Workerdefine <4 x i64> @var_cttz_v4i64(<4 x i64> %a) {
279*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_cttz_v4i64':
280*9880d681SAndroid Build Coastguard Worker; SSE: Found an estimated cost of 12 for instruction:   %cttz
281*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 12 for instruction:   %cttz
282*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 12 for instruction:   %cttz
283*9880d681SAndroid Build Coastguard Worker  %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 0)
284*9880d681SAndroid Build Coastguard Worker  ret <4 x i64> %cttz
285*9880d681SAndroid Build Coastguard Worker}
286*9880d681SAndroid Build Coastguard Worker
287*9880d681SAndroid Build Coastguard Workerdefine <4 x i64> @var_cttz_v4i64u(<4 x i64> %a) {
288*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_cttz_v4i64u':
289*9880d681SAndroid Build Coastguard Worker; SSE: Found an estimated cost of 12 for instruction:   %cttz
290*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 12 for instruction:   %cttz
291*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 12 for instruction:   %cttz
292*9880d681SAndroid Build Coastguard Worker  %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 1)
293*9880d681SAndroid Build Coastguard Worker  ret <4 x i64> %cttz
294*9880d681SAndroid Build Coastguard Worker}
295*9880d681SAndroid Build Coastguard Worker
296*9880d681SAndroid Build Coastguard Workerdefine <4 x i32> @var_cttz_v4i32(<4 x i32> %a) {
297*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_cttz_v4i32':
298*9880d681SAndroid Build Coastguard Worker; SSE: Found an estimated cost of 12 for instruction:   %cttz
299*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 12 for instruction:   %cttz
300*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 12 for instruction:   %cttz
301*9880d681SAndroid Build Coastguard Worker  %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 0)
302*9880d681SAndroid Build Coastguard Worker  ret <4 x i32> %cttz
303*9880d681SAndroid Build Coastguard Worker}
304*9880d681SAndroid Build Coastguard Worker
305*9880d681SAndroid Build Coastguard Workerdefine <4 x i32> @var_cttz_v4i32u(<4 x i32> %a) {
306*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_cttz_v4i32u':
307*9880d681SAndroid Build Coastguard Worker; SSE: Found an estimated cost of 12 for instruction:   %cttz
308*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 12 for instruction:   %cttz
309*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 12 for instruction:   %cttz
310*9880d681SAndroid Build Coastguard Worker  %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 1)
311*9880d681SAndroid Build Coastguard Worker  ret <4 x i32> %cttz
312*9880d681SAndroid Build Coastguard Worker}
313*9880d681SAndroid Build Coastguard Worker
314*9880d681SAndroid Build Coastguard Workerdefine <8 x i32> @var_cttz_v8i32(<8 x i32> %a) {
315*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_cttz_v8i32':
316*9880d681SAndroid Build Coastguard Worker; SSE: Found an estimated cost of 24 for instruction:   %cttz
317*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 24 for instruction:   %cttz
318*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 24 for instruction:   %cttz
319*9880d681SAndroid Build Coastguard Worker  %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 0)
320*9880d681SAndroid Build Coastguard Worker  ret <8 x i32> %cttz
321*9880d681SAndroid Build Coastguard Worker}
322*9880d681SAndroid Build Coastguard Worker
323*9880d681SAndroid Build Coastguard Workerdefine <8 x i32> @var_cttz_v8i32u(<8 x i32> %a) {
324*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_cttz_v8i32u':
325*9880d681SAndroid Build Coastguard Worker; SSE: Found an estimated cost of 24 for instruction:   %cttz
326*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 24 for instruction:   %cttz
327*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 24 for instruction:   %cttz
328*9880d681SAndroid Build Coastguard Worker  %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 1)
329*9880d681SAndroid Build Coastguard Worker  ret <8 x i32> %cttz
330*9880d681SAndroid Build Coastguard Worker}
331*9880d681SAndroid Build Coastguard Worker
332*9880d681SAndroid Build Coastguard Workerdefine <8 x i16> @var_cttz_v8i16(<8 x i16> %a) {
333*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_cttz_v8i16':
334*9880d681SAndroid Build Coastguard Worker; SSE: Found an estimated cost of 24 for instruction:   %cttz
335*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 24 for instruction:   %cttz
336*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 24 for instruction:   %cttz
337*9880d681SAndroid Build Coastguard Worker  %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 0)
338*9880d681SAndroid Build Coastguard Worker  ret <8 x i16> %cttz
339*9880d681SAndroid Build Coastguard Worker}
340*9880d681SAndroid Build Coastguard Worker
341*9880d681SAndroid Build Coastguard Workerdefine <8 x i16> @var_cttz_v8i16u(<8 x i16> %a) {
342*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_cttz_v8i16u':
343*9880d681SAndroid Build Coastguard Worker; SSE: Found an estimated cost of 24 for instruction:   %cttz
344*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 24 for instruction:   %cttz
345*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 24 for instruction:   %cttz
346*9880d681SAndroid Build Coastguard Worker  %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 1)
347*9880d681SAndroid Build Coastguard Worker  ret <8 x i16> %cttz
348*9880d681SAndroid Build Coastguard Worker}
349*9880d681SAndroid Build Coastguard Worker
350*9880d681SAndroid Build Coastguard Workerdefine <16 x i16> @var_cttz_v16i16(<16 x i16> %a) {
351*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_cttz_v16i16':
352*9880d681SAndroid Build Coastguard Worker; SSE: Found an estimated cost of 48 for instruction:   %cttz
353*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 48 for instruction:   %cttz
354*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 48 for instruction:   %cttz
355*9880d681SAndroid Build Coastguard Worker  %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 0)
356*9880d681SAndroid Build Coastguard Worker  ret <16 x i16> %cttz
357*9880d681SAndroid Build Coastguard Worker}
358*9880d681SAndroid Build Coastguard Worker
359*9880d681SAndroid Build Coastguard Workerdefine <16 x i16> @var_cttz_v16i16u(<16 x i16> %a) {
360*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_cttz_v16i16u':
361*9880d681SAndroid Build Coastguard Worker; SSE: Found an estimated cost of 48 for instruction:   %cttz
362*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 48 for instruction:   %cttz
363*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 48 for instruction:   %cttz
364*9880d681SAndroid Build Coastguard Worker  %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 1)
365*9880d681SAndroid Build Coastguard Worker  ret <16 x i16> %cttz
366*9880d681SAndroid Build Coastguard Worker}
367*9880d681SAndroid Build Coastguard Worker
368*9880d681SAndroid Build Coastguard Workerdefine <16 x i8> @var_cttz_v16i8(<16 x i8> %a) {
369*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_cttz_v16i8':
370*9880d681SAndroid Build Coastguard Worker; SSE: Found an estimated cost of 48 for instruction:   %cttz
371*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 48 for instruction:   %cttz
372*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 48 for instruction:   %cttz
373*9880d681SAndroid Build Coastguard Worker  %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 0)
374*9880d681SAndroid Build Coastguard Worker  ret <16 x i8> %cttz
375*9880d681SAndroid Build Coastguard Worker}
376*9880d681SAndroid Build Coastguard Worker
377*9880d681SAndroid Build Coastguard Workerdefine <16 x i8> @var_cttz_v16i8u(<16 x i8> %a) {
378*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_cttz_v16i8u':
379*9880d681SAndroid Build Coastguard Worker; SSE: Found an estimated cost of 48 for instruction:   %cttz
380*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 48 for instruction:   %cttz
381*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 48 for instruction:   %cttz
382*9880d681SAndroid Build Coastguard Worker  %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 1)
383*9880d681SAndroid Build Coastguard Worker  ret <16 x i8> %cttz
384*9880d681SAndroid Build Coastguard Worker}
385*9880d681SAndroid Build Coastguard Worker
386*9880d681SAndroid Build Coastguard Workerdefine <32 x i8> @var_cttz_v32i8(<32 x i8> %a) {
387*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_cttz_v32i8':
388*9880d681SAndroid Build Coastguard Worker; SSE: Found an estimated cost of 96 for instruction:   %cttz
389*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 96 for instruction:   %cttz
390*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 96 for instruction:   %cttz
391*9880d681SAndroid Build Coastguard Worker  %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 0)
392*9880d681SAndroid Build Coastguard Worker  ret <32 x i8> %cttz
393*9880d681SAndroid Build Coastguard Worker}
394*9880d681SAndroid Build Coastguard Worker
395*9880d681SAndroid Build Coastguard Workerdefine <32 x i8> @var_cttz_v32i8u(<32 x i8> %a) {
396*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_cttz_v32i8u':
397*9880d681SAndroid Build Coastguard Worker; SSE: Found an estimated cost of 96 for instruction:   %cttz
398*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 96 for instruction:   %cttz
399*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 96 for instruction:   %cttz
400*9880d681SAndroid Build Coastguard Worker  %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 1)
401*9880d681SAndroid Build Coastguard Worker  ret <32 x i8> %cttz
402*9880d681SAndroid Build Coastguard Worker}
403