xref: /llvm-project/llvm/test/Analysis/CostModel/RISCV/reduce-scalable-int.ll (revision 46829e5430aa3f086389549538d5289769d67076)
1; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2; RUN: opt < %s -mtriple=riscv32 -mattr=+v -passes="print<cost-model>" -cost-kind=throughput 2>&1 -disable-output | FileCheck %s
3; RUN: opt < %s -mtriple=riscv64 -mattr=+v -passes="print<cost-model>" -cost-kind=throughput 2>&1 -disable-output | FileCheck %s
4; RUN: opt < %s -mtriple=riscv32 -mattr=+v -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output | FileCheck %s --check-prefix=SIZE
5; RUN: opt < %s -mtriple=riscv64 -mattr=+v -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output | FileCheck %s --check-prefix=SIZE
6
7declare i8 @llvm.vector.reduce.add.nxv1i8(<vscale x 1 x i8>)
8
9define signext i8 @vreduce_add_nxv1i8(<vscale x 1 x i8> %v) {
10; CHECK-LABEL: 'vreduce_add_nxv1i8'
11; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i8 @llvm.vector.reduce.add.nxv1i8(<vscale x 1 x i8> %v)
12; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i8 %red
13;
14; SIZE-LABEL: 'vreduce_add_nxv1i8'
15; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i8 @llvm.vector.reduce.add.nxv1i8(<vscale x 1 x i8> %v)
16; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i8 %red
17;
18  %red = call i8 @llvm.vector.reduce.add.nxv1i8(<vscale x 1 x i8> %v)
19  ret i8 %red
20}
21
22declare i8 @llvm.vector.reduce.umax.nxv1i8(<vscale x 1 x i8>)
23
24define signext i8 @vreduce_umax_nxv1i8(<vscale x 1 x i8> %v) {
25; CHECK-LABEL: 'vreduce_umax_nxv1i8'
26; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i8 @llvm.vector.reduce.umax.nxv1i8(<vscale x 1 x i8> %v)
27; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i8 %red
28;
29; SIZE-LABEL: 'vreduce_umax_nxv1i8'
30; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i8 @llvm.vector.reduce.umax.nxv1i8(<vscale x 1 x i8> %v)
31; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i8 %red
32;
33  %red = call i8 @llvm.vector.reduce.umax.nxv1i8(<vscale x 1 x i8> %v)
34  ret i8 %red
35}
36
37declare i8 @llvm.vector.reduce.smax.nxv1i8(<vscale x 1 x i8>)
38
39define signext i8 @vreduce_smax_nxv1i8(<vscale x 1 x i8> %v) {
40; CHECK-LABEL: 'vreduce_smax_nxv1i8'
41; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i8 @llvm.vector.reduce.smax.nxv1i8(<vscale x 1 x i8> %v)
42; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i8 %red
43;
44; SIZE-LABEL: 'vreduce_smax_nxv1i8'
45; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i8 @llvm.vector.reduce.smax.nxv1i8(<vscale x 1 x i8> %v)
46; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i8 %red
47;
48  %red = call i8 @llvm.vector.reduce.smax.nxv1i8(<vscale x 1 x i8> %v)
49  ret i8 %red
50}
51
52declare i8 @llvm.vector.reduce.umin.nxv1i8(<vscale x 1 x i8>)
53
54define signext i8 @vreduce_umin_nxv1i8(<vscale x 1 x i8> %v) {
55; CHECK-LABEL: 'vreduce_umin_nxv1i8'
56; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i8 @llvm.vector.reduce.umin.nxv1i8(<vscale x 1 x i8> %v)
57; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i8 %red
58;
59; SIZE-LABEL: 'vreduce_umin_nxv1i8'
60; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i8 @llvm.vector.reduce.umin.nxv1i8(<vscale x 1 x i8> %v)
61; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i8 %red
62;
63  %red = call i8 @llvm.vector.reduce.umin.nxv1i8(<vscale x 1 x i8> %v)
64  ret i8 %red
65}
66
67declare i8 @llvm.vector.reduce.smin.nxv1i8(<vscale x 1 x i8>)
68
69define signext i8 @vreduce_smin_nxv1i8(<vscale x 1 x i8> %v) {
70; CHECK-LABEL: 'vreduce_smin_nxv1i8'
71; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i8 @llvm.vector.reduce.smin.nxv1i8(<vscale x 1 x i8> %v)
72; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i8 %red
73;
74; SIZE-LABEL: 'vreduce_smin_nxv1i8'
75; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i8 @llvm.vector.reduce.smin.nxv1i8(<vscale x 1 x i8> %v)
76; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i8 %red
77;
78  %red = call i8 @llvm.vector.reduce.smin.nxv1i8(<vscale x 1 x i8> %v)
79  ret i8 %red
80}
81
82declare i8 @llvm.vector.reduce.and.nxv1i8(<vscale x 1 x i8>)
83
84define signext i8 @vreduce_and_nxv1i8(<vscale x 1 x i8> %v) {
85; CHECK-LABEL: 'vreduce_and_nxv1i8'
86; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i8 @llvm.vector.reduce.and.nxv1i8(<vscale x 1 x i8> %v)
87; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i8 %red
88;
89; SIZE-LABEL: 'vreduce_and_nxv1i8'
90; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i8 @llvm.vector.reduce.and.nxv1i8(<vscale x 1 x i8> %v)
91; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i8 %red
92;
93  %red = call i8 @llvm.vector.reduce.and.nxv1i8(<vscale x 1 x i8> %v)
94  ret i8 %red
95}
96
97declare i8 @llvm.vector.reduce.or.nxv1i8(<vscale x 1 x i8>)
98
99define signext i8 @vreduce_or_nxv1i8(<vscale x 1 x i8> %v) {
100; CHECK-LABEL: 'vreduce_or_nxv1i8'
101; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i8 @llvm.vector.reduce.or.nxv1i8(<vscale x 1 x i8> %v)
102; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i8 %red
103;
104; SIZE-LABEL: 'vreduce_or_nxv1i8'
105; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i8 @llvm.vector.reduce.or.nxv1i8(<vscale x 1 x i8> %v)
106; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i8 %red
107;
108  %red = call i8 @llvm.vector.reduce.or.nxv1i8(<vscale x 1 x i8> %v)
109  ret i8 %red
110}
111
112declare i8 @llvm.vector.reduce.xor.nxv1i8(<vscale x 1 x i8>)
113
114define signext i8 @vreduce_xor_nxv1i8(<vscale x 1 x i8> %v) {
115; CHECK-LABEL: 'vreduce_xor_nxv1i8'
116; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i8 @llvm.vector.reduce.xor.nxv1i8(<vscale x 1 x i8> %v)
117; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i8 %red
118;
119; SIZE-LABEL: 'vreduce_xor_nxv1i8'
120; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i8 @llvm.vector.reduce.xor.nxv1i8(<vscale x 1 x i8> %v)
121; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i8 %red
122;
123  %red = call i8 @llvm.vector.reduce.xor.nxv1i8(<vscale x 1 x i8> %v)
124  ret i8 %red
125}
126
127declare i8 @llvm.vector.reduce.add.nxv2i8(<vscale x 2 x i8>)
128
129define signext i8 @vreduce_add_nxv2i8(<vscale x 2 x i8> %v) {
130; CHECK-LABEL: 'vreduce_add_nxv2i8'
131; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %red = call i8 @llvm.vector.reduce.add.nxv2i8(<vscale x 2 x i8> %v)
132; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i8 %red
133;
134; SIZE-LABEL: 'vreduce_add_nxv2i8'
135; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i8 @llvm.vector.reduce.add.nxv2i8(<vscale x 2 x i8> %v)
136; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i8 %red
137;
138  %red = call i8 @llvm.vector.reduce.add.nxv2i8(<vscale x 2 x i8> %v)
139  ret i8 %red
140}
141
142declare i8 @llvm.vector.reduce.umax.nxv2i8(<vscale x 2 x i8>)
143
144define signext i8 @vreduce_umax_nxv2i8(<vscale x 2 x i8> %v) {
145; CHECK-LABEL: 'vreduce_umax_nxv2i8'
146; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i8 @llvm.vector.reduce.umax.nxv2i8(<vscale x 2 x i8> %v)
147; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i8 %red
148;
149; SIZE-LABEL: 'vreduce_umax_nxv2i8'
150; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i8 @llvm.vector.reduce.umax.nxv2i8(<vscale x 2 x i8> %v)
151; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i8 %red
152;
153  %red = call i8 @llvm.vector.reduce.umax.nxv2i8(<vscale x 2 x i8> %v)
154  ret i8 %red
155}
156
157declare i8 @llvm.vector.reduce.smax.nxv2i8(<vscale x 2 x i8>)
158
159define signext i8 @vreduce_smax_nxv2i8(<vscale x 2 x i8> %v) {
160; CHECK-LABEL: 'vreduce_smax_nxv2i8'
161; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i8 @llvm.vector.reduce.smax.nxv2i8(<vscale x 2 x i8> %v)
162; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i8 %red
163;
164; SIZE-LABEL: 'vreduce_smax_nxv2i8'
165; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i8 @llvm.vector.reduce.smax.nxv2i8(<vscale x 2 x i8> %v)
166; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i8 %red
167;
168  %red = call i8 @llvm.vector.reduce.smax.nxv2i8(<vscale x 2 x i8> %v)
169  ret i8 %red
170}
171
172declare i8 @llvm.vector.reduce.umin.nxv2i8(<vscale x 2 x i8>)
173
174define signext i8 @vreduce_umin_nxv2i8(<vscale x 2 x i8> %v) {
175; CHECK-LABEL: 'vreduce_umin_nxv2i8'
176; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i8 @llvm.vector.reduce.umin.nxv2i8(<vscale x 2 x i8> %v)
177; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i8 %red
178;
179; SIZE-LABEL: 'vreduce_umin_nxv2i8'
180; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i8 @llvm.vector.reduce.umin.nxv2i8(<vscale x 2 x i8> %v)
181; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i8 %red
182;
183  %red = call i8 @llvm.vector.reduce.umin.nxv2i8(<vscale x 2 x i8> %v)
184  ret i8 %red
185}
186
187declare i8 @llvm.vector.reduce.smin.nxv2i8(<vscale x 2 x i8>)
188
189define signext i8 @vreduce_smin_nxv2i8(<vscale x 2 x i8> %v) {
190; CHECK-LABEL: 'vreduce_smin_nxv2i8'
191; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i8 @llvm.vector.reduce.smin.nxv2i8(<vscale x 2 x i8> %v)
192; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i8 %red
193;
194; SIZE-LABEL: 'vreduce_smin_nxv2i8'
195; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i8 @llvm.vector.reduce.smin.nxv2i8(<vscale x 2 x i8> %v)
196; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i8 %red
197;
198  %red = call i8 @llvm.vector.reduce.smin.nxv2i8(<vscale x 2 x i8> %v)
199  ret i8 %red
200}
201
202declare i8 @llvm.vector.reduce.and.nxv2i8(<vscale x 2 x i8>)
203
204define signext i8 @vreduce_and_nxv2i8(<vscale x 2 x i8> %v) {
205; CHECK-LABEL: 'vreduce_and_nxv2i8'
206; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i8 @llvm.vector.reduce.and.nxv2i8(<vscale x 2 x i8> %v)
207; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i8 %red
208;
209; SIZE-LABEL: 'vreduce_and_nxv2i8'
210; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i8 @llvm.vector.reduce.and.nxv2i8(<vscale x 2 x i8> %v)
211; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i8 %red
212;
213  %red = call i8 @llvm.vector.reduce.and.nxv2i8(<vscale x 2 x i8> %v)
214  ret i8 %red
215}
216
217declare i8 @llvm.vector.reduce.or.nxv2i8(<vscale x 2 x i8>)
218
219define signext i8 @vreduce_or_nxv2i8(<vscale x 2 x i8> %v) {
220; CHECK-LABEL: 'vreduce_or_nxv2i8'
221; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i8 @llvm.vector.reduce.or.nxv2i8(<vscale x 2 x i8> %v)
222; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i8 %red
223;
224; SIZE-LABEL: 'vreduce_or_nxv2i8'
225; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i8 @llvm.vector.reduce.or.nxv2i8(<vscale x 2 x i8> %v)
226; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i8 %red
227;
228  %red = call i8 @llvm.vector.reduce.or.nxv2i8(<vscale x 2 x i8> %v)
229  ret i8 %red
230}
231
232declare i8 @llvm.vector.reduce.xor.nxv2i8(<vscale x 2 x i8>)
233
234define signext i8 @vreduce_xor_nxv2i8(<vscale x 2 x i8> %v) {
235; CHECK-LABEL: 'vreduce_xor_nxv2i8'
236; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %red = call i8 @llvm.vector.reduce.xor.nxv2i8(<vscale x 2 x i8> %v)
237; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i8 %red
238;
239; SIZE-LABEL: 'vreduce_xor_nxv2i8'
240; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i8 @llvm.vector.reduce.xor.nxv2i8(<vscale x 2 x i8> %v)
241; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i8 %red
242;
243  %red = call i8 @llvm.vector.reduce.xor.nxv2i8(<vscale x 2 x i8> %v)
244  ret i8 %red
245}
246
247declare i8 @llvm.vector.reduce.add.nxv4i8(<vscale x 4 x i8>)
248
249define signext i8 @vreduce_add_nxv4i8(<vscale x 4 x i8> %v) {
250; CHECK-LABEL: 'vreduce_add_nxv4i8'
251; CHECK-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %red = call i8 @llvm.vector.reduce.add.nxv4i8(<vscale x 4 x i8> %v)
252; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i8 %red
253;
254; SIZE-LABEL: 'vreduce_add_nxv4i8'
255; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i8 @llvm.vector.reduce.add.nxv4i8(<vscale x 4 x i8> %v)
256; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i8 %red
257;
258  %red = call i8 @llvm.vector.reduce.add.nxv4i8(<vscale x 4 x i8> %v)
259  ret i8 %red
260}
261
262declare i8 @llvm.vector.reduce.umax.nxv4i8(<vscale x 4 x i8>)
263
264define signext i8 @vreduce_umax_nxv4i8(<vscale x 4 x i8> %v) {
265; CHECK-LABEL: 'vreduce_umax_nxv4i8'
266; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %red = call i8 @llvm.vector.reduce.umax.nxv4i8(<vscale x 4 x i8> %v)
267; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i8 %red
268;
269; SIZE-LABEL: 'vreduce_umax_nxv4i8'
270; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i8 @llvm.vector.reduce.umax.nxv4i8(<vscale x 4 x i8> %v)
271; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i8 %red
272;
273  %red = call i8 @llvm.vector.reduce.umax.nxv4i8(<vscale x 4 x i8> %v)
274  ret i8 %red
275}
276
277declare i8 @llvm.vector.reduce.smax.nxv4i8(<vscale x 4 x i8>)
278
279define signext i8 @vreduce_smax_nxv4i8(<vscale x 4 x i8> %v) {
280; CHECK-LABEL: 'vreduce_smax_nxv4i8'
281; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %red = call i8 @llvm.vector.reduce.smax.nxv4i8(<vscale x 4 x i8> %v)
282; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i8 %red
283;
284; SIZE-LABEL: 'vreduce_smax_nxv4i8'
285; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i8 @llvm.vector.reduce.smax.nxv4i8(<vscale x 4 x i8> %v)
286; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i8 %red
287;
288  %red = call i8 @llvm.vector.reduce.smax.nxv4i8(<vscale x 4 x i8> %v)
289  ret i8 %red
290}
291
292declare i8 @llvm.vector.reduce.umin.nxv4i8(<vscale x 4 x i8>)
293
294define signext i8 @vreduce_umin_nxv4i8(<vscale x 4 x i8> %v) {
295; CHECK-LABEL: 'vreduce_umin_nxv4i8'
296; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %red = call i8 @llvm.vector.reduce.umin.nxv4i8(<vscale x 4 x i8> %v)
297; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i8 %red
298;
299; SIZE-LABEL: 'vreduce_umin_nxv4i8'
300; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i8 @llvm.vector.reduce.umin.nxv4i8(<vscale x 4 x i8> %v)
301; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i8 %red
302;
303  %red = call i8 @llvm.vector.reduce.umin.nxv4i8(<vscale x 4 x i8> %v)
304  ret i8 %red
305}
306
307declare i8 @llvm.vector.reduce.smin.nxv4i8(<vscale x 4 x i8>)
308
309define signext i8 @vreduce_smin_nxv4i8(<vscale x 4 x i8> %v) {
310; CHECK-LABEL: 'vreduce_smin_nxv4i8'
311; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %red = call i8 @llvm.vector.reduce.smin.nxv4i8(<vscale x 4 x i8> %v)
312; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i8 %red
313;
314; SIZE-LABEL: 'vreduce_smin_nxv4i8'
315; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i8 @llvm.vector.reduce.smin.nxv4i8(<vscale x 4 x i8> %v)
316; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i8 %red
317;
318  %red = call i8 @llvm.vector.reduce.smin.nxv4i8(<vscale x 4 x i8> %v)
319  ret i8 %red
320}
321
322declare i8 @llvm.vector.reduce.and.nxv4i8(<vscale x 4 x i8>)
323
324define signext i8 @vreduce_and_nxv4i8(<vscale x 4 x i8> %v) {
325; CHECK-LABEL: 'vreduce_and_nxv4i8'
326; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %red = call i8 @llvm.vector.reduce.and.nxv4i8(<vscale x 4 x i8> %v)
327; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i8 %red
328;
329; SIZE-LABEL: 'vreduce_and_nxv4i8'
330; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i8 @llvm.vector.reduce.and.nxv4i8(<vscale x 4 x i8> %v)
331; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i8 %red
332;
333  %red = call i8 @llvm.vector.reduce.and.nxv4i8(<vscale x 4 x i8> %v)
334  ret i8 %red
335}
336
337declare i8 @llvm.vector.reduce.or.nxv4i8(<vscale x 4 x i8>)
338
339define signext i8 @vreduce_or_nxv4i8(<vscale x 4 x i8> %v) {
340; CHECK-LABEL: 'vreduce_or_nxv4i8'
341; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %red = call i8 @llvm.vector.reduce.or.nxv4i8(<vscale x 4 x i8> %v)
342; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i8 %red
343;
344; SIZE-LABEL: 'vreduce_or_nxv4i8'
345; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i8 @llvm.vector.reduce.or.nxv4i8(<vscale x 4 x i8> %v)
346; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i8 %red
347;
348  %red = call i8 @llvm.vector.reduce.or.nxv4i8(<vscale x 4 x i8> %v)
349  ret i8 %red
350}
351
352declare i8 @llvm.vector.reduce.xor.nxv4i8(<vscale x 4 x i8>)
353
354define signext i8 @vreduce_xor_nxv4i8(<vscale x 4 x i8> %v) {
355; CHECK-LABEL: 'vreduce_xor_nxv4i8'
356; CHECK-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %red = call i8 @llvm.vector.reduce.xor.nxv4i8(<vscale x 4 x i8> %v)
357; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i8 %red
358;
359; SIZE-LABEL: 'vreduce_xor_nxv4i8'
360; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i8 @llvm.vector.reduce.xor.nxv4i8(<vscale x 4 x i8> %v)
361; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i8 %red
362;
363  %red = call i8 @llvm.vector.reduce.xor.nxv4i8(<vscale x 4 x i8> %v)
364  ret i8 %red
365}
366
367declare i16 @llvm.vector.reduce.add.nxv1i16(<vscale x 1 x i16>)
368
369define signext i16 @vreduce_add_nxv1i16(<vscale x 1 x i16> %v) {
370; CHECK-LABEL: 'vreduce_add_nxv1i16'
371; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i16 @llvm.vector.reduce.add.nxv1i16(<vscale x 1 x i16> %v)
372; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %red
373;
374; SIZE-LABEL: 'vreduce_add_nxv1i16'
375; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i16 @llvm.vector.reduce.add.nxv1i16(<vscale x 1 x i16> %v)
376; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i16 %red
377;
378  %red = call i16 @llvm.vector.reduce.add.nxv1i16(<vscale x 1 x i16> %v)
379  ret i16 %red
380}
381
382define signext i16 @vwreduce_add_nxv1i8(<vscale x 1 x i8> %v) {
383; CHECK-LABEL: 'vwreduce_add_nxv1i8'
384; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %e = sext <vscale x 1 x i8> %v to <vscale x 1 x i16>
385; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i16 @llvm.vector.reduce.add.nxv1i16(<vscale x 1 x i16> %e)
386; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %red
387;
388; SIZE-LABEL: 'vwreduce_add_nxv1i8'
389; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %e = sext <vscale x 1 x i8> %v to <vscale x 1 x i16>
390; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i16 @llvm.vector.reduce.add.nxv1i16(<vscale x 1 x i16> %e)
391; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i16 %red
392;
393  %e = sext <vscale x 1 x i8> %v to <vscale x 1 x i16>
394  %red = call i16 @llvm.vector.reduce.add.nxv1i16(<vscale x 1 x i16> %e)
395  ret i16 %red
396}
397
398define signext i16 @vwreduce_uadd_nxv1i8(<vscale x 1 x i8> %v) {
399; CHECK-LABEL: 'vwreduce_uadd_nxv1i8'
400; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %e = sext <vscale x 1 x i8> %v to <vscale x 1 x i16>
401; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i16 @llvm.vector.reduce.add.nxv1i16(<vscale x 1 x i16> %e)
402; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %red
403;
404; SIZE-LABEL: 'vwreduce_uadd_nxv1i8'
405; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %e = sext <vscale x 1 x i8> %v to <vscale x 1 x i16>
406; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i16 @llvm.vector.reduce.add.nxv1i16(<vscale x 1 x i16> %e)
407; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i16 %red
408;
409  %e = sext <vscale x 1 x i8> %v to <vscale x 1 x i16>
410  %red = call i16 @llvm.vector.reduce.add.nxv1i16(<vscale x 1 x i16> %e)
411  ret i16 %red
412}
413
414declare i16 @llvm.vector.reduce.umax.nxv1i16(<vscale x 1 x i16>)
415
416define signext i16 @vreduce_umax_nxv1i16(<vscale x 1 x i16> %v) {
417; CHECK-LABEL: 'vreduce_umax_nxv1i16'
418; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i16 @llvm.vector.reduce.umax.nxv1i16(<vscale x 1 x i16> %v)
419; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %red
420;
421; SIZE-LABEL: 'vreduce_umax_nxv1i16'
422; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i16 @llvm.vector.reduce.umax.nxv1i16(<vscale x 1 x i16> %v)
423; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i16 %red
424;
425  %red = call i16 @llvm.vector.reduce.umax.nxv1i16(<vscale x 1 x i16> %v)
426  ret i16 %red
427}
428
429declare i16 @llvm.vector.reduce.smax.nxv1i16(<vscale x 1 x i16>)
430
431define signext i16 @vreduce_smax_nxv1i16(<vscale x 1 x i16> %v) {
432; CHECK-LABEL: 'vreduce_smax_nxv1i16'
433; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i16 @llvm.vector.reduce.smax.nxv1i16(<vscale x 1 x i16> %v)
434; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %red
435;
436; SIZE-LABEL: 'vreduce_smax_nxv1i16'
437; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i16 @llvm.vector.reduce.smax.nxv1i16(<vscale x 1 x i16> %v)
438; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i16 %red
439;
440  %red = call i16 @llvm.vector.reduce.smax.nxv1i16(<vscale x 1 x i16> %v)
441  ret i16 %red
442}
443
444declare i16 @llvm.vector.reduce.umin.nxv1i16(<vscale x 1 x i16>)
445
446define signext i16 @vreduce_umin_nxv1i16(<vscale x 1 x i16> %v) {
447; CHECK-LABEL: 'vreduce_umin_nxv1i16'
448; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i16 @llvm.vector.reduce.umin.nxv1i16(<vscale x 1 x i16> %v)
449; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %red
450;
451; SIZE-LABEL: 'vreduce_umin_nxv1i16'
452; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i16 @llvm.vector.reduce.umin.nxv1i16(<vscale x 1 x i16> %v)
453; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i16 %red
454;
455  %red = call i16 @llvm.vector.reduce.umin.nxv1i16(<vscale x 1 x i16> %v)
456  ret i16 %red
457}
458
459declare i16 @llvm.vector.reduce.smin.nxv1i16(<vscale x 1 x i16>)
460
461define signext i16 @vreduce_smin_nxv1i16(<vscale x 1 x i16> %v) {
462; CHECK-LABEL: 'vreduce_smin_nxv1i16'
463; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i16 @llvm.vector.reduce.smin.nxv1i16(<vscale x 1 x i16> %v)
464; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %red
465;
466; SIZE-LABEL: 'vreduce_smin_nxv1i16'
467; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i16 @llvm.vector.reduce.smin.nxv1i16(<vscale x 1 x i16> %v)
468; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i16 %red
469;
470  %red = call i16 @llvm.vector.reduce.smin.nxv1i16(<vscale x 1 x i16> %v)
471  ret i16 %red
472}
473
474declare i16 @llvm.vector.reduce.and.nxv1i16(<vscale x 1 x i16>)
475
476define signext i16 @vreduce_and_nxv1i16(<vscale x 1 x i16> %v) {
477; CHECK-LABEL: 'vreduce_and_nxv1i16'
478; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i16 @llvm.vector.reduce.and.nxv1i16(<vscale x 1 x i16> %v)
479; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %red
480;
481; SIZE-LABEL: 'vreduce_and_nxv1i16'
482; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i16 @llvm.vector.reduce.and.nxv1i16(<vscale x 1 x i16> %v)
483; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i16 %red
484;
485  %red = call i16 @llvm.vector.reduce.and.nxv1i16(<vscale x 1 x i16> %v)
486  ret i16 %red
487}
488
489declare i16 @llvm.vector.reduce.or.nxv1i16(<vscale x 1 x i16>)
490
491define signext i16 @vreduce_or_nxv1i16(<vscale x 1 x i16> %v) {
492; CHECK-LABEL: 'vreduce_or_nxv1i16'
493; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i16 @llvm.vector.reduce.or.nxv1i16(<vscale x 1 x i16> %v)
494; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %red
495;
496; SIZE-LABEL: 'vreduce_or_nxv1i16'
497; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i16 @llvm.vector.reduce.or.nxv1i16(<vscale x 1 x i16> %v)
498; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i16 %red
499;
500  %red = call i16 @llvm.vector.reduce.or.nxv1i16(<vscale x 1 x i16> %v)
501  ret i16 %red
502}
503
504declare i16 @llvm.vector.reduce.xor.nxv1i16(<vscale x 1 x i16>)
505
506define signext i16 @vreduce_xor_nxv1i16(<vscale x 1 x i16> %v) {
507; CHECK-LABEL: 'vreduce_xor_nxv1i16'
508; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i16 @llvm.vector.reduce.xor.nxv1i16(<vscale x 1 x i16> %v)
509; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %red
510;
511; SIZE-LABEL: 'vreduce_xor_nxv1i16'
512; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i16 @llvm.vector.reduce.xor.nxv1i16(<vscale x 1 x i16> %v)
513; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i16 %red
514;
515  %red = call i16 @llvm.vector.reduce.xor.nxv1i16(<vscale x 1 x i16> %v)
516  ret i16 %red
517}
518
519declare i16 @llvm.vector.reduce.add.nxv2i16(<vscale x 2 x i16>)
520
521define signext i16 @vreduce_add_nxv2i16(<vscale x 2 x i16> %v) {
522; CHECK-LABEL: 'vreduce_add_nxv2i16'
523; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %red = call i16 @llvm.vector.reduce.add.nxv2i16(<vscale x 2 x i16> %v)
524; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %red
525;
526; SIZE-LABEL: 'vreduce_add_nxv2i16'
527; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i16 @llvm.vector.reduce.add.nxv2i16(<vscale x 2 x i16> %v)
528; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i16 %red
529;
530  %red = call i16 @llvm.vector.reduce.add.nxv2i16(<vscale x 2 x i16> %v)
531  ret i16 %red
532}
533
534define signext i16 @vwreduce_add_nxv2i8(<vscale x 2 x i8> %v) {
535; CHECK-LABEL: 'vwreduce_add_nxv2i8'
536; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %e = sext <vscale x 2 x i8> %v to <vscale x 2 x i16>
537; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %red = call i16 @llvm.vector.reduce.add.nxv2i16(<vscale x 2 x i16> %e)
538; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %red
539;
540; SIZE-LABEL: 'vwreduce_add_nxv2i8'
541; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %e = sext <vscale x 2 x i8> %v to <vscale x 2 x i16>
542; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i16 @llvm.vector.reduce.add.nxv2i16(<vscale x 2 x i16> %e)
543; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i16 %red
544;
545  %e = sext <vscale x 2 x i8> %v to <vscale x 2 x i16>
546  %red = call i16 @llvm.vector.reduce.add.nxv2i16(<vscale x 2 x i16> %e)
547  ret i16 %red
548}
549
550define signext i16 @vwreduce_uadd_nxv2i8(<vscale x 2 x i8> %v) {
551; CHECK-LABEL: 'vwreduce_uadd_nxv2i8'
552; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %e = sext <vscale x 2 x i8> %v to <vscale x 2 x i16>
553; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %red = call i16 @llvm.vector.reduce.add.nxv2i16(<vscale x 2 x i16> %e)
554; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %red
555;
556; SIZE-LABEL: 'vwreduce_uadd_nxv2i8'
557; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %e = sext <vscale x 2 x i8> %v to <vscale x 2 x i16>
558; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i16 @llvm.vector.reduce.add.nxv2i16(<vscale x 2 x i16> %e)
559; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i16 %red
560;
561  %e = sext <vscale x 2 x i8> %v to <vscale x 2 x i16>
562  %red = call i16 @llvm.vector.reduce.add.nxv2i16(<vscale x 2 x i16> %e)
563  ret i16 %red
564}
565
566declare i16 @llvm.vector.reduce.umax.nxv2i16(<vscale x 2 x i16>)
567
568define signext i16 @vreduce_umax_nxv2i16(<vscale x 2 x i16> %v) {
569; CHECK-LABEL: 'vreduce_umax_nxv2i16'
570; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i16 @llvm.vector.reduce.umax.nxv2i16(<vscale x 2 x i16> %v)
571; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %red
572;
573; SIZE-LABEL: 'vreduce_umax_nxv2i16'
574; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i16 @llvm.vector.reduce.umax.nxv2i16(<vscale x 2 x i16> %v)
575; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i16 %red
576;
577  %red = call i16 @llvm.vector.reduce.umax.nxv2i16(<vscale x 2 x i16> %v)
578  ret i16 %red
579}
580
581declare i16 @llvm.vector.reduce.smax.nxv2i16(<vscale x 2 x i16>)
582
583define signext i16 @vreduce_smax_nxv2i16(<vscale x 2 x i16> %v) {
584; CHECK-LABEL: 'vreduce_smax_nxv2i16'
585; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i16 @llvm.vector.reduce.smax.nxv2i16(<vscale x 2 x i16> %v)
586; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %red
587;
588; SIZE-LABEL: 'vreduce_smax_nxv2i16'
589; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i16 @llvm.vector.reduce.smax.nxv2i16(<vscale x 2 x i16> %v)
590; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i16 %red
591;
592  %red = call i16 @llvm.vector.reduce.smax.nxv2i16(<vscale x 2 x i16> %v)
593  ret i16 %red
594}
595
596declare i16 @llvm.vector.reduce.umin.nxv2i16(<vscale x 2 x i16>)
597
598define signext i16 @vreduce_umin_nxv2i16(<vscale x 2 x i16> %v) {
599; CHECK-LABEL: 'vreduce_umin_nxv2i16'
600; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i16 @llvm.vector.reduce.umin.nxv2i16(<vscale x 2 x i16> %v)
601; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %red
602;
603; SIZE-LABEL: 'vreduce_umin_nxv2i16'
604; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i16 @llvm.vector.reduce.umin.nxv2i16(<vscale x 2 x i16> %v)
605; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i16 %red
606;
607  %red = call i16 @llvm.vector.reduce.umin.nxv2i16(<vscale x 2 x i16> %v)
608  ret i16 %red
609}
610
611declare i16 @llvm.vector.reduce.smin.nxv2i16(<vscale x 2 x i16>)
612
613define signext i16 @vreduce_smin_nxv2i16(<vscale x 2 x i16> %v) {
614; CHECK-LABEL: 'vreduce_smin_nxv2i16'
615; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i16 @llvm.vector.reduce.smin.nxv2i16(<vscale x 2 x i16> %v)
616; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %red
617;
618; SIZE-LABEL: 'vreduce_smin_nxv2i16'
619; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i16 @llvm.vector.reduce.smin.nxv2i16(<vscale x 2 x i16> %v)
620; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i16 %red
621;
622  %red = call i16 @llvm.vector.reduce.smin.nxv2i16(<vscale x 2 x i16> %v)
623  ret i16 %red
624}
625
626declare i16 @llvm.vector.reduce.and.nxv2i16(<vscale x 2 x i16>)
627
628define signext i16 @vreduce_and_nxv2i16(<vscale x 2 x i16> %v) {
629; CHECK-LABEL: 'vreduce_and_nxv2i16'
630; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i16 @llvm.vector.reduce.and.nxv2i16(<vscale x 2 x i16> %v)
631; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %red
632;
633; SIZE-LABEL: 'vreduce_and_nxv2i16'
634; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i16 @llvm.vector.reduce.and.nxv2i16(<vscale x 2 x i16> %v)
635; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i16 %red
636;
637  %red = call i16 @llvm.vector.reduce.and.nxv2i16(<vscale x 2 x i16> %v)
638  ret i16 %red
639}
640
641declare i16 @llvm.vector.reduce.or.nxv2i16(<vscale x 2 x i16>)
642
643define signext i16 @vreduce_or_nxv2i16(<vscale x 2 x i16> %v) {
644; CHECK-LABEL: 'vreduce_or_nxv2i16'
645; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i16 @llvm.vector.reduce.or.nxv2i16(<vscale x 2 x i16> %v)
646; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %red
647;
648; SIZE-LABEL: 'vreduce_or_nxv2i16'
649; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i16 @llvm.vector.reduce.or.nxv2i16(<vscale x 2 x i16> %v)
650; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i16 %red
651;
652  %red = call i16 @llvm.vector.reduce.or.nxv2i16(<vscale x 2 x i16> %v)
653  ret i16 %red
654}
655
656declare i16 @llvm.vector.reduce.xor.nxv2i16(<vscale x 2 x i16>)
657
658define signext i16 @vreduce_xor_nxv2i16(<vscale x 2 x i16> %v) {
659; CHECK-LABEL: 'vreduce_xor_nxv2i16'
660; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %red = call i16 @llvm.vector.reduce.xor.nxv2i16(<vscale x 2 x i16> %v)
661; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %red
662;
663; SIZE-LABEL: 'vreduce_xor_nxv2i16'
664; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i16 @llvm.vector.reduce.xor.nxv2i16(<vscale x 2 x i16> %v)
665; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i16 %red
666;
667  %red = call i16 @llvm.vector.reduce.xor.nxv2i16(<vscale x 2 x i16> %v)
668  ret i16 %red
669}
670
671declare i16 @llvm.vector.reduce.add.nxv4i16(<vscale x 4 x i16>)
672
673define signext i16 @vreduce_add_nxv4i16(<vscale x 4 x i16> %v) {
674; CHECK-LABEL: 'vreduce_add_nxv4i16'
675; CHECK-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %red = call i16 @llvm.vector.reduce.add.nxv4i16(<vscale x 4 x i16> %v)
676; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %red
677;
678; SIZE-LABEL: 'vreduce_add_nxv4i16'
679; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i16 @llvm.vector.reduce.add.nxv4i16(<vscale x 4 x i16> %v)
680; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i16 %red
681;
682  %red = call i16 @llvm.vector.reduce.add.nxv4i16(<vscale x 4 x i16> %v)
683  ret i16 %red
684}
685
686define signext i16 @vwreduce_add_nxv4i8(<vscale x 4 x i8> %v) {
687; CHECK-LABEL: 'vwreduce_add_nxv4i8'
688; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %e = sext <vscale x 4 x i8> %v to <vscale x 4 x i16>
689; CHECK-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %red = call i16 @llvm.vector.reduce.add.nxv4i16(<vscale x 4 x i16> %e)
690; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %red
691;
692; SIZE-LABEL: 'vwreduce_add_nxv4i8'
693; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %e = sext <vscale x 4 x i8> %v to <vscale x 4 x i16>
694; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i16 @llvm.vector.reduce.add.nxv4i16(<vscale x 4 x i16> %e)
695; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i16 %red
696;
697  %e = sext <vscale x 4 x i8> %v to <vscale x 4 x i16>
698  %red = call i16 @llvm.vector.reduce.add.nxv4i16(<vscale x 4 x i16> %e)
699  ret i16 %red
700}
701
702define signext i16 @vwreduce_uadd_nxv4i8(<vscale x 4 x i8> %v) {
703; CHECK-LABEL: 'vwreduce_uadd_nxv4i8'
704; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %e = sext <vscale x 4 x i8> %v to <vscale x 4 x i16>
705; CHECK-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %red = call i16 @llvm.vector.reduce.add.nxv4i16(<vscale x 4 x i16> %e)
706; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %red
707;
708; SIZE-LABEL: 'vwreduce_uadd_nxv4i8'
709; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %e = sext <vscale x 4 x i8> %v to <vscale x 4 x i16>
710; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i16 @llvm.vector.reduce.add.nxv4i16(<vscale x 4 x i16> %e)
711; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i16 %red
712;
713  %e = sext <vscale x 4 x i8> %v to <vscale x 4 x i16>
714  %red = call i16 @llvm.vector.reduce.add.nxv4i16(<vscale x 4 x i16> %e)
715  ret i16 %red
716}
717
718declare i16 @llvm.vector.reduce.umax.nxv4i16(<vscale x 4 x i16>)
719
720define signext i16 @vreduce_umax_nxv4i16(<vscale x 4 x i16> %v) {
721; CHECK-LABEL: 'vreduce_umax_nxv4i16'
722; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %red = call i16 @llvm.vector.reduce.umax.nxv4i16(<vscale x 4 x i16> %v)
723; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %red
724;
725; SIZE-LABEL: 'vreduce_umax_nxv4i16'
726; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i16 @llvm.vector.reduce.umax.nxv4i16(<vscale x 4 x i16> %v)
727; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i16 %red
728;
729  %red = call i16 @llvm.vector.reduce.umax.nxv4i16(<vscale x 4 x i16> %v)
730  ret i16 %red
731}
732
733declare i16 @llvm.vector.reduce.smax.nxv4i16(<vscale x 4 x i16>)
734
735define signext i16 @vreduce_smax_nxv4i16(<vscale x 4 x i16> %v) {
736; CHECK-LABEL: 'vreduce_smax_nxv4i16'
737; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %red = call i16 @llvm.vector.reduce.smax.nxv4i16(<vscale x 4 x i16> %v)
738; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %red
739;
740; SIZE-LABEL: 'vreduce_smax_nxv4i16'
741; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i16 @llvm.vector.reduce.smax.nxv4i16(<vscale x 4 x i16> %v)
742; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i16 %red
743;
744  %red = call i16 @llvm.vector.reduce.smax.nxv4i16(<vscale x 4 x i16> %v)
745  ret i16 %red
746}
747
748declare i16 @llvm.vector.reduce.umin.nxv4i16(<vscale x 4 x i16>)
749
750define signext i16 @vreduce_umin_nxv4i16(<vscale x 4 x i16> %v) {
751; CHECK-LABEL: 'vreduce_umin_nxv4i16'
752; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %red = call i16 @llvm.vector.reduce.umin.nxv4i16(<vscale x 4 x i16> %v)
753; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %red
754;
755; SIZE-LABEL: 'vreduce_umin_nxv4i16'
756; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i16 @llvm.vector.reduce.umin.nxv4i16(<vscale x 4 x i16> %v)
757; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i16 %red
758;
759  %red = call i16 @llvm.vector.reduce.umin.nxv4i16(<vscale x 4 x i16> %v)
760  ret i16 %red
761}
762
763declare i16 @llvm.vector.reduce.smin.nxv4i16(<vscale x 4 x i16>)
764
765define signext i16 @vreduce_smin_nxv4i16(<vscale x 4 x i16> %v) {
766; CHECK-LABEL: 'vreduce_smin_nxv4i16'
767; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %red = call i16 @llvm.vector.reduce.smin.nxv4i16(<vscale x 4 x i16> %v)
768; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %red
769;
770; SIZE-LABEL: 'vreduce_smin_nxv4i16'
771; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i16 @llvm.vector.reduce.smin.nxv4i16(<vscale x 4 x i16> %v)
772; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i16 %red
773;
774  %red = call i16 @llvm.vector.reduce.smin.nxv4i16(<vscale x 4 x i16> %v)
775  ret i16 %red
776}
777
778declare i16 @llvm.vector.reduce.and.nxv4i16(<vscale x 4 x i16>)
779
780define signext i16 @vreduce_and_nxv4i16(<vscale x 4 x i16> %v) {
781; CHECK-LABEL: 'vreduce_and_nxv4i16'
782; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %red = call i16 @llvm.vector.reduce.and.nxv4i16(<vscale x 4 x i16> %v)
783; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %red
784;
785; SIZE-LABEL: 'vreduce_and_nxv4i16'
786; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i16 @llvm.vector.reduce.and.nxv4i16(<vscale x 4 x i16> %v)
787; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i16 %red
788;
789  %red = call i16 @llvm.vector.reduce.and.nxv4i16(<vscale x 4 x i16> %v)
790  ret i16 %red
791}
792
793declare i16 @llvm.vector.reduce.or.nxv4i16(<vscale x 4 x i16>)
794
795define signext i16 @vreduce_or_nxv4i16(<vscale x 4 x i16> %v) {
796; CHECK-LABEL: 'vreduce_or_nxv4i16'
797; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %red = call i16 @llvm.vector.reduce.or.nxv4i16(<vscale x 4 x i16> %v)
798; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %red
799;
800; SIZE-LABEL: 'vreduce_or_nxv4i16'
801; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i16 @llvm.vector.reduce.or.nxv4i16(<vscale x 4 x i16> %v)
802; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i16 %red
803;
804  %red = call i16 @llvm.vector.reduce.or.nxv4i16(<vscale x 4 x i16> %v)
805  ret i16 %red
806}
807
808declare i16 @llvm.vector.reduce.xor.nxv4i16(<vscale x 4 x i16>)
809
810define signext i16 @vreduce_xor_nxv4i16(<vscale x 4 x i16> %v) {
811; CHECK-LABEL: 'vreduce_xor_nxv4i16'
812; CHECK-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %red = call i16 @llvm.vector.reduce.xor.nxv4i16(<vscale x 4 x i16> %v)
813; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %red
814;
815; SIZE-LABEL: 'vreduce_xor_nxv4i16'
816; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i16 @llvm.vector.reduce.xor.nxv4i16(<vscale x 4 x i16> %v)
817; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i16 %red
818;
819  %red = call i16 @llvm.vector.reduce.xor.nxv4i16(<vscale x 4 x i16> %v)
820  ret i16 %red
821}
822
823declare i32 @llvm.vector.reduce.add.nxv1i32(<vscale x 1 x i32>)
824
825define signext i32 @vreduce_add_nxv1i32(<vscale x 1 x i32> %v) {
826; CHECK-LABEL: 'vreduce_add_nxv1i32'
827; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i32 @llvm.vector.reduce.add.nxv1i32(<vscale x 1 x i32> %v)
828; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %red
829;
830; SIZE-LABEL: 'vreduce_add_nxv1i32'
831; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i32 @llvm.vector.reduce.add.nxv1i32(<vscale x 1 x i32> %v)
832; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %red
833;
834  %red = call i32 @llvm.vector.reduce.add.nxv1i32(<vscale x 1 x i32> %v)
835  ret i32 %red
836}
837
838define signext i32 @vwreduce_add_nxv1i16(<vscale x 1 x i16> %v) {
839; CHECK-LABEL: 'vwreduce_add_nxv1i16'
840; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %e = sext <vscale x 1 x i16> %v to <vscale x 1 x i32>
841; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i32 @llvm.vector.reduce.add.nxv1i32(<vscale x 1 x i32> %e)
842; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %red
843;
844; SIZE-LABEL: 'vwreduce_add_nxv1i16'
845; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %e = sext <vscale x 1 x i16> %v to <vscale x 1 x i32>
846; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i32 @llvm.vector.reduce.add.nxv1i32(<vscale x 1 x i32> %e)
847; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %red
848;
849  %e = sext <vscale x 1 x i16> %v to <vscale x 1 x i32>
850  %red = call i32 @llvm.vector.reduce.add.nxv1i32(<vscale x 1 x i32> %e)
851  ret i32 %red
852}
853
854define signext i32 @vwreduce_uadd_nxv1i16(<vscale x 1 x i16> %v) {
855; CHECK-LABEL: 'vwreduce_uadd_nxv1i16'
856; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %e = zext <vscale x 1 x i16> %v to <vscale x 1 x i32>
857; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i32 @llvm.vector.reduce.add.nxv1i32(<vscale x 1 x i32> %e)
858; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %red
859;
860; SIZE-LABEL: 'vwreduce_uadd_nxv1i16'
861; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %e = zext <vscale x 1 x i16> %v to <vscale x 1 x i32>
862; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i32 @llvm.vector.reduce.add.nxv1i32(<vscale x 1 x i32> %e)
863; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %red
864;
865  %e = zext <vscale x 1 x i16> %v to <vscale x 1 x i32>
866  %red = call i32 @llvm.vector.reduce.add.nxv1i32(<vscale x 1 x i32> %e)
867  ret i32 %red
868}
869
870declare i32 @llvm.vector.reduce.umax.nxv1i32(<vscale x 1 x i32>)
871
872define signext i32 @vreduce_umax_nxv1i32(<vscale x 1 x i32> %v) {
873; CHECK-LABEL: 'vreduce_umax_nxv1i32'
874; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i32 @llvm.vector.reduce.umax.nxv1i32(<vscale x 1 x i32> %v)
875; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %red
876;
877; SIZE-LABEL: 'vreduce_umax_nxv1i32'
878; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i32 @llvm.vector.reduce.umax.nxv1i32(<vscale x 1 x i32> %v)
879; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %red
880;
881  %red = call i32 @llvm.vector.reduce.umax.nxv1i32(<vscale x 1 x i32> %v)
882  ret i32 %red
883}
884
885declare i32 @llvm.vector.reduce.smax.nxv1i32(<vscale x 1 x i32>)
886
887define signext i32 @vreduce_smax_nxv1i32(<vscale x 1 x i32> %v) {
888; CHECK-LABEL: 'vreduce_smax_nxv1i32'
889; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i32 @llvm.vector.reduce.smax.nxv1i32(<vscale x 1 x i32> %v)
890; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %red
891;
892; SIZE-LABEL: 'vreduce_smax_nxv1i32'
893; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i32 @llvm.vector.reduce.smax.nxv1i32(<vscale x 1 x i32> %v)
894; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %red
895;
896  %red = call i32 @llvm.vector.reduce.smax.nxv1i32(<vscale x 1 x i32> %v)
897  ret i32 %red
898}
899
900declare i32 @llvm.vector.reduce.umin.nxv1i32(<vscale x 1 x i32>)
901
902define signext i32 @vreduce_umin_nxv1i32(<vscale x 1 x i32> %v) {
903; CHECK-LABEL: 'vreduce_umin_nxv1i32'
904; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i32 @llvm.vector.reduce.umin.nxv1i32(<vscale x 1 x i32> %v)
905; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %red
906;
907; SIZE-LABEL: 'vreduce_umin_nxv1i32'
908; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i32 @llvm.vector.reduce.umin.nxv1i32(<vscale x 1 x i32> %v)
909; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %red
910;
911  %red = call i32 @llvm.vector.reduce.umin.nxv1i32(<vscale x 1 x i32> %v)
912  ret i32 %red
913}
914
915declare i32 @llvm.vector.reduce.smin.nxv1i32(<vscale x 1 x i32>)
916
917define signext i32 @vreduce_smin_nxv1i32(<vscale x 1 x i32> %v) {
918; CHECK-LABEL: 'vreduce_smin_nxv1i32'
919; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i32 @llvm.vector.reduce.smin.nxv1i32(<vscale x 1 x i32> %v)
920; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %red
921;
922; SIZE-LABEL: 'vreduce_smin_nxv1i32'
923; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i32 @llvm.vector.reduce.smin.nxv1i32(<vscale x 1 x i32> %v)
924; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %red
925;
926  %red = call i32 @llvm.vector.reduce.smin.nxv1i32(<vscale x 1 x i32> %v)
927  ret i32 %red
928}
929
930declare i32 @llvm.vector.reduce.and.nxv1i32(<vscale x 1 x i32>)
931
932define signext i32 @vreduce_and_nxv1i32(<vscale x 1 x i32> %v) {
933; CHECK-LABEL: 'vreduce_and_nxv1i32'
934; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i32 @llvm.vector.reduce.and.nxv1i32(<vscale x 1 x i32> %v)
935; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %red
936;
937; SIZE-LABEL: 'vreduce_and_nxv1i32'
938; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i32 @llvm.vector.reduce.and.nxv1i32(<vscale x 1 x i32> %v)
939; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %red
940;
941  %red = call i32 @llvm.vector.reduce.and.nxv1i32(<vscale x 1 x i32> %v)
942  ret i32 %red
943}
944
945declare i32 @llvm.vector.reduce.or.nxv1i32(<vscale x 1 x i32>)
946
947define signext i32 @vreduce_or_nxv1i32(<vscale x 1 x i32> %v) {
948; CHECK-LABEL: 'vreduce_or_nxv1i32'
949; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i32 @llvm.vector.reduce.or.nxv1i32(<vscale x 1 x i32> %v)
950; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %red
951;
952; SIZE-LABEL: 'vreduce_or_nxv1i32'
953; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i32 @llvm.vector.reduce.or.nxv1i32(<vscale x 1 x i32> %v)
954; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %red
955;
956  %red = call i32 @llvm.vector.reduce.or.nxv1i32(<vscale x 1 x i32> %v)
957  ret i32 %red
958}
959
960declare i32 @llvm.vector.reduce.xor.nxv1i32(<vscale x 1 x i32>)
961
962define signext i32 @vreduce_xor_nxv1i32(<vscale x 1 x i32> %v) {
963; CHECK-LABEL: 'vreduce_xor_nxv1i32'
964; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i32 @llvm.vector.reduce.xor.nxv1i32(<vscale x 1 x i32> %v)
965; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %red
966;
967; SIZE-LABEL: 'vreduce_xor_nxv1i32'
968; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i32 @llvm.vector.reduce.xor.nxv1i32(<vscale x 1 x i32> %v)
969; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %red
970;
971  %red = call i32 @llvm.vector.reduce.xor.nxv1i32(<vscale x 1 x i32> %v)
972  ret i32 %red
973}
974
975declare i32 @llvm.vector.reduce.add.nxv2i32(<vscale x 2 x i32>)
976
977define signext i32 @vreduce_add_nxv2i32(<vscale x 2 x i32> %v) {
978; CHECK-LABEL: 'vreduce_add_nxv2i32'
979; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %red = call i32 @llvm.vector.reduce.add.nxv2i32(<vscale x 2 x i32> %v)
980; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %red
981;
982; SIZE-LABEL: 'vreduce_add_nxv2i32'
983; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i32 @llvm.vector.reduce.add.nxv2i32(<vscale x 2 x i32> %v)
984; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %red
985;
986  %red = call i32 @llvm.vector.reduce.add.nxv2i32(<vscale x 2 x i32> %v)
987  ret i32 %red
988}
989
990define signext i32 @vwreduce_add_nxv2i16(<vscale x 2 x i16> %v) {
991; CHECK-LABEL: 'vwreduce_add_nxv2i16'
992; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %e = sext <vscale x 2 x i16> %v to <vscale x 2 x i32>
993; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %red = call i32 @llvm.vector.reduce.add.nxv2i32(<vscale x 2 x i32> %e)
994; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %red
995;
996; SIZE-LABEL: 'vwreduce_add_nxv2i16'
997; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %e = sext <vscale x 2 x i16> %v to <vscale x 2 x i32>
998; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i32 @llvm.vector.reduce.add.nxv2i32(<vscale x 2 x i32> %e)
999; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %red
1000;
1001  %e = sext <vscale x 2 x i16> %v to <vscale x 2 x i32>
1002  %red = call i32 @llvm.vector.reduce.add.nxv2i32(<vscale x 2 x i32> %e)
1003  ret i32 %red
1004}
1005
1006define signext i32 @vwreduce_uadd_nxv2i16(<vscale x 2 x i16> %v) {
1007; CHECK-LABEL: 'vwreduce_uadd_nxv2i16'
1008; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %e = zext <vscale x 2 x i16> %v to <vscale x 2 x i32>
1009; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %red = call i32 @llvm.vector.reduce.add.nxv2i32(<vscale x 2 x i32> %e)
1010; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %red
1011;
1012; SIZE-LABEL: 'vwreduce_uadd_nxv2i16'
1013; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %e = zext <vscale x 2 x i16> %v to <vscale x 2 x i32>
1014; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i32 @llvm.vector.reduce.add.nxv2i32(<vscale x 2 x i32> %e)
1015; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %red
1016;
1017  %e = zext <vscale x 2 x i16> %v to <vscale x 2 x i32>
1018  %red = call i32 @llvm.vector.reduce.add.nxv2i32(<vscale x 2 x i32> %e)
1019  ret i32 %red
1020}
1021
1022declare i32 @llvm.vector.reduce.umax.nxv2i32(<vscale x 2 x i32>)
1023
1024define signext i32 @vreduce_umax_nxv2i32(<vscale x 2 x i32> %v) {
1025; CHECK-LABEL: 'vreduce_umax_nxv2i32'
1026; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i32 @llvm.vector.reduce.umax.nxv2i32(<vscale x 2 x i32> %v)
1027; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %red
1028;
1029; SIZE-LABEL: 'vreduce_umax_nxv2i32'
1030; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i32 @llvm.vector.reduce.umax.nxv2i32(<vscale x 2 x i32> %v)
1031; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %red
1032;
1033  %red = call i32 @llvm.vector.reduce.umax.nxv2i32(<vscale x 2 x i32> %v)
1034  ret i32 %red
1035}
1036
1037declare i32 @llvm.vector.reduce.smax.nxv2i32(<vscale x 2 x i32>)
1038
1039define signext i32 @vreduce_smax_nxv2i32(<vscale x 2 x i32> %v) {
1040; CHECK-LABEL: 'vreduce_smax_nxv2i32'
1041; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i32 @llvm.vector.reduce.smax.nxv2i32(<vscale x 2 x i32> %v)
1042; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %red
1043;
1044; SIZE-LABEL: 'vreduce_smax_nxv2i32'
1045; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i32 @llvm.vector.reduce.smax.nxv2i32(<vscale x 2 x i32> %v)
1046; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %red
1047;
1048  %red = call i32 @llvm.vector.reduce.smax.nxv2i32(<vscale x 2 x i32> %v)
1049  ret i32 %red
1050}
1051
1052declare i32 @llvm.vector.reduce.umin.nxv2i32(<vscale x 2 x i32>)
1053
1054define signext i32 @vreduce_umin_nxv2i32(<vscale x 2 x i32> %v) {
1055; CHECK-LABEL: 'vreduce_umin_nxv2i32'
1056; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i32 @llvm.vector.reduce.umin.nxv2i32(<vscale x 2 x i32> %v)
1057; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %red
1058;
1059; SIZE-LABEL: 'vreduce_umin_nxv2i32'
1060; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i32 @llvm.vector.reduce.umin.nxv2i32(<vscale x 2 x i32> %v)
1061; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %red
1062;
1063  %red = call i32 @llvm.vector.reduce.umin.nxv2i32(<vscale x 2 x i32> %v)
1064  ret i32 %red
1065}
1066
1067declare i32 @llvm.vector.reduce.smin.nxv2i32(<vscale x 2 x i32>)
1068
1069define signext i32 @vreduce_smin_nxv2i32(<vscale x 2 x i32> %v) {
1070; CHECK-LABEL: 'vreduce_smin_nxv2i32'
1071; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i32 @llvm.vector.reduce.smin.nxv2i32(<vscale x 2 x i32> %v)
1072; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %red
1073;
1074; SIZE-LABEL: 'vreduce_smin_nxv2i32'
1075; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i32 @llvm.vector.reduce.smin.nxv2i32(<vscale x 2 x i32> %v)
1076; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %red
1077;
1078  %red = call i32 @llvm.vector.reduce.smin.nxv2i32(<vscale x 2 x i32> %v)
1079  ret i32 %red
1080}
1081
1082declare i32 @llvm.vector.reduce.and.nxv2i32(<vscale x 2 x i32>)
1083
1084define signext i32 @vreduce_and_nxv2i32(<vscale x 2 x i32> %v) {
1085; CHECK-LABEL: 'vreduce_and_nxv2i32'
1086; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i32 @llvm.vector.reduce.and.nxv2i32(<vscale x 2 x i32> %v)
1087; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %red
1088;
1089; SIZE-LABEL: 'vreduce_and_nxv2i32'
1090; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i32 @llvm.vector.reduce.and.nxv2i32(<vscale x 2 x i32> %v)
1091; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %red
1092;
1093  %red = call i32 @llvm.vector.reduce.and.nxv2i32(<vscale x 2 x i32> %v)
1094  ret i32 %red
1095}
1096
1097declare i32 @llvm.vector.reduce.or.nxv2i32(<vscale x 2 x i32>)
1098
1099define signext i32 @vreduce_or_nxv2i32(<vscale x 2 x i32> %v) {
1100; CHECK-LABEL: 'vreduce_or_nxv2i32'
1101; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i32 @llvm.vector.reduce.or.nxv2i32(<vscale x 2 x i32> %v)
1102; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %red
1103;
1104; SIZE-LABEL: 'vreduce_or_nxv2i32'
1105; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i32 @llvm.vector.reduce.or.nxv2i32(<vscale x 2 x i32> %v)
1106; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %red
1107;
1108  %red = call i32 @llvm.vector.reduce.or.nxv2i32(<vscale x 2 x i32> %v)
1109  ret i32 %red
1110}
1111
1112declare i32 @llvm.vector.reduce.xor.nxv2i32(<vscale x 2 x i32>)
1113
1114define signext i32 @vreduce_xor_nxv2i32(<vscale x 2 x i32> %v) {
1115; CHECK-LABEL: 'vreduce_xor_nxv2i32'
1116; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %red = call i32 @llvm.vector.reduce.xor.nxv2i32(<vscale x 2 x i32> %v)
1117; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %red
1118;
1119; SIZE-LABEL: 'vreduce_xor_nxv2i32'
1120; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i32 @llvm.vector.reduce.xor.nxv2i32(<vscale x 2 x i32> %v)
1121; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %red
1122;
1123  %red = call i32 @llvm.vector.reduce.xor.nxv2i32(<vscale x 2 x i32> %v)
1124  ret i32 %red
1125}
1126
1127declare i32 @llvm.vector.reduce.add.nxv4i32(<vscale x 4 x i32>)
1128
1129define signext i32 @vreduce_add_nxv4i32(<vscale x 4 x i32> %v) {
1130; CHECK-LABEL: 'vreduce_add_nxv4i32'
1131; CHECK-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %red = call i32 @llvm.vector.reduce.add.nxv4i32(<vscale x 4 x i32> %v)
1132; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %red
1133;
1134; SIZE-LABEL: 'vreduce_add_nxv4i32'
1135; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i32 @llvm.vector.reduce.add.nxv4i32(<vscale x 4 x i32> %v)
1136; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %red
1137;
1138  %red = call i32 @llvm.vector.reduce.add.nxv4i32(<vscale x 4 x i32> %v)
1139  ret i32 %red
1140}
1141
1142define signext i32 @vwreduce_add_nxv4i16(<vscale x 4 x i16> %v) {
1143; CHECK-LABEL: 'vwreduce_add_nxv4i16'
1144; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %e = sext <vscale x 4 x i16> %v to <vscale x 4 x i32>
1145; CHECK-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %red = call i32 @llvm.vector.reduce.add.nxv4i32(<vscale x 4 x i32> %e)
1146; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %red
1147;
1148; SIZE-LABEL: 'vwreduce_add_nxv4i16'
1149; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %e = sext <vscale x 4 x i16> %v to <vscale x 4 x i32>
1150; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i32 @llvm.vector.reduce.add.nxv4i32(<vscale x 4 x i32> %e)
1151; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %red
1152;
1153  %e = sext <vscale x 4 x i16> %v to <vscale x 4 x i32>
1154  %red = call i32 @llvm.vector.reduce.add.nxv4i32(<vscale x 4 x i32> %e)
1155  ret i32 %red
1156}
1157
1158define signext i32 @vwreduce_uadd_nxv4i16(<vscale x 4 x i16> %v) {
1159; CHECK-LABEL: 'vwreduce_uadd_nxv4i16'
1160; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %e = zext <vscale x 4 x i16> %v to <vscale x 4 x i32>
1161; CHECK-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %red = call i32 @llvm.vector.reduce.add.nxv4i32(<vscale x 4 x i32> %e)
1162; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %red
1163;
1164; SIZE-LABEL: 'vwreduce_uadd_nxv4i16'
1165; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %e = zext <vscale x 4 x i16> %v to <vscale x 4 x i32>
1166; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i32 @llvm.vector.reduce.add.nxv4i32(<vscale x 4 x i32> %e)
1167; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %red
1168;
1169  %e = zext <vscale x 4 x i16> %v to <vscale x 4 x i32>
1170  %red = call i32 @llvm.vector.reduce.add.nxv4i32(<vscale x 4 x i32> %e)
1171  ret i32 %red
1172}
1173
1174declare i32 @llvm.vector.reduce.umax.nxv4i32(<vscale x 4 x i32>)
1175
1176define signext i32 @vreduce_umax_nxv4i32(<vscale x 4 x i32> %v) {
1177; CHECK-LABEL: 'vreduce_umax_nxv4i32'
1178; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %red = call i32 @llvm.vector.reduce.umax.nxv4i32(<vscale x 4 x i32> %v)
1179; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %red
1180;
1181; SIZE-LABEL: 'vreduce_umax_nxv4i32'
1182; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i32 @llvm.vector.reduce.umax.nxv4i32(<vscale x 4 x i32> %v)
1183; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %red
1184;
1185  %red = call i32 @llvm.vector.reduce.umax.nxv4i32(<vscale x 4 x i32> %v)
1186  ret i32 %red
1187}
1188
1189declare i32 @llvm.vector.reduce.smax.nxv4i32(<vscale x 4 x i32>)
1190
1191define signext i32 @vreduce_smax_nxv4i32(<vscale x 4 x i32> %v) {
1192; CHECK-LABEL: 'vreduce_smax_nxv4i32'
1193; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %red = call i32 @llvm.vector.reduce.smax.nxv4i32(<vscale x 4 x i32> %v)
1194; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %red
1195;
1196; SIZE-LABEL: 'vreduce_smax_nxv4i32'
1197; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i32 @llvm.vector.reduce.smax.nxv4i32(<vscale x 4 x i32> %v)
1198; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %red
1199;
1200  %red = call i32 @llvm.vector.reduce.smax.nxv4i32(<vscale x 4 x i32> %v)
1201  ret i32 %red
1202}
1203
1204declare i32 @llvm.vector.reduce.umin.nxv4i32(<vscale x 4 x i32>)
1205
1206define signext i32 @vreduce_umin_nxv4i32(<vscale x 4 x i32> %v) {
1207; CHECK-LABEL: 'vreduce_umin_nxv4i32'
1208; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %red = call i32 @llvm.vector.reduce.umin.nxv4i32(<vscale x 4 x i32> %v)
1209; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %red
1210;
1211; SIZE-LABEL: 'vreduce_umin_nxv4i32'
1212; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i32 @llvm.vector.reduce.umin.nxv4i32(<vscale x 4 x i32> %v)
1213; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %red
1214;
1215  %red = call i32 @llvm.vector.reduce.umin.nxv4i32(<vscale x 4 x i32> %v)
1216  ret i32 %red
1217}
1218
1219declare i32 @llvm.vector.reduce.smin.nxv4i32(<vscale x 4 x i32>)
1220
1221define signext i32 @vreduce_smin_nxv4i32(<vscale x 4 x i32> %v) {
1222; CHECK-LABEL: 'vreduce_smin_nxv4i32'
1223; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %red = call i32 @llvm.vector.reduce.smin.nxv4i32(<vscale x 4 x i32> %v)
1224; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %red
1225;
1226; SIZE-LABEL: 'vreduce_smin_nxv4i32'
1227; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i32 @llvm.vector.reduce.smin.nxv4i32(<vscale x 4 x i32> %v)
1228; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %red
1229;
1230  %red = call i32 @llvm.vector.reduce.smin.nxv4i32(<vscale x 4 x i32> %v)
1231  ret i32 %red
1232}
1233
1234declare i32 @llvm.vector.reduce.and.nxv4i32(<vscale x 4 x i32>)
1235
1236define signext i32 @vreduce_and_nxv4i32(<vscale x 4 x i32> %v) {
1237; CHECK-LABEL: 'vreduce_and_nxv4i32'
1238; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %red = call i32 @llvm.vector.reduce.and.nxv4i32(<vscale x 4 x i32> %v)
1239; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %red
1240;
1241; SIZE-LABEL: 'vreduce_and_nxv4i32'
1242; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i32 @llvm.vector.reduce.and.nxv4i32(<vscale x 4 x i32> %v)
1243; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %red
1244;
1245  %red = call i32 @llvm.vector.reduce.and.nxv4i32(<vscale x 4 x i32> %v)
1246  ret i32 %red
1247}
1248
1249declare i32 @llvm.vector.reduce.or.nxv4i32(<vscale x 4 x i32>)
1250
1251define signext i32 @vreduce_or_nxv4i32(<vscale x 4 x i32> %v) {
1252; CHECK-LABEL: 'vreduce_or_nxv4i32'
1253; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %red = call i32 @llvm.vector.reduce.or.nxv4i32(<vscale x 4 x i32> %v)
1254; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %red
1255;
1256; SIZE-LABEL: 'vreduce_or_nxv4i32'
1257; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i32 @llvm.vector.reduce.or.nxv4i32(<vscale x 4 x i32> %v)
1258; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %red
1259;
1260  %red = call i32 @llvm.vector.reduce.or.nxv4i32(<vscale x 4 x i32> %v)
1261  ret i32 %red
1262}
1263
1264declare i32 @llvm.vector.reduce.xor.nxv4i32(<vscale x 4 x i32>)
1265
1266define signext i32 @vreduce_xor_nxv4i32(<vscale x 4 x i32> %v) {
1267; CHECK-LABEL: 'vreduce_xor_nxv4i32'
1268; CHECK-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %red = call i32 @llvm.vector.reduce.xor.nxv4i32(<vscale x 4 x i32> %v)
1269; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %red
1270;
1271; SIZE-LABEL: 'vreduce_xor_nxv4i32'
1272; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i32 @llvm.vector.reduce.xor.nxv4i32(<vscale x 4 x i32> %v)
1273; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %red
1274;
1275  %red = call i32 @llvm.vector.reduce.xor.nxv4i32(<vscale x 4 x i32> %v)
1276  ret i32 %red
1277}
1278
1279declare i64 @llvm.vector.reduce.add.nxv1i64(<vscale x 1 x i64>)
1280
1281define i64 @vreduce_add_nxv1i64(<vscale x 1 x i64> %v) {
1282; CHECK-LABEL: 'vreduce_add_nxv1i64'
1283; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i64 @llvm.vector.reduce.add.nxv1i64(<vscale x 1 x i64> %v)
1284; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %red
1285;
1286; SIZE-LABEL: 'vreduce_add_nxv1i64'
1287; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i64 @llvm.vector.reduce.add.nxv1i64(<vscale x 1 x i64> %v)
1288; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %red
1289;
1290  %red = call i64 @llvm.vector.reduce.add.nxv1i64(<vscale x 1 x i64> %v)
1291  ret i64 %red
1292}
1293
1294define i64 @vwreduce_add_nxv1i32(<vscale x 1 x i32> %v) {
1295; CHECK-LABEL: 'vwreduce_add_nxv1i32'
1296; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %e = sext <vscale x 1 x i32> %v to <vscale x 1 x i64>
1297; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i64 @llvm.vector.reduce.add.nxv1i64(<vscale x 1 x i64> %e)
1298; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %red
1299;
1300; SIZE-LABEL: 'vwreduce_add_nxv1i32'
1301; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %e = sext <vscale x 1 x i32> %v to <vscale x 1 x i64>
1302; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i64 @llvm.vector.reduce.add.nxv1i64(<vscale x 1 x i64> %e)
1303; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %red
1304;
1305  %e = sext <vscale x 1 x i32> %v to <vscale x 1 x i64>
1306  %red = call i64 @llvm.vector.reduce.add.nxv1i64(<vscale x 1 x i64> %e)
1307  ret i64 %red
1308}
1309
1310define i64 @vwreduce_uadd_nxv1i32(<vscale x 1 x i32> %v) {
1311; CHECK-LABEL: 'vwreduce_uadd_nxv1i32'
1312; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %e = zext <vscale x 1 x i32> %v to <vscale x 1 x i64>
1313; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i64 @llvm.vector.reduce.add.nxv1i64(<vscale x 1 x i64> %e)
1314; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %red
1315;
1316; SIZE-LABEL: 'vwreduce_uadd_nxv1i32'
1317; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %e = zext <vscale x 1 x i32> %v to <vscale x 1 x i64>
1318; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i64 @llvm.vector.reduce.add.nxv1i64(<vscale x 1 x i64> %e)
1319; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %red
1320;
1321  %e = zext <vscale x 1 x i32> %v to <vscale x 1 x i64>
1322  %red = call i64 @llvm.vector.reduce.add.nxv1i64(<vscale x 1 x i64> %e)
1323  ret i64 %red
1324}
1325
1326declare i64 @llvm.vector.reduce.umax.nxv1i64(<vscale x 1 x i64>)
1327
1328define i64 @vreduce_umax_nxv1i64(<vscale x 1 x i64> %v) {
1329; CHECK-LABEL: 'vreduce_umax_nxv1i64'
1330; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i64 @llvm.vector.reduce.umax.nxv1i64(<vscale x 1 x i64> %v)
1331; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %red
1332;
1333; SIZE-LABEL: 'vreduce_umax_nxv1i64'
1334; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i64 @llvm.vector.reduce.umax.nxv1i64(<vscale x 1 x i64> %v)
1335; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %red
1336;
1337  %red = call i64 @llvm.vector.reduce.umax.nxv1i64(<vscale x 1 x i64> %v)
1338  ret i64 %red
1339}
1340
1341declare i64 @llvm.vector.reduce.smax.nxv1i64(<vscale x 1 x i64>)
1342
1343define i64 @vreduce_smax_nxv1i64(<vscale x 1 x i64> %v) {
1344; CHECK-LABEL: 'vreduce_smax_nxv1i64'
1345; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i64 @llvm.vector.reduce.smax.nxv1i64(<vscale x 1 x i64> %v)
1346; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %red
1347;
1348; SIZE-LABEL: 'vreduce_smax_nxv1i64'
1349; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i64 @llvm.vector.reduce.smax.nxv1i64(<vscale x 1 x i64> %v)
1350; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %red
1351;
1352  %red = call i64 @llvm.vector.reduce.smax.nxv1i64(<vscale x 1 x i64> %v)
1353  ret i64 %red
1354}
1355
1356declare i64 @llvm.vector.reduce.umin.nxv1i64(<vscale x 1 x i64>)
1357
1358define i64 @vreduce_umin_nxv1i64(<vscale x 1 x i64> %v) {
1359; CHECK-LABEL: 'vreduce_umin_nxv1i64'
1360; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i64 @llvm.vector.reduce.umin.nxv1i64(<vscale x 1 x i64> %v)
1361; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %red
1362;
1363; SIZE-LABEL: 'vreduce_umin_nxv1i64'
1364; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i64 @llvm.vector.reduce.umin.nxv1i64(<vscale x 1 x i64> %v)
1365; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %red
1366;
1367  %red = call i64 @llvm.vector.reduce.umin.nxv1i64(<vscale x 1 x i64> %v)
1368  ret i64 %red
1369}
1370
1371declare i64 @llvm.vector.reduce.smin.nxv1i64(<vscale x 1 x i64>)
1372
1373define i64 @vreduce_smin_nxv1i64(<vscale x 1 x i64> %v) {
1374; CHECK-LABEL: 'vreduce_smin_nxv1i64'
1375; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i64 @llvm.vector.reduce.smin.nxv1i64(<vscale x 1 x i64> %v)
1376; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %red
1377;
1378; SIZE-LABEL: 'vreduce_smin_nxv1i64'
1379; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i64 @llvm.vector.reduce.smin.nxv1i64(<vscale x 1 x i64> %v)
1380; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %red
1381;
1382  %red = call i64 @llvm.vector.reduce.smin.nxv1i64(<vscale x 1 x i64> %v)
1383  ret i64 %red
1384}
1385
1386declare i64 @llvm.vector.reduce.and.nxv1i64(<vscale x 1 x i64>)
1387
1388define i64 @vreduce_and_nxv1i64(<vscale x 1 x i64> %v) {
1389; CHECK-LABEL: 'vreduce_and_nxv1i64'
1390; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i64 @llvm.vector.reduce.and.nxv1i64(<vscale x 1 x i64> %v)
1391; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %red
1392;
1393; SIZE-LABEL: 'vreduce_and_nxv1i64'
1394; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i64 @llvm.vector.reduce.and.nxv1i64(<vscale x 1 x i64> %v)
1395; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %red
1396;
1397  %red = call i64 @llvm.vector.reduce.and.nxv1i64(<vscale x 1 x i64> %v)
1398  ret i64 %red
1399}
1400
1401declare i64 @llvm.vector.reduce.or.nxv1i64(<vscale x 1 x i64>)
1402
1403define i64 @vreduce_or_nxv1i64(<vscale x 1 x i64> %v) {
1404; CHECK-LABEL: 'vreduce_or_nxv1i64'
1405; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i64 @llvm.vector.reduce.or.nxv1i64(<vscale x 1 x i64> %v)
1406; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %red
1407;
1408; SIZE-LABEL: 'vreduce_or_nxv1i64'
1409; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i64 @llvm.vector.reduce.or.nxv1i64(<vscale x 1 x i64> %v)
1410; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %red
1411;
1412  %red = call i64 @llvm.vector.reduce.or.nxv1i64(<vscale x 1 x i64> %v)
1413  ret i64 %red
1414}
1415
1416declare i64 @llvm.vector.reduce.xor.nxv1i64(<vscale x 1 x i64>)
1417
1418define i64 @vreduce_xor_nxv1i64(<vscale x 1 x i64> %v) {
1419; CHECK-LABEL: 'vreduce_xor_nxv1i64'
1420; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i64 @llvm.vector.reduce.xor.nxv1i64(<vscale x 1 x i64> %v)
1421; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %red
1422;
1423; SIZE-LABEL: 'vreduce_xor_nxv1i64'
1424; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i64 @llvm.vector.reduce.xor.nxv1i64(<vscale x 1 x i64> %v)
1425; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %red
1426;
1427  %red = call i64 @llvm.vector.reduce.xor.nxv1i64(<vscale x 1 x i64> %v)
1428  ret i64 %red
1429}
1430
1431declare i64 @llvm.vector.reduce.add.nxv2i64(<vscale x 2 x i64>)
1432
1433define i64 @vreduce_add_nxv2i64(<vscale x 2 x i64> %v) {
1434; CHECK-LABEL: 'vreduce_add_nxv2i64'
1435; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %red = call i64 @llvm.vector.reduce.add.nxv2i64(<vscale x 2 x i64> %v)
1436; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %red
1437;
1438; SIZE-LABEL: 'vreduce_add_nxv2i64'
1439; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i64 @llvm.vector.reduce.add.nxv2i64(<vscale x 2 x i64> %v)
1440; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %red
1441;
1442  %red = call i64 @llvm.vector.reduce.add.nxv2i64(<vscale x 2 x i64> %v)
1443  ret i64 %red
1444}
1445
1446define i64 @vwreduce_add_nxv2i32(<vscale x 2 x i32> %v) {
1447; CHECK-LABEL: 'vwreduce_add_nxv2i32'
1448; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %e = sext <vscale x 2 x i32> %v to <vscale x 2 x i64>
1449; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %red = call i64 @llvm.vector.reduce.add.nxv2i64(<vscale x 2 x i64> %e)
1450; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %red
1451;
1452; SIZE-LABEL: 'vwreduce_add_nxv2i32'
1453; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %e = sext <vscale x 2 x i32> %v to <vscale x 2 x i64>
1454; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i64 @llvm.vector.reduce.add.nxv2i64(<vscale x 2 x i64> %e)
1455; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %red
1456;
1457  %e = sext <vscale x 2 x i32> %v to <vscale x 2 x i64>
1458  %red = call i64 @llvm.vector.reduce.add.nxv2i64(<vscale x 2 x i64> %e)
1459  ret i64 %red
1460}
1461
1462define i64 @vwreduce_uadd_nxv2i32(<vscale x 2 x i32> %v) {
1463; CHECK-LABEL: 'vwreduce_uadd_nxv2i32'
1464; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %e = zext <vscale x 2 x i32> %v to <vscale x 2 x i64>
1465; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %red = call i64 @llvm.vector.reduce.add.nxv2i64(<vscale x 2 x i64> %e)
1466; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %red
1467;
1468; SIZE-LABEL: 'vwreduce_uadd_nxv2i32'
1469; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %e = zext <vscale x 2 x i32> %v to <vscale x 2 x i64>
1470; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i64 @llvm.vector.reduce.add.nxv2i64(<vscale x 2 x i64> %e)
1471; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %red
1472;
1473  %e = zext <vscale x 2 x i32> %v to <vscale x 2 x i64>
1474  %red = call i64 @llvm.vector.reduce.add.nxv2i64(<vscale x 2 x i64> %e)
1475  ret i64 %red
1476}
1477
1478declare i64 @llvm.vector.reduce.umax.nxv2i64(<vscale x 2 x i64>)
1479
1480define i64 @vreduce_umax_nxv2i64(<vscale x 2 x i64> %v) {
1481; CHECK-LABEL: 'vreduce_umax_nxv2i64'
1482; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i64 @llvm.vector.reduce.umax.nxv2i64(<vscale x 2 x i64> %v)
1483; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %red
1484;
1485; SIZE-LABEL: 'vreduce_umax_nxv2i64'
1486; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i64 @llvm.vector.reduce.umax.nxv2i64(<vscale x 2 x i64> %v)
1487; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %red
1488;
1489  %red = call i64 @llvm.vector.reduce.umax.nxv2i64(<vscale x 2 x i64> %v)
1490  ret i64 %red
1491}
1492
1493declare i64 @llvm.vector.reduce.smax.nxv2i64(<vscale x 2 x i64>)
1494
1495define i64 @vreduce_smax_nxv2i64(<vscale x 2 x i64> %v) {
1496; CHECK-LABEL: 'vreduce_smax_nxv2i64'
1497; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i64 @llvm.vector.reduce.smax.nxv2i64(<vscale x 2 x i64> %v)
1498; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %red
1499;
1500; SIZE-LABEL: 'vreduce_smax_nxv2i64'
1501; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i64 @llvm.vector.reduce.smax.nxv2i64(<vscale x 2 x i64> %v)
1502; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %red
1503;
1504  %red = call i64 @llvm.vector.reduce.smax.nxv2i64(<vscale x 2 x i64> %v)
1505  ret i64 %red
1506}
1507
1508declare i64 @llvm.vector.reduce.umin.nxv2i64(<vscale x 2 x i64>)
1509
1510define i64 @vreduce_umin_nxv2i64(<vscale x 2 x i64> %v) {
1511; CHECK-LABEL: 'vreduce_umin_nxv2i64'
1512; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i64 @llvm.vector.reduce.umin.nxv2i64(<vscale x 2 x i64> %v)
1513; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %red
1514;
1515; SIZE-LABEL: 'vreduce_umin_nxv2i64'
1516; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i64 @llvm.vector.reduce.umin.nxv2i64(<vscale x 2 x i64> %v)
1517; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %red
1518;
1519  %red = call i64 @llvm.vector.reduce.umin.nxv2i64(<vscale x 2 x i64> %v)
1520  ret i64 %red
1521}
1522
1523declare i64 @llvm.vector.reduce.smin.nxv2i64(<vscale x 2 x i64>)
1524
1525define i64 @vreduce_smin_nxv2i64(<vscale x 2 x i64> %v) {
1526; CHECK-LABEL: 'vreduce_smin_nxv2i64'
1527; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i64 @llvm.vector.reduce.smin.nxv2i64(<vscale x 2 x i64> %v)
1528; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %red
1529;
1530; SIZE-LABEL: 'vreduce_smin_nxv2i64'
1531; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i64 @llvm.vector.reduce.smin.nxv2i64(<vscale x 2 x i64> %v)
1532; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %red
1533;
1534  %red = call i64 @llvm.vector.reduce.smin.nxv2i64(<vscale x 2 x i64> %v)
1535  ret i64 %red
1536}
1537
1538declare i64 @llvm.vector.reduce.and.nxv2i64(<vscale x 2 x i64>)
1539
1540define i64 @vreduce_and_nxv2i64(<vscale x 2 x i64> %v) {
1541; CHECK-LABEL: 'vreduce_and_nxv2i64'
1542; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i64 @llvm.vector.reduce.and.nxv2i64(<vscale x 2 x i64> %v)
1543; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %red
1544;
1545; SIZE-LABEL: 'vreduce_and_nxv2i64'
1546; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i64 @llvm.vector.reduce.and.nxv2i64(<vscale x 2 x i64> %v)
1547; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %red
1548;
1549  %red = call i64 @llvm.vector.reduce.and.nxv2i64(<vscale x 2 x i64> %v)
1550  ret i64 %red
1551}
1552
1553declare i64 @llvm.vector.reduce.or.nxv2i64(<vscale x 2 x i64>)
1554
1555define i64 @vreduce_or_nxv2i64(<vscale x 2 x i64> %v) {
1556; CHECK-LABEL: 'vreduce_or_nxv2i64'
1557; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i64 @llvm.vector.reduce.or.nxv2i64(<vscale x 2 x i64> %v)
1558; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %red
1559;
1560; SIZE-LABEL: 'vreduce_or_nxv2i64'
1561; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i64 @llvm.vector.reduce.or.nxv2i64(<vscale x 2 x i64> %v)
1562; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %red
1563;
1564  %red = call i64 @llvm.vector.reduce.or.nxv2i64(<vscale x 2 x i64> %v)
1565  ret i64 %red
1566}
1567
1568declare i64 @llvm.vector.reduce.xor.nxv2i64(<vscale x 2 x i64>)
1569
1570define i64 @vreduce_xor_nxv2i64(<vscale x 2 x i64> %v) {
1571; CHECK-LABEL: 'vreduce_xor_nxv2i64'
1572; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %red = call i64 @llvm.vector.reduce.xor.nxv2i64(<vscale x 2 x i64> %v)
1573; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %red
1574;
1575; SIZE-LABEL: 'vreduce_xor_nxv2i64'
1576; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i64 @llvm.vector.reduce.xor.nxv2i64(<vscale x 2 x i64> %v)
1577; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %red
1578;
1579  %red = call i64 @llvm.vector.reduce.xor.nxv2i64(<vscale x 2 x i64> %v)
1580  ret i64 %red
1581}
1582
1583declare i64 @llvm.vector.reduce.add.nxv4i64(<vscale x 4 x i64>)
1584
1585define i64 @vreduce_add_nxv4i64(<vscale x 4 x i64> %v) {
1586; CHECK-LABEL: 'vreduce_add_nxv4i64'
1587; CHECK-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %red = call i64 @llvm.vector.reduce.add.nxv4i64(<vscale x 4 x i64> %v)
1588; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %red
1589;
1590; SIZE-LABEL: 'vreduce_add_nxv4i64'
1591; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i64 @llvm.vector.reduce.add.nxv4i64(<vscale x 4 x i64> %v)
1592; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %red
1593;
1594  %red = call i64 @llvm.vector.reduce.add.nxv4i64(<vscale x 4 x i64> %v)
1595  ret i64 %red
1596}
1597
1598define i64 @vwreduce_add_nxv4i32(<vscale x 4 x i32> %v) {
1599; CHECK-LABEL: 'vwreduce_add_nxv4i32'
1600; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %e = sext <vscale x 4 x i32> %v to <vscale x 4 x i64>
1601; CHECK-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %red = call i64 @llvm.vector.reduce.add.nxv4i64(<vscale x 4 x i64> %e)
1602; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %red
1603;
1604; SIZE-LABEL: 'vwreduce_add_nxv4i32'
1605; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %e = sext <vscale x 4 x i32> %v to <vscale x 4 x i64>
1606; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i64 @llvm.vector.reduce.add.nxv4i64(<vscale x 4 x i64> %e)
1607; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %red
1608;
1609  %e = sext <vscale x 4 x i32> %v to <vscale x 4 x i64>
1610  %red = call i64 @llvm.vector.reduce.add.nxv4i64(<vscale x 4 x i64> %e)
1611  ret i64 %red
1612}
1613
1614define i64 @vwreduce_uadd_nxv4i32(<vscale x 4 x i32> %v) {
1615; CHECK-LABEL: 'vwreduce_uadd_nxv4i32'
1616; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %e = zext <vscale x 4 x i32> %v to <vscale x 4 x i64>
1617; CHECK-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %red = call i64 @llvm.vector.reduce.add.nxv4i64(<vscale x 4 x i64> %e)
1618; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %red
1619;
1620; SIZE-LABEL: 'vwreduce_uadd_nxv4i32'
1621; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %e = zext <vscale x 4 x i32> %v to <vscale x 4 x i64>
1622; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i64 @llvm.vector.reduce.add.nxv4i64(<vscale x 4 x i64> %e)
1623; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %red
1624;
1625  %e = zext <vscale x 4 x i32> %v to <vscale x 4 x i64>
1626  %red = call i64 @llvm.vector.reduce.add.nxv4i64(<vscale x 4 x i64> %e)
1627  ret i64 %red
1628}
1629
1630declare i64 @llvm.vector.reduce.umax.nxv4i64(<vscale x 4 x i64>)
1631
1632define i64 @vreduce_umax_nxv4i64(<vscale x 4 x i64> %v) {
1633; CHECK-LABEL: 'vreduce_umax_nxv4i64'
1634; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %red = call i64 @llvm.vector.reduce.umax.nxv4i64(<vscale x 4 x i64> %v)
1635; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %red
1636;
1637; SIZE-LABEL: 'vreduce_umax_nxv4i64'
1638; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i64 @llvm.vector.reduce.umax.nxv4i64(<vscale x 4 x i64> %v)
1639; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %red
1640;
1641  %red = call i64 @llvm.vector.reduce.umax.nxv4i64(<vscale x 4 x i64> %v)
1642  ret i64 %red
1643}
1644
1645declare i64 @llvm.vector.reduce.smax.nxv4i64(<vscale x 4 x i64>)
1646
1647define i64 @vreduce_smax_nxv4i64(<vscale x 4 x i64> %v) {
1648; CHECK-LABEL: 'vreduce_smax_nxv4i64'
1649; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %red = call i64 @llvm.vector.reduce.smax.nxv4i64(<vscale x 4 x i64> %v)
1650; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %red
1651;
1652; SIZE-LABEL: 'vreduce_smax_nxv4i64'
1653; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i64 @llvm.vector.reduce.smax.nxv4i64(<vscale x 4 x i64> %v)
1654; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %red
1655;
1656  %red = call i64 @llvm.vector.reduce.smax.nxv4i64(<vscale x 4 x i64> %v)
1657  ret i64 %red
1658}
1659
1660declare i64 @llvm.vector.reduce.umin.nxv4i64(<vscale x 4 x i64>)
1661
1662define i64 @vreduce_umin_nxv4i64(<vscale x 4 x i64> %v) {
1663; CHECK-LABEL: 'vreduce_umin_nxv4i64'
1664; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %red = call i64 @llvm.vector.reduce.umin.nxv4i64(<vscale x 4 x i64> %v)
1665; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %red
1666;
1667; SIZE-LABEL: 'vreduce_umin_nxv4i64'
1668; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i64 @llvm.vector.reduce.umin.nxv4i64(<vscale x 4 x i64> %v)
1669; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %red
1670;
1671  %red = call i64 @llvm.vector.reduce.umin.nxv4i64(<vscale x 4 x i64> %v)
1672  ret i64 %red
1673}
1674
1675declare i64 @llvm.vector.reduce.smin.nxv4i64(<vscale x 4 x i64>)
1676
1677define i64 @vreduce_smin_nxv4i64(<vscale x 4 x i64> %v) {
1678; CHECK-LABEL: 'vreduce_smin_nxv4i64'
1679; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %red = call i64 @llvm.vector.reduce.smin.nxv4i64(<vscale x 4 x i64> %v)
1680; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %red
1681;
1682; SIZE-LABEL: 'vreduce_smin_nxv4i64'
1683; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i64 @llvm.vector.reduce.smin.nxv4i64(<vscale x 4 x i64> %v)
1684; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %red
1685;
1686  %red = call i64 @llvm.vector.reduce.smin.nxv4i64(<vscale x 4 x i64> %v)
1687  ret i64 %red
1688}
1689
1690declare i64 @llvm.vector.reduce.and.nxv4i64(<vscale x 4 x i64>)
1691
1692define i64 @vreduce_and_nxv4i64(<vscale x 4 x i64> %v) {
1693; CHECK-LABEL: 'vreduce_and_nxv4i64'
1694; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %red = call i64 @llvm.vector.reduce.and.nxv4i64(<vscale x 4 x i64> %v)
1695; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %red
1696;
1697; SIZE-LABEL: 'vreduce_and_nxv4i64'
1698; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i64 @llvm.vector.reduce.and.nxv4i64(<vscale x 4 x i64> %v)
1699; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %red
1700;
1701  %red = call i64 @llvm.vector.reduce.and.nxv4i64(<vscale x 4 x i64> %v)
1702  ret i64 %red
1703}
1704
1705declare i64 @llvm.vector.reduce.or.nxv4i64(<vscale x 4 x i64>)
1706
1707define i64 @vreduce_or_nxv4i64(<vscale x 4 x i64> %v) {
1708; CHECK-LABEL: 'vreduce_or_nxv4i64'
1709; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %red = call i64 @llvm.vector.reduce.or.nxv4i64(<vscale x 4 x i64> %v)
1710; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %red
1711;
1712; SIZE-LABEL: 'vreduce_or_nxv4i64'
1713; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %red = call i64 @llvm.vector.reduce.or.nxv4i64(<vscale x 4 x i64> %v)
1714; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %red
1715;
1716  %red = call i64 @llvm.vector.reduce.or.nxv4i64(<vscale x 4 x i64> %v)
1717  ret i64 %red
1718}
1719
1720declare i64 @llvm.vector.reduce.xor.nxv4i64(<vscale x 4 x i64>)
1721
1722define i64 @vreduce_xor_nxv4i64(<vscale x 4 x i64> %v) {
1723; CHECK-LABEL: 'vreduce_xor_nxv4i64'
1724; CHECK-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %red = call i64 @llvm.vector.reduce.xor.nxv4i64(<vscale x 4 x i64> %v)
1725; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %red
1726;
1727; SIZE-LABEL: 'vreduce_xor_nxv4i64'
1728; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %red = call i64 @llvm.vector.reduce.xor.nxv4i64(<vscale x 4 x i64> %v)
1729; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %red
1730;
1731  %red = call i64 @llvm.vector.reduce.xor.nxv4i64(<vscale x 4 x i64> %v)
1732  ret i64 %red
1733}
1734