• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
16
17; Verify the cost of scalar bitreverse instructions.
18
19declare i64 @llvm.bitreverse.i64(i64)
20declare i32 @llvm.bitreverse.i32(i32)
21declare i16 @llvm.bitreverse.i16(i16)
22declare  i8 @llvm.bitreverse.i8(i8)
23
24define 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
28;
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
32;
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
36;
37  %bitreverse = call i64 @llvm.bitreverse.i64(i64 %a)
38  ret i64 %bitreverse
39}
40
41define 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
45;
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
49;
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
53;
54  %bitreverse = call i32 @llvm.bitreverse.i32(i32 %a)
55  ret i32 %bitreverse
56}
57
58define 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
62;
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
66;
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
70;
71  %bitreverse = call i16 @llvm.bitreverse.i16(i16 %a)
72  ret i16 %bitreverse
73}
74
75define 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
79;
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
83;
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
87;
88  %bitreverse = call i8 @llvm.bitreverse.i8(i8 %a)
89  ret i8 %bitreverse
90}
91
92; Verify the cost of vector bitreverse instructions.
93
94declare <2 x i64> @llvm.bitreverse.v2i64(<2 x i64>)
95declare <4 x i32> @llvm.bitreverse.v4i32(<4 x i32>)
96declare <8 x i16> @llvm.bitreverse.v8i16(<8 x i16>)
97declare <16 x i8> @llvm.bitreverse.v16i8(<16 x i8>)
98
99declare <4 x i64> @llvm.bitreverse.v4i64(<4 x i64>)
100declare <8 x i32> @llvm.bitreverse.v8i32(<8 x i32>)
101declare <16 x i16> @llvm.bitreverse.v16i16(<16 x i16>)
102declare <32 x i8> @llvm.bitreverse.v32i8(<32 x i8>)
103
104declare <8 x i64> @llvm.bitreverse.v8i64(<8 x i64>)
105declare <16 x i32> @llvm.bitreverse.v16i32(<16 x i32>)
106declare <32 x i16> @llvm.bitreverse.v32i16(<32 x i16>)
107declare <64 x i8> @llvm.bitreverse.v64i8(<64 x i8>)
108
109define <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
113;
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
117;
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
121;
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
125;
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
129;
130  %bitreverse = call <2 x i64> @llvm.bitreverse.v2i64(<2 x i64> %a)
131  ret <2 x i64> %bitreverse
132}
133
134define <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
138;
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
142;
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
146;
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
150;
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
154;
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
158;
159  %bitreverse = call <4 x i64> @llvm.bitreverse.v4i64(<4 x i64> %a)
160  ret <4 x i64> %bitreverse
161}
162
163define <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
167;
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
171;
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
175;
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
179;
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
183;
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
187;
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
191;
192  %bitreverse = call <8 x i64> @llvm.bitreverse.v8i64(<8 x i64> %a)
193  ret <8 x i64> %bitreverse
194}
195
196define <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
200;
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
204;
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
208;
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
212;
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
216;
217  %bitreverse = call <4 x i32> @llvm.bitreverse.v4i32(<4 x i32> %a)
218  ret <4 x i32> %bitreverse
219}
220
221define <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
225;
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
229;
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
233;
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
237;
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
241;
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
245;
246  %bitreverse = call <8 x i32> @llvm.bitreverse.v8i32(<8 x i32> %a)
247  ret <8 x i32> %bitreverse
248}
249
250define <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
254;
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
258;
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
262;
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
266;
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
270;
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
274;
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
278;
279  %bitreverse = call <16 x i32> @llvm.bitreverse.v16i32(<16 x i32> %a)
280  ret <16 x i32> %bitreverse
281}
282
283define <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
287;
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
291;
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
295;
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
299;
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
303;
304  %bitreverse = call <8 x i16> @llvm.bitreverse.v8i16(<8 x i16> %a)
305  ret <8 x i16> %bitreverse
306}
307
308define <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
312;
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
316;
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
320;
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
324;
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
328;
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
332;
333  %bitreverse = call <16 x i16> @llvm.bitreverse.v16i16(<16 x i16> %a)
334  ret <16 x i16> %bitreverse
335}
336
337define <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
341;
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
345;
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
349;
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
353;
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
357;
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
361;
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
365;
366  %bitreverse = call <32 x i16> @llvm.bitreverse.v32i16(<32 x i16> %a)
367  ret <32 x i16> %bitreverse
368}
369
370define <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
374;
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
378;
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
382;
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
386;
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
390;
391  %bitreverse = call <16 x i8> @llvm.bitreverse.v16i8(<16 x i8> %a)
392  ret <16 x i8> %bitreverse
393}
394
395define <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
399;
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
403;
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
407;
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
411;
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
415;
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
419;
420  %bitreverse = call <32 x i8> @llvm.bitreverse.v32i8(<32 x i8> %a)
421  ret <32 x i8> %bitreverse
422}
423
424define <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
428;
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
432;
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
436;
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
440;
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
444;
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
448;
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
452;
453  %bitreverse = call <64 x i8> @llvm.bitreverse.v64i8(<64 x i8> %a)
454  ret <64 x i8> %bitreverse
455}
456