1 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2 ; RUN: opt < %s -mtriple=i686-unknown-linux-gnu -cost-model -analyze -mattr=+sse2 | FileCheck %s -check-prefixes=CHECK,X86,SSE,SSE2
3 ; RUN: opt < %s -mtriple=i686-unknown-linux-gnu -cost-model -analyze -mattr=+sse4.2 | FileCheck %s -check-prefixes=CHECK,X86,SSE,SSE42
4 ; RUN: opt < %s -mtriple=i686-unknown-linux-gnu -cost-model -analyze -mattr=+avx | FileCheck %s -check-prefixes=CHECK,X86,AVX,AVX1
5 ; RUN: opt < %s -mtriple=i686-unknown-linux-gnu -cost-model -analyze -mattr=+avx2 | FileCheck %s -check-prefixes=CHECK,X86,AVX,AVX2
6 ; RUN: opt < %s -mtriple=i686-unknown-linux-gnu -cost-model -analyze -mattr=+avx512f | FileCheck %s -check-prefixes=CHECK,X86,AVX512,AVX512F
7 ; RUN: opt < %s -mtriple=i686-unknown-linux-gnu -cost-model -analyze -mattr=+avx512vl,avx512bw,avx512dq | FileCheck %s -check-prefixes=CHECK,X86,AVX512,AVX512BW
8 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+sse2 | FileCheck %s -check-prefixes=CHECK,X64,SSE,SSE2
9 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+sse4.2 | FileCheck %s -check-prefixes=CHECK,X64,SSE,SSE42
10 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+avx | FileCheck %s -check-prefixes=CHECK,X64,AVX,AVX1
11 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+avx2 | FileCheck %s -check-prefixes=CHECK,X64,AVX,AVX2
12 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+avx512f | FileCheck %s -check-prefixes=CHECK,X64,AVX512,AVX512F
13 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+avx512vl,+avx512bw,+avx512dq | FileCheck %s -check-prefixes=CHECK,X64,AVX512,AVX512BW
14 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+xop | FileCheck %s -check-prefixes=CHECK,XOP,XOPAVX
15 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+xop,+avx2 | FileCheck %s -check-prefixes=CHECK,XOP,XOPAVX2
17 ; Verify the cost of scalar bitreverse instructions.
19 declare i64 @llvm.bitreverse.i64(i64)
20 declare i32 @llvm.bitreverse.i32(i32)
21 declare i16 @llvm.bitreverse.i16(i16)
22 declare i8 @llvm.bitreverse.i8(i8)
24 define i64 @var_bitreverse_i64(i64 %a) {
25 ; X86-LABEL: 'var_bitreverse_i64'
26 ; X86-NEXT: Cost Model: Found an estimated cost of 28 for instruction: %bitreverse = call i64 @llvm.bitreverse.i64(i64 %a)
27 ; X86-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i64 %bitreverse
29 ; X64-LABEL: 'var_bitreverse_i64'
30 ; X64-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %bitreverse = call i64 @llvm.bitreverse.i64(i64 %a)
31 ; X64-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i64 %bitreverse
33 ; XOP-LABEL: 'var_bitreverse_i64'
34 ; XOP-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %bitreverse = call i64 @llvm.bitreverse.i64(i64 %a)
35 ; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i64 %bitreverse
37 %bitreverse = call i64 @llvm.bitreverse.i64(i64 %a)
41 define i32 @var_bitreverse_i32(i32 %a) {
42 ; X86-LABEL: 'var_bitreverse_i32'
43 ; X86-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %bitreverse = call i32 @llvm.bitreverse.i32(i32 %a)
44 ; X86-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 %bitreverse
46 ; X64-LABEL: 'var_bitreverse_i32'
47 ; X64-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %bitreverse = call i32 @llvm.bitreverse.i32(i32 %a)
48 ; X64-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 %bitreverse
50 ; XOP-LABEL: 'var_bitreverse_i32'
51 ; XOP-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %bitreverse = call i32 @llvm.bitreverse.i32(i32 %a)
52 ; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 %bitreverse
54 %bitreverse = call i32 @llvm.bitreverse.i32(i32 %a)
58 define i16 @var_bitreverse_i16(i16 %a) {
59 ; X86-LABEL: 'var_bitreverse_i16'
60 ; X86-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %bitreverse = call i16 @llvm.bitreverse.i16(i16 %a)
61 ; X86-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i16 %bitreverse
63 ; X64-LABEL: 'var_bitreverse_i16'
64 ; X64-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %bitreverse = call i16 @llvm.bitreverse.i16(i16 %a)
65 ; X64-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i16 %bitreverse
67 ; XOP-LABEL: 'var_bitreverse_i16'
68 ; XOP-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %bitreverse = call i16 @llvm.bitreverse.i16(i16 %a)
69 ; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i16 %bitreverse
71 %bitreverse = call i16 @llvm.bitreverse.i16(i16 %a)
75 define i8 @var_bitreverse_i8(i8 %a) {
76 ; X86-LABEL: 'var_bitreverse_i8'
77 ; X86-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %bitreverse = call i8 @llvm.bitreverse.i8(i8 %a)
78 ; X86-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i8 %bitreverse
80 ; X64-LABEL: 'var_bitreverse_i8'
81 ; X64-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %bitreverse = call i8 @llvm.bitreverse.i8(i8 %a)
82 ; X64-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i8 %bitreverse
84 ; XOP-LABEL: 'var_bitreverse_i8'
85 ; XOP-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %bitreverse = call i8 @llvm.bitreverse.i8(i8 %a)
86 ; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i8 %bitreverse
88 %bitreverse = call i8 @llvm.bitreverse.i8(i8 %a)
92 ; Verify the cost of vector bitreverse instructions.
94 declare <2 x i64> @llvm.bitreverse.v2i64(<2 x i64>)
95 declare <4 x i32> @llvm.bitreverse.v4i32(<4 x i32>)
96 declare <8 x i16> @llvm.bitreverse.v8i16(<8 x i16>)
97 declare <16 x i8> @llvm.bitreverse.v16i8(<16 x i8>)
99 declare <4 x i64> @llvm.bitreverse.v4i64(<4 x i64>)
100 declare <8 x i32> @llvm.bitreverse.v8i32(<8 x i32>)
101 declare <16 x i16> @llvm.bitreverse.v16i16(<16 x i16>)
102 declare <32 x i8> @llvm.bitreverse.v32i8(<32 x i8>)
104 declare <8 x i64> @llvm.bitreverse.v8i64(<8 x i64>)
105 declare <16 x i32> @llvm.bitreverse.v16i32(<16 x i32>)
106 declare <32 x i16> @llvm.bitreverse.v32i16(<32 x i16>)
107 declare <64 x i8> @llvm.bitreverse.v64i8(<64 x i8>)
109 define <2 x i64> @var_bitreverse_v2i64(<2 x i64> %a) {
110 ; SSE2-LABEL: 'var_bitreverse_v2i64'
111 ; SSE2-NEXT: Cost Model: Found an estimated cost of 29 for instruction: %bitreverse = call <2 x i64> @llvm.bitreverse.v2i64(<2 x i64> %a)
112 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %bitreverse
114 ; SSE42-LABEL: 'var_bitreverse_v2i64'
115 ; SSE42-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %bitreverse = call <2 x i64> @llvm.bitreverse.v2i64(<2 x i64> %a)
116 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %bitreverse
118 ; AVX-LABEL: 'var_bitreverse_v2i64'
119 ; AVX-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %bitreverse = call <2 x i64> @llvm.bitreverse.v2i64(<2 x i64> %a)
120 ; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %bitreverse
122 ; AVX512-LABEL: 'var_bitreverse_v2i64'
123 ; AVX512-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %bitreverse = call <2 x i64> @llvm.bitreverse.v2i64(<2 x i64> %a)
124 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %bitreverse
126 ; XOP-LABEL: 'var_bitreverse_v2i64'
127 ; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %bitreverse = call <2 x i64> @llvm.bitreverse.v2i64(<2 x i64> %a)
128 ; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %bitreverse
130 %bitreverse = call <2 x i64> @llvm.bitreverse.v2i64(<2 x i64> %a)
131 ret <2 x i64> %bitreverse
134 define <4 x i64> @var_bitreverse_v4i64(<4 x i64> %a) {
135 ; SSE2-LABEL: 'var_bitreverse_v4i64'
136 ; SSE2-NEXT: Cost Model: Found an estimated cost of 58 for instruction: %bitreverse = call <4 x i64> @llvm.bitreverse.v4i64(<4 x i64> %a)
137 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %bitreverse
139 ; SSE42-LABEL: 'var_bitreverse_v4i64'
140 ; SSE42-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %bitreverse = call <4 x i64> @llvm.bitreverse.v4i64(<4 x i64> %a)
141 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %bitreverse
143 ; AVX1-LABEL: 'var_bitreverse_v4i64'
144 ; AVX1-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %bitreverse = call <4 x i64> @llvm.bitreverse.v4i64(<4 x i64> %a)
145 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %bitreverse
147 ; AVX2-LABEL: 'var_bitreverse_v4i64'
148 ; AVX2-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %bitreverse = call <4 x i64> @llvm.bitreverse.v4i64(<4 x i64> %a)
149 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %bitreverse
151 ; AVX512-LABEL: 'var_bitreverse_v4i64'
152 ; AVX512-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %bitreverse = call <4 x i64> @llvm.bitreverse.v4i64(<4 x i64> %a)
153 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %bitreverse
155 ; XOP-LABEL: 'var_bitreverse_v4i64'
156 ; XOP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %bitreverse = call <4 x i64> @llvm.bitreverse.v4i64(<4 x i64> %a)
157 ; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %bitreverse
159 %bitreverse = call <4 x i64> @llvm.bitreverse.v4i64(<4 x i64> %a)
160 ret <4 x i64> %bitreverse
163 define <8 x i64> @var_bitreverse_v8i64(<8 x i64> %a) {
164 ; SSE2-LABEL: 'var_bitreverse_v8i64'
165 ; SSE2-NEXT: Cost Model: Found an estimated cost of 116 for instruction: %bitreverse = call <8 x i64> @llvm.bitreverse.v8i64(<8 x i64> %a)
166 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %bitreverse
168 ; SSE42-LABEL: 'var_bitreverse_v8i64'
169 ; SSE42-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %bitreverse = call <8 x i64> @llvm.bitreverse.v8i64(<8 x i64> %a)
170 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %bitreverse
172 ; AVX1-LABEL: 'var_bitreverse_v8i64'
173 ; AVX1-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %bitreverse = call <8 x i64> @llvm.bitreverse.v8i64(<8 x i64> %a)
174 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %bitreverse
176 ; AVX2-LABEL: 'var_bitreverse_v8i64'
177 ; AVX2-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %bitreverse = call <8 x i64> @llvm.bitreverse.v8i64(<8 x i64> %a)
178 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %bitreverse
180 ; AVX512F-LABEL: 'var_bitreverse_v8i64'
181 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 36 for instruction: %bitreverse = call <8 x i64> @llvm.bitreverse.v8i64(<8 x i64> %a)
182 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %bitreverse
184 ; AVX512BW-LABEL: 'var_bitreverse_v8i64'
185 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %bitreverse = call <8 x i64> @llvm.bitreverse.v8i64(<8 x i64> %a)
186 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %bitreverse
188 ; XOP-LABEL: 'var_bitreverse_v8i64'
189 ; XOP-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %bitreverse = call <8 x i64> @llvm.bitreverse.v8i64(<8 x i64> %a)
190 ; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %bitreverse
192 %bitreverse = call <8 x i64> @llvm.bitreverse.v8i64(<8 x i64> %a)
193 ret <8 x i64> %bitreverse
196 define <4 x i32> @var_bitreverse_v4i32(<4 x i32> %a) {
197 ; SSE2-LABEL: 'var_bitreverse_v4i32'
198 ; SSE2-NEXT: Cost Model: Found an estimated cost of 27 for instruction: %bitreverse = call <4 x i32> @llvm.bitreverse.v4i32(<4 x i32> %a)
199 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %bitreverse
201 ; SSE42-LABEL: 'var_bitreverse_v4i32'
202 ; SSE42-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %bitreverse = call <4 x i32> @llvm.bitreverse.v4i32(<4 x i32> %a)
203 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %bitreverse
205 ; AVX-LABEL: 'var_bitreverse_v4i32'
206 ; AVX-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %bitreverse = call <4 x i32> @llvm.bitreverse.v4i32(<4 x i32> %a)
207 ; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %bitreverse
209 ; AVX512-LABEL: 'var_bitreverse_v4i32'
210 ; AVX512-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %bitreverse = call <4 x i32> @llvm.bitreverse.v4i32(<4 x i32> %a)
211 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %bitreverse
213 ; XOP-LABEL: 'var_bitreverse_v4i32'
214 ; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %bitreverse = call <4 x i32> @llvm.bitreverse.v4i32(<4 x i32> %a)
215 ; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %bitreverse
217 %bitreverse = call <4 x i32> @llvm.bitreverse.v4i32(<4 x i32> %a)
218 ret <4 x i32> %bitreverse
221 define <8 x i32> @var_bitreverse_v8i32(<8 x i32> %a) {
222 ; SSE2-LABEL: 'var_bitreverse_v8i32'
223 ; SSE2-NEXT: Cost Model: Found an estimated cost of 54 for instruction: %bitreverse = call <8 x i32> @llvm.bitreverse.v8i32(<8 x i32> %a)
224 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %bitreverse
226 ; SSE42-LABEL: 'var_bitreverse_v8i32'
227 ; SSE42-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %bitreverse = call <8 x i32> @llvm.bitreverse.v8i32(<8 x i32> %a)
228 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %bitreverse
230 ; AVX1-LABEL: 'var_bitreverse_v8i32'
231 ; AVX1-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %bitreverse = call <8 x i32> @llvm.bitreverse.v8i32(<8 x i32> %a)
232 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %bitreverse
234 ; AVX2-LABEL: 'var_bitreverse_v8i32'
235 ; AVX2-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %bitreverse = call <8 x i32> @llvm.bitreverse.v8i32(<8 x i32> %a)
236 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %bitreverse
238 ; AVX512-LABEL: 'var_bitreverse_v8i32'
239 ; AVX512-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %bitreverse = call <8 x i32> @llvm.bitreverse.v8i32(<8 x i32> %a)
240 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %bitreverse
242 ; XOP-LABEL: 'var_bitreverse_v8i32'
243 ; XOP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %bitreverse = call <8 x i32> @llvm.bitreverse.v8i32(<8 x i32> %a)
244 ; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %bitreverse
246 %bitreverse = call <8 x i32> @llvm.bitreverse.v8i32(<8 x i32> %a)
247 ret <8 x i32> %bitreverse
250 define <16 x i32> @var_bitreverse_v16i32(<16 x i32> %a) {
251 ; SSE2-LABEL: 'var_bitreverse_v16i32'
252 ; SSE2-NEXT: Cost Model: Found an estimated cost of 108 for instruction: %bitreverse = call <16 x i32> @llvm.bitreverse.v16i32(<16 x i32> %a)
253 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %bitreverse
255 ; SSE42-LABEL: 'var_bitreverse_v16i32'
256 ; SSE42-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %bitreverse = call <16 x i32> @llvm.bitreverse.v16i32(<16 x i32> %a)
257 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %bitreverse
259 ; AVX1-LABEL: 'var_bitreverse_v16i32'
260 ; AVX1-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %bitreverse = call <16 x i32> @llvm.bitreverse.v16i32(<16 x i32> %a)
261 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %bitreverse
263 ; AVX2-LABEL: 'var_bitreverse_v16i32'
264 ; AVX2-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %bitreverse = call <16 x i32> @llvm.bitreverse.v16i32(<16 x i32> %a)
265 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %bitreverse
267 ; AVX512F-LABEL: 'var_bitreverse_v16i32'
268 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %bitreverse = call <16 x i32> @llvm.bitreverse.v16i32(<16 x i32> %a)
269 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %bitreverse
271 ; AVX512BW-LABEL: 'var_bitreverse_v16i32'
272 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %bitreverse = call <16 x i32> @llvm.bitreverse.v16i32(<16 x i32> %a)
273 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %bitreverse
275 ; XOP-LABEL: 'var_bitreverse_v16i32'
276 ; XOP-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %bitreverse = call <16 x i32> @llvm.bitreverse.v16i32(<16 x i32> %a)
277 ; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %bitreverse
279 %bitreverse = call <16 x i32> @llvm.bitreverse.v16i32(<16 x i32> %a)
280 ret <16 x i32> %bitreverse
283 define <8 x i16> @var_bitreverse_v8i16(<8 x i16> %a) {
284 ; SSE2-LABEL: 'var_bitreverse_v8i16'
285 ; SSE2-NEXT: Cost Model: Found an estimated cost of 27 for instruction: %bitreverse = call <8 x i16> @llvm.bitreverse.v8i16(<8 x i16> %a)
286 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %bitreverse
288 ; SSE42-LABEL: 'var_bitreverse_v8i16'
289 ; SSE42-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %bitreverse = call <8 x i16> @llvm.bitreverse.v8i16(<8 x i16> %a)
290 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %bitreverse
292 ; AVX-LABEL: 'var_bitreverse_v8i16'
293 ; AVX-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %bitreverse = call <8 x i16> @llvm.bitreverse.v8i16(<8 x i16> %a)
294 ; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %bitreverse
296 ; AVX512-LABEL: 'var_bitreverse_v8i16'
297 ; AVX512-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %bitreverse = call <8 x i16> @llvm.bitreverse.v8i16(<8 x i16> %a)
298 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %bitreverse
300 ; XOP-LABEL: 'var_bitreverse_v8i16'
301 ; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %bitreverse = call <8 x i16> @llvm.bitreverse.v8i16(<8 x i16> %a)
302 ; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %bitreverse
304 %bitreverse = call <8 x i16> @llvm.bitreverse.v8i16(<8 x i16> %a)
305 ret <8 x i16> %bitreverse
308 define <16 x i16> @var_bitreverse_v16i16(<16 x i16> %a) {
309 ; SSE2-LABEL: 'var_bitreverse_v16i16'
310 ; SSE2-NEXT: Cost Model: Found an estimated cost of 54 for instruction: %bitreverse = call <16 x i16> @llvm.bitreverse.v16i16(<16 x i16> %a)
311 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %bitreverse
313 ; SSE42-LABEL: 'var_bitreverse_v16i16'
314 ; SSE42-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %bitreverse = call <16 x i16> @llvm.bitreverse.v16i16(<16 x i16> %a)
315 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %bitreverse
317 ; AVX1-LABEL: 'var_bitreverse_v16i16'
318 ; AVX1-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %bitreverse = call <16 x i16> @llvm.bitreverse.v16i16(<16 x i16> %a)
319 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %bitreverse
321 ; AVX2-LABEL: 'var_bitreverse_v16i16'
322 ; AVX2-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %bitreverse = call <16 x i16> @llvm.bitreverse.v16i16(<16 x i16> %a)
323 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %bitreverse
325 ; AVX512-LABEL: 'var_bitreverse_v16i16'
326 ; AVX512-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %bitreverse = call <16 x i16> @llvm.bitreverse.v16i16(<16 x i16> %a)
327 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %bitreverse
329 ; XOP-LABEL: 'var_bitreverse_v16i16'
330 ; XOP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %bitreverse = call <16 x i16> @llvm.bitreverse.v16i16(<16 x i16> %a)
331 ; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %bitreverse
333 %bitreverse = call <16 x i16> @llvm.bitreverse.v16i16(<16 x i16> %a)
334 ret <16 x i16> %bitreverse
337 define <32 x i16> @var_bitreverse_v32i16(<32 x i16> %a) {
338 ; SSE2-LABEL: 'var_bitreverse_v32i16'
339 ; SSE2-NEXT: Cost Model: Found an estimated cost of 108 for instruction: %bitreverse = call <32 x i16> @llvm.bitreverse.v32i16(<32 x i16> %a)
340 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %bitreverse
342 ; SSE42-LABEL: 'var_bitreverse_v32i16'
343 ; SSE42-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %bitreverse = call <32 x i16> @llvm.bitreverse.v32i16(<32 x i16> %a)
344 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %bitreverse
346 ; AVX1-LABEL: 'var_bitreverse_v32i16'
347 ; AVX1-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %bitreverse = call <32 x i16> @llvm.bitreverse.v32i16(<32 x i16> %a)
348 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %bitreverse
350 ; AVX2-LABEL: 'var_bitreverse_v32i16'
351 ; AVX2-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %bitreverse = call <32 x i16> @llvm.bitreverse.v32i16(<32 x i16> %a)
352 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %bitreverse
354 ; AVX512F-LABEL: 'var_bitreverse_v32i16'
355 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %bitreverse = call <32 x i16> @llvm.bitreverse.v32i16(<32 x i16> %a)
356 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %bitreverse
358 ; AVX512BW-LABEL: 'var_bitreverse_v32i16'
359 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %bitreverse = call <32 x i16> @llvm.bitreverse.v32i16(<32 x i16> %a)
360 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %bitreverse
362 ; XOP-LABEL: 'var_bitreverse_v32i16'
363 ; XOP-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %bitreverse = call <32 x i16> @llvm.bitreverse.v32i16(<32 x i16> %a)
364 ; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %bitreverse
366 %bitreverse = call <32 x i16> @llvm.bitreverse.v32i16(<32 x i16> %a)
367 ret <32 x i16> %bitreverse
370 define <16 x i8> @var_bitreverse_v16i8(<16 x i8> %a) {
371 ; SSE2-LABEL: 'var_bitreverse_v16i8'
372 ; SSE2-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %bitreverse = call <16 x i8> @llvm.bitreverse.v16i8(<16 x i8> %a)
373 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %bitreverse
375 ; SSE42-LABEL: 'var_bitreverse_v16i8'
376 ; SSE42-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %bitreverse = call <16 x i8> @llvm.bitreverse.v16i8(<16 x i8> %a)
377 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %bitreverse
379 ; AVX-LABEL: 'var_bitreverse_v16i8'
380 ; AVX-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %bitreverse = call <16 x i8> @llvm.bitreverse.v16i8(<16 x i8> %a)
381 ; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %bitreverse
383 ; AVX512-LABEL: 'var_bitreverse_v16i8'
384 ; AVX512-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %bitreverse = call <16 x i8> @llvm.bitreverse.v16i8(<16 x i8> %a)
385 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %bitreverse
387 ; XOP-LABEL: 'var_bitreverse_v16i8'
388 ; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %bitreverse = call <16 x i8> @llvm.bitreverse.v16i8(<16 x i8> %a)
389 ; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %bitreverse
391 %bitreverse = call <16 x i8> @llvm.bitreverse.v16i8(<16 x i8> %a)
392 ret <16 x i8> %bitreverse
395 define <32 x i8> @var_bitreverse_v32i8(<32 x i8> %a) {
396 ; SSE2-LABEL: 'var_bitreverse_v32i8'
397 ; SSE2-NEXT: Cost Model: Found an estimated cost of 40 for instruction: %bitreverse = call <32 x i8> @llvm.bitreverse.v32i8(<32 x i8> %a)
398 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %bitreverse
400 ; SSE42-LABEL: 'var_bitreverse_v32i8'
401 ; SSE42-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %bitreverse = call <32 x i8> @llvm.bitreverse.v32i8(<32 x i8> %a)
402 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %bitreverse
404 ; AVX1-LABEL: 'var_bitreverse_v32i8'
405 ; AVX1-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %bitreverse = call <32 x i8> @llvm.bitreverse.v32i8(<32 x i8> %a)
406 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %bitreverse
408 ; AVX2-LABEL: 'var_bitreverse_v32i8'
409 ; AVX2-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %bitreverse = call <32 x i8> @llvm.bitreverse.v32i8(<32 x i8> %a)
410 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %bitreverse
412 ; AVX512-LABEL: 'var_bitreverse_v32i8'
413 ; AVX512-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %bitreverse = call <32 x i8> @llvm.bitreverse.v32i8(<32 x i8> %a)
414 ; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %bitreverse
416 ; XOP-LABEL: 'var_bitreverse_v32i8'
417 ; XOP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %bitreverse = call <32 x i8> @llvm.bitreverse.v32i8(<32 x i8> %a)
418 ; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %bitreverse
420 %bitreverse = call <32 x i8> @llvm.bitreverse.v32i8(<32 x i8> %a)
421 ret <32 x i8> %bitreverse
424 define <64 x i8> @var_bitreverse_v64i8(<64 x i8> %a) {
425 ; SSE2-LABEL: 'var_bitreverse_v64i8'
426 ; SSE2-NEXT: Cost Model: Found an estimated cost of 80 for instruction: %bitreverse = call <64 x i8> @llvm.bitreverse.v64i8(<64 x i8> %a)
427 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %bitreverse
429 ; SSE42-LABEL: 'var_bitreverse_v64i8'
430 ; SSE42-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %bitreverse = call <64 x i8> @llvm.bitreverse.v64i8(<64 x i8> %a)
431 ; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %bitreverse
433 ; AVX1-LABEL: 'var_bitreverse_v64i8'
434 ; AVX1-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %bitreverse = call <64 x i8> @llvm.bitreverse.v64i8(<64 x i8> %a)
435 ; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %bitreverse
437 ; AVX2-LABEL: 'var_bitreverse_v64i8'
438 ; AVX2-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %bitreverse = call <64 x i8> @llvm.bitreverse.v64i8(<64 x i8> %a)
439 ; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %bitreverse
441 ; AVX512F-LABEL: 'var_bitreverse_v64i8'
442 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %bitreverse = call <64 x i8> @llvm.bitreverse.v64i8(<64 x i8> %a)
443 ; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %bitreverse
445 ; AVX512BW-LABEL: 'var_bitreverse_v64i8'
446 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %bitreverse = call <64 x i8> @llvm.bitreverse.v64i8(<64 x i8> %a)
447 ; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %bitreverse
449 ; XOP-LABEL: 'var_bitreverse_v64i8'
450 ; XOP-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %bitreverse = call <64 x i8> @llvm.bitreverse.v64i8(<64 x i8> %a)
451 ; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %bitreverse
453 %bitreverse = call <64 x i8> @llvm.bitreverse.v64i8(<64 x i8> %a)
454 ret <64 x i8> %bitreverse