1 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2 ; RUN: opt < %s -mtriple=riscv32 -mattr=+d,+zfh,+experimental-zvfh,+v -passes='print<cost-model>' -cost-kind=throughput 2>&1 -disable-output | FileCheck %s
3 ; RUN: opt < %s -mtriple=riscv64 -mattr=+d,+zfh,+experimental-zvfh,+v -passes='print<cost-model>' -cost-kind=throughput 2>&1 -disable-output | FileCheck %s
5 declare half @llvm.vector.reduce.fadd.nxv1f16(half, <vscale x 1 x half>)
7 define half @vreduce_fadd_nxv1f16(<vscale x 1 x half> %v, half %s) {
8 ; CHECK-LABEL: 'vreduce_fadd_nxv1f16'
9 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call reassoc half @llvm.vector.reduce.fadd.nxv1f16(half %s, <vscale x 1 x half> %v)
10 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret half %red
12 %red = call reassoc half @llvm.vector.reduce.fadd.nxv1f16(half %s, <vscale x 1 x half> %v)
16 define half @vreduce_ord_fadd_nxv1f16(<vscale x 1 x half> %v, half %s) {
17 ; CHECK-LABEL: 'vreduce_ord_fadd_nxv1f16'
18 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call half @llvm.vector.reduce.fadd.nxv1f16(half %s, <vscale x 1 x half> %v)
19 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret half %red
21 %red = call half @llvm.vector.reduce.fadd.nxv1f16(half %s, <vscale x 1 x half> %v)
25 declare half @llvm.vector.reduce.fadd.nxv2f16(half, <vscale x 2 x half>)
27 define half @vreduce_fadd_nxv2f16(<vscale x 2 x half> %v, half %s) {
28 ; CHECK-LABEL: 'vreduce_fadd_nxv2f16'
29 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call reassoc half @llvm.vector.reduce.fadd.nxv2f16(half %s, <vscale x 2 x half> %v)
30 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret half %red
32 %red = call reassoc half @llvm.vector.reduce.fadd.nxv2f16(half %s, <vscale x 2 x half> %v)
36 define half @vreduce_ord_fadd_nxv2f16(<vscale x 2 x half> %v, half %s) {
37 ; CHECK-LABEL: 'vreduce_ord_fadd_nxv2f16'
38 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call half @llvm.vector.reduce.fadd.nxv2f16(half %s, <vscale x 2 x half> %v)
39 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret half %red
41 %red = call half @llvm.vector.reduce.fadd.nxv2f16(half %s, <vscale x 2 x half> %v)
45 declare half @llvm.vector.reduce.fadd.nxv4f16(half, <vscale x 4 x half>)
47 define half @vreduce_fadd_nxv4f16(<vscale x 4 x half> %v, half %s) {
48 ; CHECK-LABEL: 'vreduce_fadd_nxv4f16'
49 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call reassoc half @llvm.vector.reduce.fadd.nxv4f16(half %s, <vscale x 4 x half> %v)
50 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret half %red
52 %red = call reassoc half @llvm.vector.reduce.fadd.nxv4f16(half %s, <vscale x 4 x half> %v)
56 define half @vreduce_ord_fadd_nxv4f16(<vscale x 4 x half> %v, half %s) {
57 ; CHECK-LABEL: 'vreduce_ord_fadd_nxv4f16'
58 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call half @llvm.vector.reduce.fadd.nxv4f16(half %s, <vscale x 4 x half> %v)
59 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret half %red
61 %red = call half @llvm.vector.reduce.fadd.nxv4f16(half %s, <vscale x 4 x half> %v)
65 declare float @llvm.vector.reduce.fadd.nxv1f32(float, <vscale x 1 x float>)
67 define float @vreduce_fadd_nxv1f32(<vscale x 1 x float> %v, float %s) {
68 ; CHECK-LABEL: 'vreduce_fadd_nxv1f32'
69 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call reassoc float @llvm.vector.reduce.fadd.nxv1f32(float %s, <vscale x 1 x float> %v)
70 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret float %red
72 %red = call reassoc float @llvm.vector.reduce.fadd.nxv1f32(float %s, <vscale x 1 x float> %v)
76 define float @vreduce_ord_fadd_nxv1f32(<vscale x 1 x float> %v, float %s) {
77 ; CHECK-LABEL: 'vreduce_ord_fadd_nxv1f32'
78 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call float @llvm.vector.reduce.fadd.nxv1f32(float %s, <vscale x 1 x float> %v)
79 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret float %red
81 %red = call float @llvm.vector.reduce.fadd.nxv1f32(float %s, <vscale x 1 x float> %v)
85 define float @vreduce_fwadd_nxv1f32(<vscale x 1 x half> %v, float %s) {
86 ; CHECK-LABEL: 'vreduce_fwadd_nxv1f32'
87 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %e = fpext <vscale x 1 x half> %v to <vscale x 1 x float>
88 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call reassoc float @llvm.vector.reduce.fadd.nxv1f32(float %s, <vscale x 1 x float> %e)
89 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret float %red
91 %e = fpext <vscale x 1 x half> %v to <vscale x 1 x float>
92 %red = call reassoc float @llvm.vector.reduce.fadd.nxv1f32(float %s, <vscale x 1 x float> %e)
96 define float @vreduce_ord_fwadd_nxv1f32(<vscale x 1 x half> %v, float %s) {
97 ; CHECK-LABEL: 'vreduce_ord_fwadd_nxv1f32'
98 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %e = fpext <vscale x 1 x half> %v to <vscale x 1 x float>
99 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call float @llvm.vector.reduce.fadd.nxv1f32(float %s, <vscale x 1 x float> %e)
100 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret float %red
102 %e = fpext <vscale x 1 x half> %v to <vscale x 1 x float>
103 %red = call float @llvm.vector.reduce.fadd.nxv1f32(float %s, <vscale x 1 x float> %e)
107 declare float @llvm.vector.reduce.fadd.nxv2f32(float, <vscale x 2 x float>)
109 define float @vreduce_fadd_nxv2f32(<vscale x 2 x float> %v, float %s) {
110 ; CHECK-LABEL: 'vreduce_fadd_nxv2f32'
111 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call reassoc float @llvm.vector.reduce.fadd.nxv2f32(float %s, <vscale x 2 x float> %v)
112 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret float %red
114 %red = call reassoc float @llvm.vector.reduce.fadd.nxv2f32(float %s, <vscale x 2 x float> %v)
118 define float @vreduce_ord_fadd_nxv2f32(<vscale x 2 x float> %v, float %s) {
119 ; CHECK-LABEL: 'vreduce_ord_fadd_nxv2f32'
120 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call float @llvm.vector.reduce.fadd.nxv2f32(float %s, <vscale x 2 x float> %v)
121 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret float %red
123 %red = call float @llvm.vector.reduce.fadd.nxv2f32(float %s, <vscale x 2 x float> %v)
127 define float @vreduce_fwadd_nxv2f32(<vscale x 2 x half> %v, float %s) {
128 ; CHECK-LABEL: 'vreduce_fwadd_nxv2f32'
129 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %e = fpext <vscale x 2 x half> %v to <vscale x 2 x float>
130 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call reassoc float @llvm.vector.reduce.fadd.nxv2f32(float %s, <vscale x 2 x float> %e)
131 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret float %red
133 %e = fpext <vscale x 2 x half> %v to <vscale x 2 x float>
134 %red = call reassoc float @llvm.vector.reduce.fadd.nxv2f32(float %s, <vscale x 2 x float> %e)
138 define float @vreduce_ord_fwadd_nxv2f32(<vscale x 2 x half> %v, float %s) {
139 ; CHECK-LABEL: 'vreduce_ord_fwadd_nxv2f32'
140 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %e = fpext <vscale x 2 x half> %v to <vscale x 2 x float>
141 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call float @llvm.vector.reduce.fadd.nxv2f32(float %s, <vscale x 2 x float> %e)
142 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret float %red
144 %e = fpext <vscale x 2 x half> %v to <vscale x 2 x float>
145 %red = call float @llvm.vector.reduce.fadd.nxv2f32(float %s, <vscale x 2 x float> %e)
149 declare float @llvm.vector.reduce.fadd.nxv4f32(float, <vscale x 4 x float>)
151 define float @vreduce_fadd_nxv4f32(<vscale x 4 x float> %v, float %s) {
152 ; CHECK-LABEL: 'vreduce_fadd_nxv4f32'
153 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call reassoc float @llvm.vector.reduce.fadd.nxv4f32(float %s, <vscale x 4 x float> %v)
154 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret float %red
156 %red = call reassoc float @llvm.vector.reduce.fadd.nxv4f32(float %s, <vscale x 4 x float> %v)
160 define float @vreduce_ord_fadd_nxv4f32(<vscale x 4 x float> %v, float %s) {
161 ; CHECK-LABEL: 'vreduce_ord_fadd_nxv4f32'
162 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call float @llvm.vector.reduce.fadd.nxv4f32(float %s, <vscale x 4 x float> %v)
163 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret float %red
165 %red = call float @llvm.vector.reduce.fadd.nxv4f32(float %s, <vscale x 4 x float> %v)
169 define float @vreduce_fwadd_nxv4f32(<vscale x 4 x half> %v, float %s) {
170 ; CHECK-LABEL: 'vreduce_fwadd_nxv4f32'
171 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %e = fpext <vscale x 4 x half> %v to <vscale x 4 x float>
172 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call reassoc float @llvm.vector.reduce.fadd.nxv4f32(float %s, <vscale x 4 x float> %e)
173 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret float %red
175 %e = fpext <vscale x 4 x half> %v to <vscale x 4 x float>
176 %red = call reassoc float @llvm.vector.reduce.fadd.nxv4f32(float %s, <vscale x 4 x float> %e)
180 define float @vreduce_ord_fwadd_nxv4f32(<vscale x 4 x half> %v, float %s) {
181 ; CHECK-LABEL: 'vreduce_ord_fwadd_nxv4f32'
182 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %e = fpext <vscale x 4 x half> %v to <vscale x 4 x float>
183 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call float @llvm.vector.reduce.fadd.nxv4f32(float %s, <vscale x 4 x float> %e)
184 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret float %red
186 %e = fpext <vscale x 4 x half> %v to <vscale x 4 x float>
187 %red = call float @llvm.vector.reduce.fadd.nxv4f32(float %s, <vscale x 4 x float> %e)
191 declare double @llvm.vector.reduce.fadd.nxv1f64(double, <vscale x 1 x double>)
193 define double @vreduce_fadd_nxv1f64(<vscale x 1 x double> %v, double %s) {
194 ; CHECK-LABEL: 'vreduce_fadd_nxv1f64'
195 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call reassoc double @llvm.vector.reduce.fadd.nxv1f64(double %s, <vscale x 1 x double> %v)
196 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret double %red
198 %red = call reassoc double @llvm.vector.reduce.fadd.nxv1f64(double %s, <vscale x 1 x double> %v)
202 define double @vreduce_ord_fadd_nxv1f64(<vscale x 1 x double> %v, double %s) {
203 ; CHECK-LABEL: 'vreduce_ord_fadd_nxv1f64'
204 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call double @llvm.vector.reduce.fadd.nxv1f64(double %s, <vscale x 1 x double> %v)
205 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret double %red
207 %red = call double @llvm.vector.reduce.fadd.nxv1f64(double %s, <vscale x 1 x double> %v)
211 define double @vreduce_fwadd_nxv1f64(<vscale x 1 x float> %v, double %s) {
212 ; CHECK-LABEL: 'vreduce_fwadd_nxv1f64'
213 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %e = fpext <vscale x 1 x float> %v to <vscale x 1 x double>
214 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call reassoc double @llvm.vector.reduce.fadd.nxv1f64(double %s, <vscale x 1 x double> %e)
215 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret double %red
217 %e = fpext <vscale x 1 x float> %v to <vscale x 1 x double>
218 %red = call reassoc double @llvm.vector.reduce.fadd.nxv1f64(double %s, <vscale x 1 x double> %e)
222 define double @vreduce_ord_fwadd_nxv1f64(<vscale x 1 x float> %v, double %s) {
223 ; CHECK-LABEL: 'vreduce_ord_fwadd_nxv1f64'
224 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %e = fpext <vscale x 1 x float> %v to <vscale x 1 x double>
225 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call double @llvm.vector.reduce.fadd.nxv1f64(double %s, <vscale x 1 x double> %e)
226 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret double %red
228 %e = fpext <vscale x 1 x float> %v to <vscale x 1 x double>
229 %red = call double @llvm.vector.reduce.fadd.nxv1f64(double %s, <vscale x 1 x double> %e)
233 declare double @llvm.vector.reduce.fadd.nxv2f64(double, <vscale x 2 x double>)
235 define double @vreduce_fadd_nxv2f64(<vscale x 2 x double> %v, double %s) {
236 ; CHECK-LABEL: 'vreduce_fadd_nxv2f64'
237 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call reassoc double @llvm.vector.reduce.fadd.nxv2f64(double %s, <vscale x 2 x double> %v)
238 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret double %red
240 %red = call reassoc double @llvm.vector.reduce.fadd.nxv2f64(double %s, <vscale x 2 x double> %v)
244 define double @vreduce_ord_fadd_nxv2f64(<vscale x 2 x double> %v, double %s) {
245 ; CHECK-LABEL: 'vreduce_ord_fadd_nxv2f64'
246 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call double @llvm.vector.reduce.fadd.nxv2f64(double %s, <vscale x 2 x double> %v)
247 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret double %red
249 %red = call double @llvm.vector.reduce.fadd.nxv2f64(double %s, <vscale x 2 x double> %v)
253 define double @vreduce_fwadd_nxv2f64(<vscale x 2 x float> %v, double %s) {
254 ; CHECK-LABEL: 'vreduce_fwadd_nxv2f64'
255 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %e = fpext <vscale x 2 x float> %v to <vscale x 2 x double>
256 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call reassoc double @llvm.vector.reduce.fadd.nxv2f64(double %s, <vscale x 2 x double> %e)
257 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret double %red
259 %e = fpext <vscale x 2 x float> %v to <vscale x 2 x double>
260 %red = call reassoc double @llvm.vector.reduce.fadd.nxv2f64(double %s, <vscale x 2 x double> %e)
264 define double @vreduce_ord_fwadd_nxv2f64(<vscale x 2 x float> %v, double %s) {
265 ; CHECK-LABEL: 'vreduce_ord_fwadd_nxv2f64'
266 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %e = fpext <vscale x 2 x float> %v to <vscale x 2 x double>
267 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call double @llvm.vector.reduce.fadd.nxv2f64(double %s, <vscale x 2 x double> %e)
268 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret double %red
270 %e = fpext <vscale x 2 x float> %v to <vscale x 2 x double>
271 %red = call double @llvm.vector.reduce.fadd.nxv2f64(double %s, <vscale x 2 x double> %e)
275 declare double @llvm.vector.reduce.fadd.nxv4f64(double, <vscale x 4 x double>)
277 define double @vreduce_fadd_nxv4f64(<vscale x 4 x double> %v, double %s) {
278 ; CHECK-LABEL: 'vreduce_fadd_nxv4f64'
279 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call reassoc double @llvm.vector.reduce.fadd.nxv4f64(double %s, <vscale x 4 x double> %v)
280 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret double %red
282 %red = call reassoc double @llvm.vector.reduce.fadd.nxv4f64(double %s, <vscale x 4 x double> %v)
286 define double @vreduce_ord_fadd_nxv4f64(<vscale x 4 x double> %v, double %s) {
287 ; CHECK-LABEL: 'vreduce_ord_fadd_nxv4f64'
288 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call double @llvm.vector.reduce.fadd.nxv4f64(double %s, <vscale x 4 x double> %v)
289 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret double %red
291 %red = call double @llvm.vector.reduce.fadd.nxv4f64(double %s, <vscale x 4 x double> %v)
295 define double @vreduce_fwadd_nxv4f64(<vscale x 4 x float> %v, double %s) {
296 ; CHECK-LABEL: 'vreduce_fwadd_nxv4f64'
297 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %e = fpext <vscale x 4 x float> %v to <vscale x 4 x double>
298 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call reassoc double @llvm.vector.reduce.fadd.nxv4f64(double %s, <vscale x 4 x double> %e)
299 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret double %red
301 %e = fpext <vscale x 4 x float> %v to <vscale x 4 x double>
302 %red = call reassoc double @llvm.vector.reduce.fadd.nxv4f64(double %s, <vscale x 4 x double> %e)
306 define double @vreduce_ord_fwadd_nxv4f64(<vscale x 4 x float> %v, double %s) {
307 ; CHECK-LABEL: 'vreduce_ord_fwadd_nxv4f64'
308 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %e = fpext <vscale x 4 x float> %v to <vscale x 4 x double>
309 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call double @llvm.vector.reduce.fadd.nxv4f64(double %s, <vscale x 4 x double> %e)
310 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret double %red
312 %e = fpext <vscale x 4 x float> %v to <vscale x 4 x double>
313 %red = call double @llvm.vector.reduce.fadd.nxv4f64(double %s, <vscale x 4 x double> %e)
317 declare half @llvm.vector.reduce.fmin.nxv1f16(<vscale x 1 x half>)
319 define half @vreduce_fmin_nxv1f16(<vscale x 1 x half> %v) {
320 ; CHECK-LABEL: 'vreduce_fmin_nxv1f16'
321 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call half @llvm.vector.reduce.fmin.nxv1f16(<vscale x 1 x half> %v)
322 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret half %red
324 %red = call half @llvm.vector.reduce.fmin.nxv1f16(<vscale x 1 x half> %v)
328 define half @vreduce_fmin_nxv1f16_nonans(<vscale x 1 x half> %v) #0 {
329 ; CHECK-LABEL: 'vreduce_fmin_nxv1f16_nonans'
330 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call nnan half @llvm.vector.reduce.fmin.nxv1f16(<vscale x 1 x half> %v)
331 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret half %red
333 %red = call nnan half @llvm.vector.reduce.fmin.nxv1f16(<vscale x 1 x half> %v)
337 define half @vreduce_fmin_nxv1f16_nonans_noinfs(<vscale x 1 x half> %v) #1 {
338 ; CHECK-LABEL: 'vreduce_fmin_nxv1f16_nonans_noinfs'
339 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call nnan ninf half @llvm.vector.reduce.fmin.nxv1f16(<vscale x 1 x half> %v)
340 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret half %red
342 %red = call nnan ninf half @llvm.vector.reduce.fmin.nxv1f16(<vscale x 1 x half> %v)
346 declare half @llvm.vector.reduce.fmin.nxv2f16(<vscale x 2 x half>)
348 define half @vreduce_fmin_nxv2f16(<vscale x 2 x half> %v) {
349 ; CHECK-LABEL: 'vreduce_fmin_nxv2f16'
350 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call half @llvm.vector.reduce.fmin.nxv2f16(<vscale x 2 x half> %v)
351 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret half %red
353 %red = call half @llvm.vector.reduce.fmin.nxv2f16(<vscale x 2 x half> %v)
357 declare half @llvm.vector.reduce.fmin.nxv4f16(<vscale x 4 x half>)
359 define half @vreduce_fmin_nxv4f16(<vscale x 4 x half> %v) {
360 ; CHECK-LABEL: 'vreduce_fmin_nxv4f16'
361 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call half @llvm.vector.reduce.fmin.nxv4f16(<vscale x 4 x half> %v)
362 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret half %red
364 %red = call half @llvm.vector.reduce.fmin.nxv4f16(<vscale x 4 x half> %v)
368 declare half @llvm.vector.reduce.fmin.nxv64f16(<vscale x 64 x half>)
370 define half @vreduce_fmin_nxv64f16(<vscale x 64 x half> %v) {
371 ; CHECK-LABEL: 'vreduce_fmin_nxv64f16'
372 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call half @llvm.vector.reduce.fmin.nxv64f16(<vscale x 64 x half> %v)
373 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret half %red
375 %red = call half @llvm.vector.reduce.fmin.nxv64f16(<vscale x 64 x half> %v)
379 declare float @llvm.vector.reduce.fmin.nxv1f32(<vscale x 1 x float>)
381 define float @vreduce_fmin_nxv1f32(<vscale x 1 x float> %v) {
382 ; CHECK-LABEL: 'vreduce_fmin_nxv1f32'
383 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call float @llvm.vector.reduce.fmin.nxv1f32(<vscale x 1 x float> %v)
384 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret float %red
386 %red = call float @llvm.vector.reduce.fmin.nxv1f32(<vscale x 1 x float> %v)
390 define float @vreduce_fmin_nxv1f32_nonans(<vscale x 1 x float> %v) {
391 ; CHECK-LABEL: 'vreduce_fmin_nxv1f32_nonans'
392 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call nnan float @llvm.vector.reduce.fmin.nxv1f32(<vscale x 1 x float> %v)
393 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret float %red
395 %red = call nnan float @llvm.vector.reduce.fmin.nxv1f32(<vscale x 1 x float> %v)
399 define float @vreduce_fmin_nxv1f32_nonans_noinfs(<vscale x 1 x float> %v) {
400 ; CHECK-LABEL: 'vreduce_fmin_nxv1f32_nonans_noinfs'
401 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call nnan ninf float @llvm.vector.reduce.fmin.nxv1f32(<vscale x 1 x float> %v)
402 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret float %red
404 %red = call nnan ninf float @llvm.vector.reduce.fmin.nxv1f32(<vscale x 1 x float> %v)
408 declare float @llvm.vector.reduce.fmin.nxv2f32(<vscale x 2 x float>)
410 define float @vreduce_fmin_nxv2f32(<vscale x 2 x float> %v) {
411 ; CHECK-LABEL: 'vreduce_fmin_nxv2f32'
412 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call float @llvm.vector.reduce.fmin.nxv2f32(<vscale x 2 x float> %v)
413 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret float %red
415 %red = call float @llvm.vector.reduce.fmin.nxv2f32(<vscale x 2 x float> %v)
419 declare float @llvm.vector.reduce.fmin.nxv4f32(<vscale x 4 x float>)
421 define float @vreduce_fmin_nxv4f32(<vscale x 4 x float> %v) {
422 ; CHECK-LABEL: 'vreduce_fmin_nxv4f32'
423 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call float @llvm.vector.reduce.fmin.nxv4f32(<vscale x 4 x float> %v)
424 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret float %red
426 %red = call float @llvm.vector.reduce.fmin.nxv4f32(<vscale x 4 x float> %v)
430 declare float @llvm.vector.reduce.fmin.nxv32f32(<vscale x 32 x float>)
432 define float @vreduce_fmin_nxv32f32(<vscale x 32 x float> %v) {
433 ; CHECK-LABEL: 'vreduce_fmin_nxv32f32'
434 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call float @llvm.vector.reduce.fmin.nxv32f32(<vscale x 32 x float> %v)
435 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret float %red
437 %red = call float @llvm.vector.reduce.fmin.nxv32f32(<vscale x 32 x float> %v)
441 declare double @llvm.vector.reduce.fmin.nxv1f64(<vscale x 1 x double>)
443 define double @vreduce_fmin_nxv1f64(<vscale x 1 x double> %v) {
444 ; CHECK-LABEL: 'vreduce_fmin_nxv1f64'
445 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call double @llvm.vector.reduce.fmin.nxv1f64(<vscale x 1 x double> %v)
446 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret double %red
448 %red = call double @llvm.vector.reduce.fmin.nxv1f64(<vscale x 1 x double> %v)
452 define double @vreduce_fmin_nxv1f64_nonans(<vscale x 1 x double> %v) {
453 ; CHECK-LABEL: 'vreduce_fmin_nxv1f64_nonans'
454 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call nnan double @llvm.vector.reduce.fmin.nxv1f64(<vscale x 1 x double> %v)
455 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret double %red
457 %red = call nnan double @llvm.vector.reduce.fmin.nxv1f64(<vscale x 1 x double> %v)
461 define double @vreduce_fmin_nxv1f64_nonans_noinfs(<vscale x 1 x double> %v) {
462 ; CHECK-LABEL: 'vreduce_fmin_nxv1f64_nonans_noinfs'
463 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call nnan ninf double @llvm.vector.reduce.fmin.nxv1f64(<vscale x 1 x double> %v)
464 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret double %red
466 %red = call nnan ninf double @llvm.vector.reduce.fmin.nxv1f64(<vscale x 1 x double> %v)
470 declare double @llvm.vector.reduce.fmin.nxv2f64(<vscale x 2 x double>)
472 define double @vreduce_fmin_nxv2f64(<vscale x 2 x double> %v) {
473 ; CHECK-LABEL: 'vreduce_fmin_nxv2f64'
474 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call double @llvm.vector.reduce.fmin.nxv2f64(<vscale x 2 x double> %v)
475 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret double %red
477 %red = call double @llvm.vector.reduce.fmin.nxv2f64(<vscale x 2 x double> %v)
481 declare double @llvm.vector.reduce.fmin.nxv4f64(<vscale x 4 x double>)
483 define double @vreduce_fmin_nxv4f64(<vscale x 4 x double> %v) {
484 ; CHECK-LABEL: 'vreduce_fmin_nxv4f64'
485 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call double @llvm.vector.reduce.fmin.nxv4f64(<vscale x 4 x double> %v)
486 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret double %red
488 %red = call double @llvm.vector.reduce.fmin.nxv4f64(<vscale x 4 x double> %v)
492 declare double @llvm.vector.reduce.fmin.nxv16f64(<vscale x 16 x double>)
494 define double @vreduce_fmin_nxv16f64(<vscale x 16 x double> %v) {
495 ; CHECK-LABEL: 'vreduce_fmin_nxv16f64'
496 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call double @llvm.vector.reduce.fmin.nxv16f64(<vscale x 16 x double> %v)
497 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret double %red
499 %red = call double @llvm.vector.reduce.fmin.nxv16f64(<vscale x 16 x double> %v)
503 declare half @llvm.vector.reduce.fmax.nxv1f16(<vscale x 1 x half>)
505 define half @vreduce_fmax_nxv1f16(<vscale x 1 x half> %v) {
506 ; CHECK-LABEL: 'vreduce_fmax_nxv1f16'
507 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call half @llvm.vector.reduce.fmax.nxv1f16(<vscale x 1 x half> %v)
508 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret half %red
510 %red = call half @llvm.vector.reduce.fmax.nxv1f16(<vscale x 1 x half> %v)
514 define half @vreduce_fmax_nxv1f16_nonans(<vscale x 1 x half> %v) #0 {
515 ; CHECK-LABEL: 'vreduce_fmax_nxv1f16_nonans'
516 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call nnan half @llvm.vector.reduce.fmax.nxv1f16(<vscale x 1 x half> %v)
517 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret half %red
519 %red = call nnan half @llvm.vector.reduce.fmax.nxv1f16(<vscale x 1 x half> %v)
523 define half @vreduce_fmax_nxv1f16_nonans_noinfs(<vscale x 1 x half> %v) #1 {
524 ; CHECK-LABEL: 'vreduce_fmax_nxv1f16_nonans_noinfs'
525 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call nnan ninf half @llvm.vector.reduce.fmax.nxv1f16(<vscale x 1 x half> %v)
526 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret half %red
528 %red = call nnan ninf half @llvm.vector.reduce.fmax.nxv1f16(<vscale x 1 x half> %v)
532 declare half @llvm.vector.reduce.fmax.nxv2f16(<vscale x 2 x half>)
534 define half @vreduce_fmax_nxv2f16(<vscale x 2 x half> %v) {
535 ; CHECK-LABEL: 'vreduce_fmax_nxv2f16'
536 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call half @llvm.vector.reduce.fmax.nxv2f16(<vscale x 2 x half> %v)
537 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret half %red
539 %red = call half @llvm.vector.reduce.fmax.nxv2f16(<vscale x 2 x half> %v)
543 declare half @llvm.vector.reduce.fmax.nxv4f16(<vscale x 4 x half>)
545 define half @vreduce_fmax_nxv4f16(<vscale x 4 x half> %v) {
546 ; CHECK-LABEL: 'vreduce_fmax_nxv4f16'
547 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call half @llvm.vector.reduce.fmax.nxv4f16(<vscale x 4 x half> %v)
548 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret half %red
550 %red = call half @llvm.vector.reduce.fmax.nxv4f16(<vscale x 4 x half> %v)
554 declare half @llvm.vector.reduce.fmax.nxv64f16(<vscale x 64 x half>)
556 define half @vreduce_fmax_nxv64f16(<vscale x 64 x half> %v) {
557 ; CHECK-LABEL: 'vreduce_fmax_nxv64f16'
558 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call half @llvm.vector.reduce.fmax.nxv64f16(<vscale x 64 x half> %v)
559 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret half %red
561 %red = call half @llvm.vector.reduce.fmax.nxv64f16(<vscale x 64 x half> %v)
565 declare float @llvm.vector.reduce.fmax.nxv1f32(<vscale x 1 x float>)
567 define float @vreduce_fmax_nxv1f32(<vscale x 1 x float> %v) {
568 ; CHECK-LABEL: 'vreduce_fmax_nxv1f32'
569 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call float @llvm.vector.reduce.fmax.nxv1f32(<vscale x 1 x float> %v)
570 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret float %red
572 %red = call float @llvm.vector.reduce.fmax.nxv1f32(<vscale x 1 x float> %v)
576 define float @vreduce_fmax_nxv1f32_nonans(<vscale x 1 x float> %v) {
577 ; CHECK-LABEL: 'vreduce_fmax_nxv1f32_nonans'
578 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call nnan float @llvm.vector.reduce.fmax.nxv1f32(<vscale x 1 x float> %v)
579 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret float %red
581 %red = call nnan float @llvm.vector.reduce.fmax.nxv1f32(<vscale x 1 x float> %v)
585 define float @vreduce_fmax_nxv1f32_nonans_noinfs(<vscale x 1 x float> %v) {
586 ; CHECK-LABEL: 'vreduce_fmax_nxv1f32_nonans_noinfs'
587 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call nnan ninf float @llvm.vector.reduce.fmax.nxv1f32(<vscale x 1 x float> %v)
588 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret float %red
590 %red = call nnan ninf float @llvm.vector.reduce.fmax.nxv1f32(<vscale x 1 x float> %v)
594 declare float @llvm.vector.reduce.fmax.nxv2f32(<vscale x 2 x float>)
596 define float @vreduce_fmax_nxv2f32(<vscale x 2 x float> %v) {
597 ; CHECK-LABEL: 'vreduce_fmax_nxv2f32'
598 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call float @llvm.vector.reduce.fmax.nxv2f32(<vscale x 2 x float> %v)
599 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret float %red
601 %red = call float @llvm.vector.reduce.fmax.nxv2f32(<vscale x 2 x float> %v)
605 declare float @llvm.vector.reduce.fmax.nxv4f32(<vscale x 4 x float>)
607 define float @vreduce_fmax_nxv4f32(<vscale x 4 x float> %v) {
608 ; CHECK-LABEL: 'vreduce_fmax_nxv4f32'
609 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call float @llvm.vector.reduce.fmax.nxv4f32(<vscale x 4 x float> %v)
610 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret float %red
612 %red = call float @llvm.vector.reduce.fmax.nxv4f32(<vscale x 4 x float> %v)
616 declare float @llvm.vector.reduce.fmax.nxv32f32(<vscale x 32 x float>)
618 define float @vreduce_fmax_nxv32f32(<vscale x 32 x float> %v) {
619 ; CHECK-LABEL: 'vreduce_fmax_nxv32f32'
620 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call float @llvm.vector.reduce.fmax.nxv32f32(<vscale x 32 x float> %v)
621 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret float %red
623 %red = call float @llvm.vector.reduce.fmax.nxv32f32(<vscale x 32 x float> %v)
627 declare double @llvm.vector.reduce.fmax.nxv1f64(<vscale x 1 x double>)
629 define double @vreduce_fmax_nxv1f64(<vscale x 1 x double> %v) {
630 ; CHECK-LABEL: 'vreduce_fmax_nxv1f64'
631 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call double @llvm.vector.reduce.fmax.nxv1f64(<vscale x 1 x double> %v)
632 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret double %red
634 %red = call double @llvm.vector.reduce.fmax.nxv1f64(<vscale x 1 x double> %v)
638 define double @vreduce_fmax_nxv1f64_nonans(<vscale x 1 x double> %v) {
639 ; CHECK-LABEL: 'vreduce_fmax_nxv1f64_nonans'
640 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call nnan double @llvm.vector.reduce.fmax.nxv1f64(<vscale x 1 x double> %v)
641 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret double %red
643 %red = call nnan double @llvm.vector.reduce.fmax.nxv1f64(<vscale x 1 x double> %v)
647 define double @vreduce_fmax_nxv1f64_nonans_noinfs(<vscale x 1 x double> %v) {
648 ; CHECK-LABEL: 'vreduce_fmax_nxv1f64_nonans_noinfs'
649 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call nnan ninf double @llvm.vector.reduce.fmax.nxv1f64(<vscale x 1 x double> %v)
650 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret double %red
652 %red = call nnan ninf double @llvm.vector.reduce.fmax.nxv1f64(<vscale x 1 x double> %v)
656 declare double @llvm.vector.reduce.fmax.nxv2f64(<vscale x 2 x double>)
658 define double @vreduce_fmax_nxv2f64(<vscale x 2 x double> %v) {
659 ; CHECK-LABEL: 'vreduce_fmax_nxv2f64'
660 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call double @llvm.vector.reduce.fmax.nxv2f64(<vscale x 2 x double> %v)
661 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret double %red
663 %red = call double @llvm.vector.reduce.fmax.nxv2f64(<vscale x 2 x double> %v)
667 declare double @llvm.vector.reduce.fmax.nxv4f64(<vscale x 4 x double>)
669 define double @vreduce_fmax_nxv4f64(<vscale x 4 x double> %v) {
670 ; CHECK-LABEL: 'vreduce_fmax_nxv4f64'
671 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call double @llvm.vector.reduce.fmax.nxv4f64(<vscale x 4 x double> %v)
672 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret double %red
674 %red = call double @llvm.vector.reduce.fmax.nxv4f64(<vscale x 4 x double> %v)
678 declare double @llvm.vector.reduce.fmax.nxv16f64(<vscale x 16 x double>)
680 define double @vreduce_fmax_nxv16f64(<vscale x 16 x double> %v) {
681 ; CHECK-LABEL: 'vreduce_fmax_nxv16f64'
682 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call double @llvm.vector.reduce.fmax.nxv16f64(<vscale x 16 x double> %v)
683 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret double %red
685 %red = call double @llvm.vector.reduce.fmax.nxv16f64(<vscale x 16 x double> %v)
689 define float @vreduce_nsz_fadd_nxv1f32(<vscale x 1 x float> %v, float %s) {
690 ; CHECK-LABEL: 'vreduce_nsz_fadd_nxv1f32'
691 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %red = call reassoc nsz float @llvm.vector.reduce.fadd.nxv1f32(float %s, <vscale x 1 x float> %v)
692 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret float %red
694 %red = call reassoc nsz float @llvm.vector.reduce.fadd.nxv1f32(float %s, <vscale x 1 x float> %v)