1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -mattr=+v -verify-machineinstrs < %s \
3 ; RUN: | FileCheck %s --check-prefixes=CHECK,RV32
4 ; RUN: llc -mtriple=riscv64 -mattr=+v -verify-machineinstrs < %s \
5 ; RUN: | FileCheck %s --check-prefixes=CHECK,RV64
7 declare i8 @llvm.vp.reduce.add.nxv1i8(i8, <vscale x 1 x i8>, <vscale x 1 x i1>, i32)
9 define signext i8 @vpreduce_add_nxv1i8(i8 signext %s, <vscale x 1 x i8> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
10 ; CHECK-LABEL: vpreduce_add_nxv1i8:
12 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
13 ; CHECK-NEXT: vmv.s.x v9, a0
14 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
15 ; CHECK-NEXT: vredsum.vs v9, v8, v9, v0.t
16 ; CHECK-NEXT: vmv.x.s a0, v9
18 %r = call i8 @llvm.vp.reduce.add.nxv1i8(i8 %s, <vscale x 1 x i8> %v, <vscale x 1 x i1> %m, i32 %evl)
22 declare i8 @llvm.vp.reduce.umax.nxv1i8(i8, <vscale x 1 x i8>, <vscale x 1 x i1>, i32)
24 define signext i8 @vpreduce_umax_nxv1i8(i8 signext %s, <vscale x 1 x i8> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
25 ; CHECK-LABEL: vpreduce_umax_nxv1i8:
27 ; CHECK-NEXT: andi a0, a0, 255
28 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
29 ; CHECK-NEXT: vmv.s.x v9, a0
30 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
31 ; CHECK-NEXT: vredmaxu.vs v9, v8, v9, v0.t
32 ; CHECK-NEXT: vmv.x.s a0, v9
34 %r = call i8 @llvm.vp.reduce.umax.nxv1i8(i8 %s, <vscale x 1 x i8> %v, <vscale x 1 x i1> %m, i32 %evl)
38 declare i8 @llvm.vp.reduce.smax.nxv1i8(i8, <vscale x 1 x i8>, <vscale x 1 x i1>, i32)
40 define signext i8 @vpreduce_smax_nxv1i8(i8 signext %s, <vscale x 1 x i8> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
41 ; CHECK-LABEL: vpreduce_smax_nxv1i8:
43 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
44 ; CHECK-NEXT: vmv.s.x v9, a0
45 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
46 ; CHECK-NEXT: vredmax.vs v9, v8, v9, v0.t
47 ; CHECK-NEXT: vmv.x.s a0, v9
49 %r = call i8 @llvm.vp.reduce.smax.nxv1i8(i8 %s, <vscale x 1 x i8> %v, <vscale x 1 x i1> %m, i32 %evl)
53 declare i8 @llvm.vp.reduce.umin.nxv1i8(i8, <vscale x 1 x i8>, <vscale x 1 x i1>, i32)
55 define signext i8 @vpreduce_umin_nxv1i8(i8 signext %s, <vscale x 1 x i8> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
56 ; CHECK-LABEL: vpreduce_umin_nxv1i8:
58 ; CHECK-NEXT: andi a0, a0, 255
59 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
60 ; CHECK-NEXT: vmv.s.x v9, a0
61 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
62 ; CHECK-NEXT: vredminu.vs v9, v8, v9, v0.t
63 ; CHECK-NEXT: vmv.x.s a0, v9
65 %r = call i8 @llvm.vp.reduce.umin.nxv1i8(i8 %s, <vscale x 1 x i8> %v, <vscale x 1 x i1> %m, i32 %evl)
69 declare i8 @llvm.vp.reduce.smin.nxv1i8(i8, <vscale x 1 x i8>, <vscale x 1 x i1>, i32)
71 define signext i8 @vpreduce_smin_nxv1i8(i8 signext %s, <vscale x 1 x i8> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
72 ; CHECK-LABEL: vpreduce_smin_nxv1i8:
74 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
75 ; CHECK-NEXT: vmv.s.x v9, a0
76 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
77 ; CHECK-NEXT: vredmin.vs v9, v8, v9, v0.t
78 ; CHECK-NEXT: vmv.x.s a0, v9
80 %r = call i8 @llvm.vp.reduce.smin.nxv1i8(i8 %s, <vscale x 1 x i8> %v, <vscale x 1 x i1> %m, i32 %evl)
84 declare i8 @llvm.vp.reduce.and.nxv1i8(i8, <vscale x 1 x i8>, <vscale x 1 x i1>, i32)
86 define signext i8 @vpreduce_and_nxv1i8(i8 signext %s, <vscale x 1 x i8> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
87 ; CHECK-LABEL: vpreduce_and_nxv1i8:
89 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
90 ; CHECK-NEXT: vmv.s.x v9, a0
91 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
92 ; CHECK-NEXT: vredand.vs v9, v8, v9, v0.t
93 ; CHECK-NEXT: vmv.x.s a0, v9
95 %r = call i8 @llvm.vp.reduce.and.nxv1i8(i8 %s, <vscale x 1 x i8> %v, <vscale x 1 x i1> %m, i32 %evl)
99 declare i8 @llvm.vp.reduce.or.nxv1i8(i8, <vscale x 1 x i8>, <vscale x 1 x i1>, i32)
101 define signext i8 @vpreduce_or_nxv1i8(i8 signext %s, <vscale x 1 x i8> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
102 ; CHECK-LABEL: vpreduce_or_nxv1i8:
104 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
105 ; CHECK-NEXT: vmv.s.x v9, a0
106 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
107 ; CHECK-NEXT: vredor.vs v9, v8, v9, v0.t
108 ; CHECK-NEXT: vmv.x.s a0, v9
110 %r = call i8 @llvm.vp.reduce.or.nxv1i8(i8 %s, <vscale x 1 x i8> %v, <vscale x 1 x i1> %m, i32 %evl)
114 declare i8 @llvm.vp.reduce.xor.nxv1i8(i8, <vscale x 1 x i8>, <vscale x 1 x i1>, i32)
116 define signext i8 @vpreduce_xor_nxv1i8(i8 signext %s, <vscale x 1 x i8> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
117 ; CHECK-LABEL: vpreduce_xor_nxv1i8:
119 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
120 ; CHECK-NEXT: vmv.s.x v9, a0
121 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
122 ; CHECK-NEXT: vredxor.vs v9, v8, v9, v0.t
123 ; CHECK-NEXT: vmv.x.s a0, v9
125 %r = call i8 @llvm.vp.reduce.xor.nxv1i8(i8 %s, <vscale x 1 x i8> %v, <vscale x 1 x i1> %m, i32 %evl)
129 declare i8 @llvm.vp.reduce.add.nxv2i8(i8, <vscale x 2 x i8>, <vscale x 2 x i1>, i32)
131 define signext i8 @vpreduce_add_nxv2i8(i8 signext %s, <vscale x 2 x i8> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
132 ; CHECK-LABEL: vpreduce_add_nxv2i8:
134 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
135 ; CHECK-NEXT: vmv.s.x v9, a0
136 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
137 ; CHECK-NEXT: vredsum.vs v9, v8, v9, v0.t
138 ; CHECK-NEXT: vmv.x.s a0, v9
140 %r = call i8 @llvm.vp.reduce.add.nxv2i8(i8 %s, <vscale x 2 x i8> %v, <vscale x 2 x i1> %m, i32 %evl)
144 declare i8 @llvm.vp.reduce.umax.nxv2i8(i8, <vscale x 2 x i8>, <vscale x 2 x i1>, i32)
146 define signext i8 @vpreduce_umax_nxv2i8(i8 signext %s, <vscale x 2 x i8> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
147 ; CHECK-LABEL: vpreduce_umax_nxv2i8:
149 ; CHECK-NEXT: andi a0, a0, 255
150 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
151 ; CHECK-NEXT: vmv.s.x v9, a0
152 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
153 ; CHECK-NEXT: vredmaxu.vs v9, v8, v9, v0.t
154 ; CHECK-NEXT: vmv.x.s a0, v9
156 %r = call i8 @llvm.vp.reduce.umax.nxv2i8(i8 %s, <vscale x 2 x i8> %v, <vscale x 2 x i1> %m, i32 %evl)
160 declare i8 @llvm.vp.reduce.smax.nxv2i8(i8, <vscale x 2 x i8>, <vscale x 2 x i1>, i32)
162 define signext i8 @vpreduce_smax_nxv2i8(i8 signext %s, <vscale x 2 x i8> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
163 ; CHECK-LABEL: vpreduce_smax_nxv2i8:
165 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
166 ; CHECK-NEXT: vmv.s.x v9, a0
167 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
168 ; CHECK-NEXT: vredmax.vs v9, v8, v9, v0.t
169 ; CHECK-NEXT: vmv.x.s a0, v9
171 %r = call i8 @llvm.vp.reduce.smax.nxv2i8(i8 %s, <vscale x 2 x i8> %v, <vscale x 2 x i1> %m, i32 %evl)
175 declare i8 @llvm.vp.reduce.umin.nxv2i8(i8, <vscale x 2 x i8>, <vscale x 2 x i1>, i32)
177 define signext i8 @vpreduce_umin_nxv2i8(i8 signext %s, <vscale x 2 x i8> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
178 ; CHECK-LABEL: vpreduce_umin_nxv2i8:
180 ; CHECK-NEXT: andi a0, a0, 255
181 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
182 ; CHECK-NEXT: vmv.s.x v9, a0
183 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
184 ; CHECK-NEXT: vredminu.vs v9, v8, v9, v0.t
185 ; CHECK-NEXT: vmv.x.s a0, v9
187 %r = call i8 @llvm.vp.reduce.umin.nxv2i8(i8 %s, <vscale x 2 x i8> %v, <vscale x 2 x i1> %m, i32 %evl)
191 declare i8 @llvm.vp.reduce.smin.nxv2i8(i8, <vscale x 2 x i8>, <vscale x 2 x i1>, i32)
193 define signext i8 @vpreduce_smin_nxv2i8(i8 signext %s, <vscale x 2 x i8> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
194 ; CHECK-LABEL: vpreduce_smin_nxv2i8:
196 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
197 ; CHECK-NEXT: vmv.s.x v9, a0
198 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
199 ; CHECK-NEXT: vredmin.vs v9, v8, v9, v0.t
200 ; CHECK-NEXT: vmv.x.s a0, v9
202 %r = call i8 @llvm.vp.reduce.smin.nxv2i8(i8 %s, <vscale x 2 x i8> %v, <vscale x 2 x i1> %m, i32 %evl)
206 declare i8 @llvm.vp.reduce.and.nxv2i8(i8, <vscale x 2 x i8>, <vscale x 2 x i1>, i32)
208 define signext i8 @vpreduce_and_nxv2i8(i8 signext %s, <vscale x 2 x i8> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
209 ; CHECK-LABEL: vpreduce_and_nxv2i8:
211 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
212 ; CHECK-NEXT: vmv.s.x v9, a0
213 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
214 ; CHECK-NEXT: vredand.vs v9, v8, v9, v0.t
215 ; CHECK-NEXT: vmv.x.s a0, v9
217 %r = call i8 @llvm.vp.reduce.and.nxv2i8(i8 %s, <vscale x 2 x i8> %v, <vscale x 2 x i1> %m, i32 %evl)
221 declare i8 @llvm.vp.reduce.or.nxv2i8(i8, <vscale x 2 x i8>, <vscale x 2 x i1>, i32)
223 define signext i8 @vpreduce_or_nxv2i8(i8 signext %s, <vscale x 2 x i8> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
224 ; CHECK-LABEL: vpreduce_or_nxv2i8:
226 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
227 ; CHECK-NEXT: vmv.s.x v9, a0
228 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
229 ; CHECK-NEXT: vredor.vs v9, v8, v9, v0.t
230 ; CHECK-NEXT: vmv.x.s a0, v9
232 %r = call i8 @llvm.vp.reduce.or.nxv2i8(i8 %s, <vscale x 2 x i8> %v, <vscale x 2 x i1> %m, i32 %evl)
236 declare i8 @llvm.vp.reduce.xor.nxv2i8(i8, <vscale x 2 x i8>, <vscale x 2 x i1>, i32)
238 define signext i8 @vpreduce_xor_nxv2i8(i8 signext %s, <vscale x 2 x i8> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
239 ; CHECK-LABEL: vpreduce_xor_nxv2i8:
241 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
242 ; CHECK-NEXT: vmv.s.x v9, a0
243 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
244 ; CHECK-NEXT: vredxor.vs v9, v8, v9, v0.t
245 ; CHECK-NEXT: vmv.x.s a0, v9
247 %r = call i8 @llvm.vp.reduce.xor.nxv2i8(i8 %s, <vscale x 2 x i8> %v, <vscale x 2 x i1> %m, i32 %evl)
251 declare i8 @llvm.vp.reduce.smax.nxv3i8(i8, <vscale x 3 x i8>, <vscale x 3 x i1>, i32)
253 define signext i8 @vpreduce_smax_nxv3i8(i8 signext %s, <vscale x 3 x i8> %v, <vscale x 3 x i1> %m, i32 zeroext %evl) {
254 ; CHECK-LABEL: vpreduce_smax_nxv3i8:
256 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
257 ; CHECK-NEXT: vmv.s.x v9, a0
258 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
259 ; CHECK-NEXT: vredmax.vs v9, v8, v9, v0.t
260 ; CHECK-NEXT: vmv.x.s a0, v9
262 %r = call i8 @llvm.vp.reduce.smax.nxv3i8(i8 %s, <vscale x 3 x i8> %v, <vscale x 3 x i1> %m, i32 %evl)
266 declare i8 @llvm.vp.reduce.add.nxv4i8(i8, <vscale x 4 x i8>, <vscale x 4 x i1>, i32)
268 define signext i8 @vpreduce_add_nxv4i8(i8 signext %s, <vscale x 4 x i8> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
269 ; CHECK-LABEL: vpreduce_add_nxv4i8:
271 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
272 ; CHECK-NEXT: vmv.s.x v9, a0
273 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
274 ; CHECK-NEXT: vredsum.vs v9, v8, v9, v0.t
275 ; CHECK-NEXT: vmv.x.s a0, v9
277 %r = call i8 @llvm.vp.reduce.add.nxv4i8(i8 %s, <vscale x 4 x i8> %v, <vscale x 4 x i1> %m, i32 %evl)
281 declare i8 @llvm.vp.reduce.umax.nxv4i8(i8, <vscale x 4 x i8>, <vscale x 4 x i1>, i32)
283 define signext i8 @vpreduce_umax_nxv4i8(i8 signext %s, <vscale x 4 x i8> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
284 ; CHECK-LABEL: vpreduce_umax_nxv4i8:
286 ; CHECK-NEXT: andi a0, a0, 255
287 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
288 ; CHECK-NEXT: vmv.s.x v9, a0
289 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
290 ; CHECK-NEXT: vredmaxu.vs v9, v8, v9, v0.t
291 ; CHECK-NEXT: vmv.x.s a0, v9
293 %r = call i8 @llvm.vp.reduce.umax.nxv4i8(i8 %s, <vscale x 4 x i8> %v, <vscale x 4 x i1> %m, i32 %evl)
297 declare i8 @llvm.vp.reduce.smax.nxv4i8(i8, <vscale x 4 x i8>, <vscale x 4 x i1>, i32)
299 define signext i8 @vpreduce_smax_nxv4i8(i8 signext %s, <vscale x 4 x i8> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
300 ; CHECK-LABEL: vpreduce_smax_nxv4i8:
302 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
303 ; CHECK-NEXT: vmv.s.x v9, a0
304 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
305 ; CHECK-NEXT: vredmax.vs v9, v8, v9, v0.t
306 ; CHECK-NEXT: vmv.x.s a0, v9
308 %r = call i8 @llvm.vp.reduce.smax.nxv4i8(i8 %s, <vscale x 4 x i8> %v, <vscale x 4 x i1> %m, i32 %evl)
312 declare i8 @llvm.vp.reduce.umin.nxv4i8(i8, <vscale x 4 x i8>, <vscale x 4 x i1>, i32)
314 define signext i8 @vpreduce_umin_nxv4i8(i8 signext %s, <vscale x 4 x i8> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
315 ; CHECK-LABEL: vpreduce_umin_nxv4i8:
317 ; CHECK-NEXT: andi a0, a0, 255
318 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
319 ; CHECK-NEXT: vmv.s.x v9, a0
320 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
321 ; CHECK-NEXT: vredminu.vs v9, v8, v9, v0.t
322 ; CHECK-NEXT: vmv.x.s a0, v9
324 %r = call i8 @llvm.vp.reduce.umin.nxv4i8(i8 %s, <vscale x 4 x i8> %v, <vscale x 4 x i1> %m, i32 %evl)
328 declare i8 @llvm.vp.reduce.smin.nxv4i8(i8, <vscale x 4 x i8>, <vscale x 4 x i1>, i32)
330 define signext i8 @vpreduce_smin_nxv4i8(i8 signext %s, <vscale x 4 x i8> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
331 ; CHECK-LABEL: vpreduce_smin_nxv4i8:
333 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
334 ; CHECK-NEXT: vmv.s.x v9, a0
335 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
336 ; CHECK-NEXT: vredmin.vs v9, v8, v9, v0.t
337 ; CHECK-NEXT: vmv.x.s a0, v9
339 %r = call i8 @llvm.vp.reduce.smin.nxv4i8(i8 %s, <vscale x 4 x i8> %v, <vscale x 4 x i1> %m, i32 %evl)
343 declare i8 @llvm.vp.reduce.and.nxv4i8(i8, <vscale x 4 x i8>, <vscale x 4 x i1>, i32)
345 define signext i8 @vpreduce_and_nxv4i8(i8 signext %s, <vscale x 4 x i8> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
346 ; CHECK-LABEL: vpreduce_and_nxv4i8:
348 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
349 ; CHECK-NEXT: vmv.s.x v9, a0
350 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
351 ; CHECK-NEXT: vredand.vs v9, v8, v9, v0.t
352 ; CHECK-NEXT: vmv.x.s a0, v9
354 %r = call i8 @llvm.vp.reduce.and.nxv4i8(i8 %s, <vscale x 4 x i8> %v, <vscale x 4 x i1> %m, i32 %evl)
358 declare i8 @llvm.vp.reduce.or.nxv4i8(i8, <vscale x 4 x i8>, <vscale x 4 x i1>, i32)
360 define signext i8 @vpreduce_or_nxv4i8(i8 signext %s, <vscale x 4 x i8> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
361 ; CHECK-LABEL: vpreduce_or_nxv4i8:
363 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
364 ; CHECK-NEXT: vmv.s.x v9, a0
365 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
366 ; CHECK-NEXT: vredor.vs v9, v8, v9, v0.t
367 ; CHECK-NEXT: vmv.x.s a0, v9
369 %r = call i8 @llvm.vp.reduce.or.nxv4i8(i8 %s, <vscale x 4 x i8> %v, <vscale x 4 x i1> %m, i32 %evl)
373 declare i8 @llvm.vp.reduce.xor.nxv4i8(i8, <vscale x 4 x i8>, <vscale x 4 x i1>, i32)
375 define signext i8 @vpreduce_xor_nxv4i8(i8 signext %s, <vscale x 4 x i8> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
376 ; CHECK-LABEL: vpreduce_xor_nxv4i8:
378 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
379 ; CHECK-NEXT: vmv.s.x v9, a0
380 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
381 ; CHECK-NEXT: vredxor.vs v9, v8, v9, v0.t
382 ; CHECK-NEXT: vmv.x.s a0, v9
384 %r = call i8 @llvm.vp.reduce.xor.nxv4i8(i8 %s, <vscale x 4 x i8> %v, <vscale x 4 x i1> %m, i32 %evl)
388 declare i16 @llvm.vp.reduce.add.nxv1i16(i16, <vscale x 1 x i16>, <vscale x 1 x i1>, i32)
390 define signext i16 @vpreduce_add_nxv1i16(i16 signext %s, <vscale x 1 x i16> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
391 ; CHECK-LABEL: vpreduce_add_nxv1i16:
393 ; CHECK-NEXT: vsetivli zero, 1, e16, m1, ta, ma
394 ; CHECK-NEXT: vmv.s.x v9, a0
395 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
396 ; CHECK-NEXT: vredsum.vs v9, v8, v9, v0.t
397 ; CHECK-NEXT: vmv.x.s a0, v9
399 %r = call i16 @llvm.vp.reduce.add.nxv1i16(i16 %s, <vscale x 1 x i16> %v, <vscale x 1 x i1> %m, i32 %evl)
403 declare i16 @llvm.vp.reduce.umax.nxv1i16(i16, <vscale x 1 x i16>, <vscale x 1 x i1>, i32)
405 define signext i16 @vpreduce_umax_nxv1i16(i16 signext %s, <vscale x 1 x i16> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
406 ; RV32-LABEL: vpreduce_umax_nxv1i16:
408 ; RV32-NEXT: slli a0, a0, 16
409 ; RV32-NEXT: srli a0, a0, 16
410 ; RV32-NEXT: vsetivli zero, 1, e16, m1, ta, ma
411 ; RV32-NEXT: vmv.s.x v9, a0
412 ; RV32-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
413 ; RV32-NEXT: vredmaxu.vs v9, v8, v9, v0.t
414 ; RV32-NEXT: vmv.x.s a0, v9
417 ; RV64-LABEL: vpreduce_umax_nxv1i16:
419 ; RV64-NEXT: slli a0, a0, 48
420 ; RV64-NEXT: srli a0, a0, 48
421 ; RV64-NEXT: vsetivli zero, 1, e16, m1, ta, ma
422 ; RV64-NEXT: vmv.s.x v9, a0
423 ; RV64-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
424 ; RV64-NEXT: vredmaxu.vs v9, v8, v9, v0.t
425 ; RV64-NEXT: vmv.x.s a0, v9
427 %r = call i16 @llvm.vp.reduce.umax.nxv1i16(i16 %s, <vscale x 1 x i16> %v, <vscale x 1 x i1> %m, i32 %evl)
431 declare i16 @llvm.vp.reduce.smax.nxv1i16(i16, <vscale x 1 x i16>, <vscale x 1 x i1>, i32)
433 define signext i16 @vpreduce_smax_nxv1i16(i16 signext %s, <vscale x 1 x i16> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
434 ; CHECK-LABEL: vpreduce_smax_nxv1i16:
436 ; CHECK-NEXT: vsetivli zero, 1, e16, m1, ta, ma
437 ; CHECK-NEXT: vmv.s.x v9, a0
438 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
439 ; CHECK-NEXT: vredmax.vs v9, v8, v9, v0.t
440 ; CHECK-NEXT: vmv.x.s a0, v9
442 %r = call i16 @llvm.vp.reduce.smax.nxv1i16(i16 %s, <vscale x 1 x i16> %v, <vscale x 1 x i1> %m, i32 %evl)
446 declare i16 @llvm.vp.reduce.umin.nxv1i16(i16, <vscale x 1 x i16>, <vscale x 1 x i1>, i32)
448 define signext i16 @vpreduce_umin_nxv1i16(i16 signext %s, <vscale x 1 x i16> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
449 ; RV32-LABEL: vpreduce_umin_nxv1i16:
451 ; RV32-NEXT: slli a0, a0, 16
452 ; RV32-NEXT: srli a0, a0, 16
453 ; RV32-NEXT: vsetivli zero, 1, e16, m1, ta, ma
454 ; RV32-NEXT: vmv.s.x v9, a0
455 ; RV32-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
456 ; RV32-NEXT: vredminu.vs v9, v8, v9, v0.t
457 ; RV32-NEXT: vmv.x.s a0, v9
460 ; RV64-LABEL: vpreduce_umin_nxv1i16:
462 ; RV64-NEXT: slli a0, a0, 48
463 ; RV64-NEXT: srli a0, a0, 48
464 ; RV64-NEXT: vsetivli zero, 1, e16, m1, ta, ma
465 ; RV64-NEXT: vmv.s.x v9, a0
466 ; RV64-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
467 ; RV64-NEXT: vredminu.vs v9, v8, v9, v0.t
468 ; RV64-NEXT: vmv.x.s a0, v9
470 %r = call i16 @llvm.vp.reduce.umin.nxv1i16(i16 %s, <vscale x 1 x i16> %v, <vscale x 1 x i1> %m, i32 %evl)
474 declare i16 @llvm.vp.reduce.smin.nxv1i16(i16, <vscale x 1 x i16>, <vscale x 1 x i1>, i32)
476 define signext i16 @vpreduce_smin_nxv1i16(i16 signext %s, <vscale x 1 x i16> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
477 ; CHECK-LABEL: vpreduce_smin_nxv1i16:
479 ; CHECK-NEXT: vsetivli zero, 1, e16, m1, ta, ma
480 ; CHECK-NEXT: vmv.s.x v9, a0
481 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
482 ; CHECK-NEXT: vredmin.vs v9, v8, v9, v0.t
483 ; CHECK-NEXT: vmv.x.s a0, v9
485 %r = call i16 @llvm.vp.reduce.smin.nxv1i16(i16 %s, <vscale x 1 x i16> %v, <vscale x 1 x i1> %m, i32 %evl)
489 declare i16 @llvm.vp.reduce.and.nxv1i16(i16, <vscale x 1 x i16>, <vscale x 1 x i1>, i32)
491 define signext i16 @vpreduce_and_nxv1i16(i16 signext %s, <vscale x 1 x i16> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
492 ; CHECK-LABEL: vpreduce_and_nxv1i16:
494 ; CHECK-NEXT: vsetivli zero, 1, e16, m1, ta, ma
495 ; CHECK-NEXT: vmv.s.x v9, a0
496 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
497 ; CHECK-NEXT: vredand.vs v9, v8, v9, v0.t
498 ; CHECK-NEXT: vmv.x.s a0, v9
500 %r = call i16 @llvm.vp.reduce.and.nxv1i16(i16 %s, <vscale x 1 x i16> %v, <vscale x 1 x i1> %m, i32 %evl)
504 declare i16 @llvm.vp.reduce.or.nxv1i16(i16, <vscale x 1 x i16>, <vscale x 1 x i1>, i32)
506 define signext i16 @vpreduce_or_nxv1i16(i16 signext %s, <vscale x 1 x i16> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
507 ; CHECK-LABEL: vpreduce_or_nxv1i16:
509 ; CHECK-NEXT: vsetivli zero, 1, e16, m1, ta, ma
510 ; CHECK-NEXT: vmv.s.x v9, a0
511 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
512 ; CHECK-NEXT: vredor.vs v9, v8, v9, v0.t
513 ; CHECK-NEXT: vmv.x.s a0, v9
515 %r = call i16 @llvm.vp.reduce.or.nxv1i16(i16 %s, <vscale x 1 x i16> %v, <vscale x 1 x i1> %m, i32 %evl)
519 declare i16 @llvm.vp.reduce.xor.nxv1i16(i16, <vscale x 1 x i16>, <vscale x 1 x i1>, i32)
521 define signext i16 @vpreduce_xor_nxv1i16(i16 signext %s, <vscale x 1 x i16> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
522 ; CHECK-LABEL: vpreduce_xor_nxv1i16:
524 ; CHECK-NEXT: vsetivli zero, 1, e16, m1, ta, ma
525 ; CHECK-NEXT: vmv.s.x v9, a0
526 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
527 ; CHECK-NEXT: vredxor.vs v9, v8, v9, v0.t
528 ; CHECK-NEXT: vmv.x.s a0, v9
530 %r = call i16 @llvm.vp.reduce.xor.nxv1i16(i16 %s, <vscale x 1 x i16> %v, <vscale x 1 x i1> %m, i32 %evl)
534 declare i16 @llvm.vp.reduce.add.nxv2i16(i16, <vscale x 2 x i16>, <vscale x 2 x i1>, i32)
536 define signext i16 @vpreduce_add_nxv2i16(i16 signext %s, <vscale x 2 x i16> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
537 ; CHECK-LABEL: vpreduce_add_nxv2i16:
539 ; CHECK-NEXT: vsetivli zero, 1, e16, m1, ta, ma
540 ; CHECK-NEXT: vmv.s.x v9, a0
541 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
542 ; CHECK-NEXT: vredsum.vs v9, v8, v9, v0.t
543 ; CHECK-NEXT: vmv.x.s a0, v9
545 %r = call i16 @llvm.vp.reduce.add.nxv2i16(i16 %s, <vscale x 2 x i16> %v, <vscale x 2 x i1> %m, i32 %evl)
549 declare i16 @llvm.vp.reduce.umax.nxv2i16(i16, <vscale x 2 x i16>, <vscale x 2 x i1>, i32)
551 define signext i16 @vpreduce_umax_nxv2i16(i16 signext %s, <vscale x 2 x i16> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
552 ; RV32-LABEL: vpreduce_umax_nxv2i16:
554 ; RV32-NEXT: slli a0, a0, 16
555 ; RV32-NEXT: srli a0, a0, 16
556 ; RV32-NEXT: vsetivli zero, 1, e16, m1, ta, ma
557 ; RV32-NEXT: vmv.s.x v9, a0
558 ; RV32-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
559 ; RV32-NEXT: vredmaxu.vs v9, v8, v9, v0.t
560 ; RV32-NEXT: vmv.x.s a0, v9
563 ; RV64-LABEL: vpreduce_umax_nxv2i16:
565 ; RV64-NEXT: slli a0, a0, 48
566 ; RV64-NEXT: srli a0, a0, 48
567 ; RV64-NEXT: vsetivli zero, 1, e16, m1, ta, ma
568 ; RV64-NEXT: vmv.s.x v9, a0
569 ; RV64-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
570 ; RV64-NEXT: vredmaxu.vs v9, v8, v9, v0.t
571 ; RV64-NEXT: vmv.x.s a0, v9
573 %r = call i16 @llvm.vp.reduce.umax.nxv2i16(i16 %s, <vscale x 2 x i16> %v, <vscale x 2 x i1> %m, i32 %evl)
577 declare i16 @llvm.vp.reduce.smax.nxv2i16(i16, <vscale x 2 x i16>, <vscale x 2 x i1>, i32)
579 define signext i16 @vpreduce_smax_nxv2i16(i16 signext %s, <vscale x 2 x i16> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
580 ; CHECK-LABEL: vpreduce_smax_nxv2i16:
582 ; CHECK-NEXT: vsetivli zero, 1, e16, m1, ta, ma
583 ; CHECK-NEXT: vmv.s.x v9, a0
584 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
585 ; CHECK-NEXT: vredmax.vs v9, v8, v9, v0.t
586 ; CHECK-NEXT: vmv.x.s a0, v9
588 %r = call i16 @llvm.vp.reduce.smax.nxv2i16(i16 %s, <vscale x 2 x i16> %v, <vscale x 2 x i1> %m, i32 %evl)
592 declare i16 @llvm.vp.reduce.umin.nxv2i16(i16, <vscale x 2 x i16>, <vscale x 2 x i1>, i32)
594 define signext i16 @vpreduce_umin_nxv2i16(i16 signext %s, <vscale x 2 x i16> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
595 ; RV32-LABEL: vpreduce_umin_nxv2i16:
597 ; RV32-NEXT: slli a0, a0, 16
598 ; RV32-NEXT: srli a0, a0, 16
599 ; RV32-NEXT: vsetivli zero, 1, e16, m1, ta, ma
600 ; RV32-NEXT: vmv.s.x v9, a0
601 ; RV32-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
602 ; RV32-NEXT: vredminu.vs v9, v8, v9, v0.t
603 ; RV32-NEXT: vmv.x.s a0, v9
606 ; RV64-LABEL: vpreduce_umin_nxv2i16:
608 ; RV64-NEXT: slli a0, a0, 48
609 ; RV64-NEXT: srli a0, a0, 48
610 ; RV64-NEXT: vsetivli zero, 1, e16, m1, ta, ma
611 ; RV64-NEXT: vmv.s.x v9, a0
612 ; RV64-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
613 ; RV64-NEXT: vredminu.vs v9, v8, v9, v0.t
614 ; RV64-NEXT: vmv.x.s a0, v9
616 %r = call i16 @llvm.vp.reduce.umin.nxv2i16(i16 %s, <vscale x 2 x i16> %v, <vscale x 2 x i1> %m, i32 %evl)
620 declare i16 @llvm.vp.reduce.smin.nxv2i16(i16, <vscale x 2 x i16>, <vscale x 2 x i1>, i32)
622 define signext i16 @vpreduce_smin_nxv2i16(i16 signext %s, <vscale x 2 x i16> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
623 ; CHECK-LABEL: vpreduce_smin_nxv2i16:
625 ; CHECK-NEXT: vsetivli zero, 1, e16, m1, ta, ma
626 ; CHECK-NEXT: vmv.s.x v9, a0
627 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
628 ; CHECK-NEXT: vredmin.vs v9, v8, v9, v0.t
629 ; CHECK-NEXT: vmv.x.s a0, v9
631 %r = call i16 @llvm.vp.reduce.smin.nxv2i16(i16 %s, <vscale x 2 x i16> %v, <vscale x 2 x i1> %m, i32 %evl)
635 declare i16 @llvm.vp.reduce.and.nxv2i16(i16, <vscale x 2 x i16>, <vscale x 2 x i1>, i32)
637 define signext i16 @vpreduce_and_nxv2i16(i16 signext %s, <vscale x 2 x i16> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
638 ; CHECK-LABEL: vpreduce_and_nxv2i16:
640 ; CHECK-NEXT: vsetivli zero, 1, e16, m1, ta, ma
641 ; CHECK-NEXT: vmv.s.x v9, a0
642 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
643 ; CHECK-NEXT: vredand.vs v9, v8, v9, v0.t
644 ; CHECK-NEXT: vmv.x.s a0, v9
646 %r = call i16 @llvm.vp.reduce.and.nxv2i16(i16 %s, <vscale x 2 x i16> %v, <vscale x 2 x i1> %m, i32 %evl)
650 declare i16 @llvm.vp.reduce.or.nxv2i16(i16, <vscale x 2 x i16>, <vscale x 2 x i1>, i32)
652 define signext i16 @vpreduce_or_nxv2i16(i16 signext %s, <vscale x 2 x i16> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
653 ; CHECK-LABEL: vpreduce_or_nxv2i16:
655 ; CHECK-NEXT: vsetivli zero, 1, e16, m1, ta, ma
656 ; CHECK-NEXT: vmv.s.x v9, a0
657 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
658 ; CHECK-NEXT: vredor.vs v9, v8, v9, v0.t
659 ; CHECK-NEXT: vmv.x.s a0, v9
661 %r = call i16 @llvm.vp.reduce.or.nxv2i16(i16 %s, <vscale x 2 x i16> %v, <vscale x 2 x i1> %m, i32 %evl)
665 declare i16 @llvm.vp.reduce.xor.nxv2i16(i16, <vscale x 2 x i16>, <vscale x 2 x i1>, i32)
667 define signext i16 @vpreduce_xor_nxv2i16(i16 signext %s, <vscale x 2 x i16> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
668 ; CHECK-LABEL: vpreduce_xor_nxv2i16:
670 ; CHECK-NEXT: vsetivli zero, 1, e16, m1, ta, ma
671 ; CHECK-NEXT: vmv.s.x v9, a0
672 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
673 ; CHECK-NEXT: vredxor.vs v9, v8, v9, v0.t
674 ; CHECK-NEXT: vmv.x.s a0, v9
676 %r = call i16 @llvm.vp.reduce.xor.nxv2i16(i16 %s, <vscale x 2 x i16> %v, <vscale x 2 x i1> %m, i32 %evl)
680 declare i16 @llvm.vp.reduce.add.nxv4i16(i16, <vscale x 4 x i16>, <vscale x 4 x i1>, i32)
682 define signext i16 @vpreduce_add_nxv4i16(i16 signext %s, <vscale x 4 x i16> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
683 ; CHECK-LABEL: vpreduce_add_nxv4i16:
685 ; CHECK-NEXT: vsetivli zero, 1, e16, m1, ta, ma
686 ; CHECK-NEXT: vmv.s.x v9, a0
687 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, ta, ma
688 ; CHECK-NEXT: vredsum.vs v9, v8, v9, v0.t
689 ; CHECK-NEXT: vmv.x.s a0, v9
691 %r = call i16 @llvm.vp.reduce.add.nxv4i16(i16 %s, <vscale x 4 x i16> %v, <vscale x 4 x i1> %m, i32 %evl)
695 declare i16 @llvm.vp.reduce.umax.nxv4i16(i16, <vscale x 4 x i16>, <vscale x 4 x i1>, i32)
697 define signext i16 @vpreduce_umax_nxv4i16(i16 signext %s, <vscale x 4 x i16> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
698 ; RV32-LABEL: vpreduce_umax_nxv4i16:
700 ; RV32-NEXT: slli a0, a0, 16
701 ; RV32-NEXT: srli a0, a0, 16
702 ; RV32-NEXT: vsetivli zero, 1, e16, m1, ta, ma
703 ; RV32-NEXT: vmv.s.x v9, a0
704 ; RV32-NEXT: vsetvli zero, a1, e16, m1, ta, ma
705 ; RV32-NEXT: vredmaxu.vs v9, v8, v9, v0.t
706 ; RV32-NEXT: vmv.x.s a0, v9
709 ; RV64-LABEL: vpreduce_umax_nxv4i16:
711 ; RV64-NEXT: slli a0, a0, 48
712 ; RV64-NEXT: srli a0, a0, 48
713 ; RV64-NEXT: vsetivli zero, 1, e16, m1, ta, ma
714 ; RV64-NEXT: vmv.s.x v9, a0
715 ; RV64-NEXT: vsetvli zero, a1, e16, m1, ta, ma
716 ; RV64-NEXT: vredmaxu.vs v9, v8, v9, v0.t
717 ; RV64-NEXT: vmv.x.s a0, v9
719 %r = call i16 @llvm.vp.reduce.umax.nxv4i16(i16 %s, <vscale x 4 x i16> %v, <vscale x 4 x i1> %m, i32 %evl)
723 declare i16 @llvm.vp.reduce.smax.nxv4i16(i16, <vscale x 4 x i16>, <vscale x 4 x i1>, i32)
725 define signext i16 @vpreduce_smax_nxv4i16(i16 signext %s, <vscale x 4 x i16> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
726 ; CHECK-LABEL: vpreduce_smax_nxv4i16:
728 ; CHECK-NEXT: vsetivli zero, 1, e16, m1, ta, ma
729 ; CHECK-NEXT: vmv.s.x v9, a0
730 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, ta, ma
731 ; CHECK-NEXT: vredmax.vs v9, v8, v9, v0.t
732 ; CHECK-NEXT: vmv.x.s a0, v9
734 %r = call i16 @llvm.vp.reduce.smax.nxv4i16(i16 %s, <vscale x 4 x i16> %v, <vscale x 4 x i1> %m, i32 %evl)
738 declare i16 @llvm.vp.reduce.umin.nxv4i16(i16, <vscale x 4 x i16>, <vscale x 4 x i1>, i32)
740 define signext i16 @vpreduce_umin_nxv4i16(i16 signext %s, <vscale x 4 x i16> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
741 ; RV32-LABEL: vpreduce_umin_nxv4i16:
743 ; RV32-NEXT: slli a0, a0, 16
744 ; RV32-NEXT: srli a0, a0, 16
745 ; RV32-NEXT: vsetivli zero, 1, e16, m1, ta, ma
746 ; RV32-NEXT: vmv.s.x v9, a0
747 ; RV32-NEXT: vsetvli zero, a1, e16, m1, ta, ma
748 ; RV32-NEXT: vredminu.vs v9, v8, v9, v0.t
749 ; RV32-NEXT: vmv.x.s a0, v9
752 ; RV64-LABEL: vpreduce_umin_nxv4i16:
754 ; RV64-NEXT: slli a0, a0, 48
755 ; RV64-NEXT: srli a0, a0, 48
756 ; RV64-NEXT: vsetivli zero, 1, e16, m1, ta, ma
757 ; RV64-NEXT: vmv.s.x v9, a0
758 ; RV64-NEXT: vsetvli zero, a1, e16, m1, ta, ma
759 ; RV64-NEXT: vredminu.vs v9, v8, v9, v0.t
760 ; RV64-NEXT: vmv.x.s a0, v9
762 %r = call i16 @llvm.vp.reduce.umin.nxv4i16(i16 %s, <vscale x 4 x i16> %v, <vscale x 4 x i1> %m, i32 %evl)
766 declare i16 @llvm.vp.reduce.smin.nxv4i16(i16, <vscale x 4 x i16>, <vscale x 4 x i1>, i32)
768 define signext i16 @vpreduce_smin_nxv4i16(i16 signext %s, <vscale x 4 x i16> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
769 ; CHECK-LABEL: vpreduce_smin_nxv4i16:
771 ; CHECK-NEXT: vsetivli zero, 1, e16, m1, ta, ma
772 ; CHECK-NEXT: vmv.s.x v9, a0
773 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, ta, ma
774 ; CHECK-NEXT: vredmin.vs v9, v8, v9, v0.t
775 ; CHECK-NEXT: vmv.x.s a0, v9
777 %r = call i16 @llvm.vp.reduce.smin.nxv4i16(i16 %s, <vscale x 4 x i16> %v, <vscale x 4 x i1> %m, i32 %evl)
781 declare i16 @llvm.vp.reduce.and.nxv4i16(i16, <vscale x 4 x i16>, <vscale x 4 x i1>, i32)
783 define signext i16 @vpreduce_and_nxv4i16(i16 signext %s, <vscale x 4 x i16> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
784 ; CHECK-LABEL: vpreduce_and_nxv4i16:
786 ; CHECK-NEXT: vsetivli zero, 1, e16, m1, ta, ma
787 ; CHECK-NEXT: vmv.s.x v9, a0
788 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, ta, ma
789 ; CHECK-NEXT: vredand.vs v9, v8, v9, v0.t
790 ; CHECK-NEXT: vmv.x.s a0, v9
792 %r = call i16 @llvm.vp.reduce.and.nxv4i16(i16 %s, <vscale x 4 x i16> %v, <vscale x 4 x i1> %m, i32 %evl)
796 declare i16 @llvm.vp.reduce.or.nxv4i16(i16, <vscale x 4 x i16>, <vscale x 4 x i1>, i32)
798 define signext i16 @vpreduce_or_nxv4i16(i16 signext %s, <vscale x 4 x i16> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
799 ; CHECK-LABEL: vpreduce_or_nxv4i16:
801 ; CHECK-NEXT: vsetivli zero, 1, e16, m1, ta, ma
802 ; CHECK-NEXT: vmv.s.x v9, a0
803 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, ta, ma
804 ; CHECK-NEXT: vredor.vs v9, v8, v9, v0.t
805 ; CHECK-NEXT: vmv.x.s a0, v9
807 %r = call i16 @llvm.vp.reduce.or.nxv4i16(i16 %s, <vscale x 4 x i16> %v, <vscale x 4 x i1> %m, i32 %evl)
811 declare i16 @llvm.vp.reduce.xor.nxv4i16(i16, <vscale x 4 x i16>, <vscale x 4 x i1>, i32)
813 define signext i16 @vpreduce_xor_nxv4i16(i16 signext %s, <vscale x 4 x i16> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
814 ; CHECK-LABEL: vpreduce_xor_nxv4i16:
816 ; CHECK-NEXT: vsetivli zero, 1, e16, m1, ta, ma
817 ; CHECK-NEXT: vmv.s.x v9, a0
818 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, ta, ma
819 ; CHECK-NEXT: vredxor.vs v9, v8, v9, v0.t
820 ; CHECK-NEXT: vmv.x.s a0, v9
822 %r = call i16 @llvm.vp.reduce.xor.nxv4i16(i16 %s, <vscale x 4 x i16> %v, <vscale x 4 x i1> %m, i32 %evl)
826 declare i32 @llvm.vp.reduce.add.nxv1i32(i32, <vscale x 1 x i32>, <vscale x 1 x i1>, i32)
828 define signext i32 @vpreduce_add_nxv1i32(i32 signext %s, <vscale x 1 x i32> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
829 ; CHECK-LABEL: vpreduce_add_nxv1i32:
831 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
832 ; CHECK-NEXT: vmv.s.x v9, a0
833 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
834 ; CHECK-NEXT: vredsum.vs v9, v8, v9, v0.t
835 ; CHECK-NEXT: vmv.x.s a0, v9
837 %r = call i32 @llvm.vp.reduce.add.nxv1i32(i32 %s, <vscale x 1 x i32> %v, <vscale x 1 x i1> %m, i32 %evl)
841 declare i32 @llvm.vp.reduce.umax.nxv1i32(i32, <vscale x 1 x i32>, <vscale x 1 x i1>, i32)
843 define signext i32 @vpreduce_umax_nxv1i32(i32 signext %s, <vscale x 1 x i32> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
844 ; CHECK-LABEL: vpreduce_umax_nxv1i32:
846 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
847 ; CHECK-NEXT: vmv.s.x v9, a0
848 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
849 ; CHECK-NEXT: vredmaxu.vs v9, v8, v9, v0.t
850 ; CHECK-NEXT: vmv.x.s a0, v9
852 %r = call i32 @llvm.vp.reduce.umax.nxv1i32(i32 %s, <vscale x 1 x i32> %v, <vscale x 1 x i1> %m, i32 %evl)
856 declare i32 @llvm.vp.reduce.smax.nxv1i32(i32, <vscale x 1 x i32>, <vscale x 1 x i1>, i32)
858 define signext i32 @vpreduce_smax_nxv1i32(i32 signext %s, <vscale x 1 x i32> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
859 ; CHECK-LABEL: vpreduce_smax_nxv1i32:
861 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
862 ; CHECK-NEXT: vmv.s.x v9, a0
863 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
864 ; CHECK-NEXT: vredmax.vs v9, v8, v9, v0.t
865 ; CHECK-NEXT: vmv.x.s a0, v9
867 %r = call i32 @llvm.vp.reduce.smax.nxv1i32(i32 %s, <vscale x 1 x i32> %v, <vscale x 1 x i1> %m, i32 %evl)
871 declare i32 @llvm.vp.reduce.umin.nxv1i32(i32, <vscale x 1 x i32>, <vscale x 1 x i1>, i32)
873 define signext i32 @vpreduce_umin_nxv1i32(i32 signext %s, <vscale x 1 x i32> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
874 ; CHECK-LABEL: vpreduce_umin_nxv1i32:
876 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
877 ; CHECK-NEXT: vmv.s.x v9, a0
878 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
879 ; CHECK-NEXT: vredminu.vs v9, v8, v9, v0.t
880 ; CHECK-NEXT: vmv.x.s a0, v9
882 %r = call i32 @llvm.vp.reduce.umin.nxv1i32(i32 %s, <vscale x 1 x i32> %v, <vscale x 1 x i1> %m, i32 %evl)
886 declare i32 @llvm.vp.reduce.smin.nxv1i32(i32, <vscale x 1 x i32>, <vscale x 1 x i1>, i32)
888 define signext i32 @vpreduce_smin_nxv1i32(i32 signext %s, <vscale x 1 x i32> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
889 ; CHECK-LABEL: vpreduce_smin_nxv1i32:
891 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
892 ; CHECK-NEXT: vmv.s.x v9, a0
893 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
894 ; CHECK-NEXT: vredmin.vs v9, v8, v9, v0.t
895 ; CHECK-NEXT: vmv.x.s a0, v9
897 %r = call i32 @llvm.vp.reduce.smin.nxv1i32(i32 %s, <vscale x 1 x i32> %v, <vscale x 1 x i1> %m, i32 %evl)
901 declare i32 @llvm.vp.reduce.and.nxv1i32(i32, <vscale x 1 x i32>, <vscale x 1 x i1>, i32)
903 define signext i32 @vpreduce_and_nxv1i32(i32 signext %s, <vscale x 1 x i32> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
904 ; CHECK-LABEL: vpreduce_and_nxv1i32:
906 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
907 ; CHECK-NEXT: vmv.s.x v9, a0
908 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
909 ; CHECK-NEXT: vredand.vs v9, v8, v9, v0.t
910 ; CHECK-NEXT: vmv.x.s a0, v9
912 %r = call i32 @llvm.vp.reduce.and.nxv1i32(i32 %s, <vscale x 1 x i32> %v, <vscale x 1 x i1> %m, i32 %evl)
916 declare i32 @llvm.vp.reduce.or.nxv1i32(i32, <vscale x 1 x i32>, <vscale x 1 x i1>, i32)
918 define signext i32 @vpreduce_or_nxv1i32(i32 signext %s, <vscale x 1 x i32> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
919 ; CHECK-LABEL: vpreduce_or_nxv1i32:
921 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
922 ; CHECK-NEXT: vmv.s.x v9, a0
923 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
924 ; CHECK-NEXT: vredor.vs v9, v8, v9, v0.t
925 ; CHECK-NEXT: vmv.x.s a0, v9
927 %r = call i32 @llvm.vp.reduce.or.nxv1i32(i32 %s, <vscale x 1 x i32> %v, <vscale x 1 x i1> %m, i32 %evl)
931 declare i32 @llvm.vp.reduce.xor.nxv1i32(i32, <vscale x 1 x i32>, <vscale x 1 x i1>, i32)
933 define signext i32 @vpreduce_xor_nxv1i32(i32 signext %s, <vscale x 1 x i32> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
934 ; CHECK-LABEL: vpreduce_xor_nxv1i32:
936 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
937 ; CHECK-NEXT: vmv.s.x v9, a0
938 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
939 ; CHECK-NEXT: vredxor.vs v9, v8, v9, v0.t
940 ; CHECK-NEXT: vmv.x.s a0, v9
942 %r = call i32 @llvm.vp.reduce.xor.nxv1i32(i32 %s, <vscale x 1 x i32> %v, <vscale x 1 x i1> %m, i32 %evl)
946 declare i32 @llvm.vp.reduce.add.nxv2i32(i32, <vscale x 2 x i32>, <vscale x 2 x i1>, i32)
948 define signext i32 @vpreduce_add_nxv2i32(i32 signext %s, <vscale x 2 x i32> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
949 ; CHECK-LABEL: vpreduce_add_nxv2i32:
951 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
952 ; CHECK-NEXT: vmv.s.x v9, a0
953 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
954 ; CHECK-NEXT: vredsum.vs v9, v8, v9, v0.t
955 ; CHECK-NEXT: vmv.x.s a0, v9
957 %r = call i32 @llvm.vp.reduce.add.nxv2i32(i32 %s, <vscale x 2 x i32> %v, <vscale x 2 x i1> %m, i32 %evl)
961 declare i32 @llvm.vp.reduce.umax.nxv2i32(i32, <vscale x 2 x i32>, <vscale x 2 x i1>, i32)
963 define signext i32 @vpreduce_umax_nxv2i32(i32 signext %s, <vscale x 2 x i32> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
964 ; CHECK-LABEL: vpreduce_umax_nxv2i32:
966 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
967 ; CHECK-NEXT: vmv.s.x v9, a0
968 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
969 ; CHECK-NEXT: vredmaxu.vs v9, v8, v9, v0.t
970 ; CHECK-NEXT: vmv.x.s a0, v9
972 %r = call i32 @llvm.vp.reduce.umax.nxv2i32(i32 %s, <vscale x 2 x i32> %v, <vscale x 2 x i1> %m, i32 %evl)
976 declare i32 @llvm.vp.reduce.smax.nxv2i32(i32, <vscale x 2 x i32>, <vscale x 2 x i1>, i32)
978 define signext i32 @vpreduce_smax_nxv2i32(i32 signext %s, <vscale x 2 x i32> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
979 ; CHECK-LABEL: vpreduce_smax_nxv2i32:
981 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
982 ; CHECK-NEXT: vmv.s.x v9, a0
983 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
984 ; CHECK-NEXT: vredmax.vs v9, v8, v9, v0.t
985 ; CHECK-NEXT: vmv.x.s a0, v9
987 %r = call i32 @llvm.vp.reduce.smax.nxv2i32(i32 %s, <vscale x 2 x i32> %v, <vscale x 2 x i1> %m, i32 %evl)
991 declare i32 @llvm.vp.reduce.umin.nxv2i32(i32, <vscale x 2 x i32>, <vscale x 2 x i1>, i32)
993 define signext i32 @vpreduce_umin_nxv2i32(i32 signext %s, <vscale x 2 x i32> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
994 ; CHECK-LABEL: vpreduce_umin_nxv2i32:
996 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
997 ; CHECK-NEXT: vmv.s.x v9, a0
998 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
999 ; CHECK-NEXT: vredminu.vs v9, v8, v9, v0.t
1000 ; CHECK-NEXT: vmv.x.s a0, v9
1002 %r = call i32 @llvm.vp.reduce.umin.nxv2i32(i32 %s, <vscale x 2 x i32> %v, <vscale x 2 x i1> %m, i32 %evl)
1006 declare i32 @llvm.vp.reduce.smin.nxv2i32(i32, <vscale x 2 x i32>, <vscale x 2 x i1>, i32)
1008 define signext i32 @vpreduce_smin_nxv2i32(i32 signext %s, <vscale x 2 x i32> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1009 ; CHECK-LABEL: vpreduce_smin_nxv2i32:
1011 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
1012 ; CHECK-NEXT: vmv.s.x v9, a0
1013 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
1014 ; CHECK-NEXT: vredmin.vs v9, v8, v9, v0.t
1015 ; CHECK-NEXT: vmv.x.s a0, v9
1017 %r = call i32 @llvm.vp.reduce.smin.nxv2i32(i32 %s, <vscale x 2 x i32> %v, <vscale x 2 x i1> %m, i32 %evl)
1021 declare i32 @llvm.vp.reduce.and.nxv2i32(i32, <vscale x 2 x i32>, <vscale x 2 x i1>, i32)
1023 define signext i32 @vpreduce_and_nxv2i32(i32 signext %s, <vscale x 2 x i32> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1024 ; CHECK-LABEL: vpreduce_and_nxv2i32:
1026 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
1027 ; CHECK-NEXT: vmv.s.x v9, a0
1028 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
1029 ; CHECK-NEXT: vredand.vs v9, v8, v9, v0.t
1030 ; CHECK-NEXT: vmv.x.s a0, v9
1032 %r = call i32 @llvm.vp.reduce.and.nxv2i32(i32 %s, <vscale x 2 x i32> %v, <vscale x 2 x i1> %m, i32 %evl)
1036 declare i32 @llvm.vp.reduce.or.nxv2i32(i32, <vscale x 2 x i32>, <vscale x 2 x i1>, i32)
1038 define signext i32 @vpreduce_or_nxv2i32(i32 signext %s, <vscale x 2 x i32> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1039 ; CHECK-LABEL: vpreduce_or_nxv2i32:
1041 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
1042 ; CHECK-NEXT: vmv.s.x v9, a0
1043 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
1044 ; CHECK-NEXT: vredor.vs v9, v8, v9, v0.t
1045 ; CHECK-NEXT: vmv.x.s a0, v9
1047 %r = call i32 @llvm.vp.reduce.or.nxv2i32(i32 %s, <vscale x 2 x i32> %v, <vscale x 2 x i1> %m, i32 %evl)
1051 declare i32 @llvm.vp.reduce.xor.nxv2i32(i32, <vscale x 2 x i32>, <vscale x 2 x i1>, i32)
1053 define signext i32 @vpreduce_xor_nxv2i32(i32 signext %s, <vscale x 2 x i32> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1054 ; CHECK-LABEL: vpreduce_xor_nxv2i32:
1056 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
1057 ; CHECK-NEXT: vmv.s.x v9, a0
1058 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
1059 ; CHECK-NEXT: vredxor.vs v9, v8, v9, v0.t
1060 ; CHECK-NEXT: vmv.x.s a0, v9
1062 %r = call i32 @llvm.vp.reduce.xor.nxv2i32(i32 %s, <vscale x 2 x i32> %v, <vscale x 2 x i1> %m, i32 %evl)
1066 declare i32 @llvm.vp.reduce.add.nxv4i32(i32, <vscale x 4 x i32>, <vscale x 4 x i1>, i32)
1068 define signext i32 @vpreduce_add_nxv4i32(i32 signext %s, <vscale x 4 x i32> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1069 ; CHECK-LABEL: vpreduce_add_nxv4i32:
1071 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
1072 ; CHECK-NEXT: vmv.s.x v10, a0
1073 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
1074 ; CHECK-NEXT: vredsum.vs v10, v8, v10, v0.t
1075 ; CHECK-NEXT: vmv.x.s a0, v10
1077 %r = call i32 @llvm.vp.reduce.add.nxv4i32(i32 %s, <vscale x 4 x i32> %v, <vscale x 4 x i1> %m, i32 %evl)
1081 declare i32 @llvm.vp.reduce.umax.nxv4i32(i32, <vscale x 4 x i32>, <vscale x 4 x i1>, i32)
1083 define signext i32 @vpreduce_umax_nxv4i32(i32 signext %s, <vscale x 4 x i32> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1084 ; CHECK-LABEL: vpreduce_umax_nxv4i32:
1086 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
1087 ; CHECK-NEXT: vmv.s.x v10, a0
1088 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
1089 ; CHECK-NEXT: vredmaxu.vs v10, v8, v10, v0.t
1090 ; CHECK-NEXT: vmv.x.s a0, v10
1092 %r = call i32 @llvm.vp.reduce.umax.nxv4i32(i32 %s, <vscale x 4 x i32> %v, <vscale x 4 x i1> %m, i32 %evl)
1096 declare i32 @llvm.vp.reduce.umax.nxv32i32(i32, <vscale x 32 x i32>, <vscale x 32 x i1>, i32)
1098 define signext i32 @vpreduce_umax_nxv32i32(i32 signext %s, <vscale x 32 x i32> %v, <vscale x 32 x i1> %m, i32 zeroext %evl) {
1099 ; CHECK-LABEL: vpreduce_umax_nxv32i32:
1101 ; CHECK-NEXT: csrr a3, vlenb
1102 ; CHECK-NEXT: srli a2, a3, 2
1103 ; CHECK-NEXT: vsetvli a4, zero, e8, mf2, ta, ma
1104 ; CHECK-NEXT: vslidedown.vx v24, v0, a2
1105 ; CHECK-NEXT: slli a3, a3, 1
1106 ; CHECK-NEXT: sub a2, a1, a3
1107 ; CHECK-NEXT: sltu a4, a1, a2
1108 ; CHECK-NEXT: addi a4, a4, -1
1109 ; CHECK-NEXT: and a2, a4, a2
1110 ; CHECK-NEXT: bltu a1, a3, .LBB67_2
1111 ; CHECK-NEXT: # %bb.1:
1112 ; CHECK-NEXT: mv a1, a3
1113 ; CHECK-NEXT: .LBB67_2:
1114 ; CHECK-NEXT: vsetvli zero, zero, e32, m2, ta, ma
1115 ; CHECK-NEXT: vmv.s.x v25, a0
1116 ; CHECK-NEXT: vsetvli zero, a1, e32, m8, ta, ma
1117 ; CHECK-NEXT: vredmaxu.vs v25, v8, v25, v0.t
1118 ; CHECK-NEXT: vmv1r.v v0, v24
1119 ; CHECK-NEXT: vsetvli zero, a2, e32, m8, ta, ma
1120 ; CHECK-NEXT: vredmaxu.vs v25, v16, v25, v0.t
1121 ; CHECK-NEXT: vmv.x.s a0, v25
1123 %r = call i32 @llvm.vp.reduce.umax.nxv32i32(i32 %s, <vscale x 32 x i32> %v, <vscale x 32 x i1> %m, i32 %evl)
1127 declare i32 @llvm.vp.reduce.smax.nxv4i32(i32, <vscale x 4 x i32>, <vscale x 4 x i1>, i32)
1129 define signext i32 @vpreduce_smax_nxv4i32(i32 signext %s, <vscale x 4 x i32> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1130 ; CHECK-LABEL: vpreduce_smax_nxv4i32:
1132 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
1133 ; CHECK-NEXT: vmv.s.x v10, a0
1134 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
1135 ; CHECK-NEXT: vredmax.vs v10, v8, v10, v0.t
1136 ; CHECK-NEXT: vmv.x.s a0, v10
1138 %r = call i32 @llvm.vp.reduce.smax.nxv4i32(i32 %s, <vscale x 4 x i32> %v, <vscale x 4 x i1> %m, i32 %evl)
1142 declare i32 @llvm.vp.reduce.umin.nxv4i32(i32, <vscale x 4 x i32>, <vscale x 4 x i1>, i32)
1144 define signext i32 @vpreduce_umin_nxv4i32(i32 signext %s, <vscale x 4 x i32> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1145 ; CHECK-LABEL: vpreduce_umin_nxv4i32:
1147 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
1148 ; CHECK-NEXT: vmv.s.x v10, a0
1149 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
1150 ; CHECK-NEXT: vredminu.vs v10, v8, v10, v0.t
1151 ; CHECK-NEXT: vmv.x.s a0, v10
1153 %r = call i32 @llvm.vp.reduce.umin.nxv4i32(i32 %s, <vscale x 4 x i32> %v, <vscale x 4 x i1> %m, i32 %evl)
1157 declare i32 @llvm.vp.reduce.smin.nxv4i32(i32, <vscale x 4 x i32>, <vscale x 4 x i1>, i32)
1159 define signext i32 @vpreduce_smin_nxv4i32(i32 signext %s, <vscale x 4 x i32> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1160 ; CHECK-LABEL: vpreduce_smin_nxv4i32:
1162 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
1163 ; CHECK-NEXT: vmv.s.x v10, a0
1164 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
1165 ; CHECK-NEXT: vredmin.vs v10, v8, v10, v0.t
1166 ; CHECK-NEXT: vmv.x.s a0, v10
1168 %r = call i32 @llvm.vp.reduce.smin.nxv4i32(i32 %s, <vscale x 4 x i32> %v, <vscale x 4 x i1> %m, i32 %evl)
1172 declare i32 @llvm.vp.reduce.and.nxv4i32(i32, <vscale x 4 x i32>, <vscale x 4 x i1>, i32)
1174 define signext i32 @vpreduce_and_nxv4i32(i32 signext %s, <vscale x 4 x i32> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1175 ; CHECK-LABEL: vpreduce_and_nxv4i32:
1177 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
1178 ; CHECK-NEXT: vmv.s.x v10, a0
1179 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
1180 ; CHECK-NEXT: vredand.vs v10, v8, v10, v0.t
1181 ; CHECK-NEXT: vmv.x.s a0, v10
1183 %r = call i32 @llvm.vp.reduce.and.nxv4i32(i32 %s, <vscale x 4 x i32> %v, <vscale x 4 x i1> %m, i32 %evl)
1187 declare i32 @llvm.vp.reduce.or.nxv4i32(i32, <vscale x 4 x i32>, <vscale x 4 x i1>, i32)
1189 define signext i32 @vpreduce_or_nxv4i32(i32 signext %s, <vscale x 4 x i32> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1190 ; CHECK-LABEL: vpreduce_or_nxv4i32:
1192 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
1193 ; CHECK-NEXT: vmv.s.x v10, a0
1194 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
1195 ; CHECK-NEXT: vredor.vs v10, v8, v10, v0.t
1196 ; CHECK-NEXT: vmv.x.s a0, v10
1198 %r = call i32 @llvm.vp.reduce.or.nxv4i32(i32 %s, <vscale x 4 x i32> %v, <vscale x 4 x i1> %m, i32 %evl)
1202 declare i32 @llvm.vp.reduce.xor.nxv4i32(i32, <vscale x 4 x i32>, <vscale x 4 x i1>, i32)
1204 define signext i32 @vpreduce_xor_nxv4i32(i32 signext %s, <vscale x 4 x i32> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1205 ; CHECK-LABEL: vpreduce_xor_nxv4i32:
1207 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
1208 ; CHECK-NEXT: vmv.s.x v10, a0
1209 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
1210 ; CHECK-NEXT: vredxor.vs v10, v8, v10, v0.t
1211 ; CHECK-NEXT: vmv.x.s a0, v10
1213 %r = call i32 @llvm.vp.reduce.xor.nxv4i32(i32 %s, <vscale x 4 x i32> %v, <vscale x 4 x i1> %m, i32 %evl)
1217 declare i64 @llvm.vp.reduce.add.nxv1i64(i64, <vscale x 1 x i64>, <vscale x 1 x i1>, i32)
1219 define signext i64 @vpreduce_add_nxv1i64(i64 signext %s, <vscale x 1 x i64> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1220 ; RV32-LABEL: vpreduce_add_nxv1i64:
1222 ; RV32-NEXT: addi sp, sp, -16
1223 ; RV32-NEXT: .cfi_def_cfa_offset 16
1224 ; RV32-NEXT: sw a1, 12(sp)
1225 ; RV32-NEXT: sw a0, 8(sp)
1226 ; RV32-NEXT: addi a0, sp, 8
1227 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1228 ; RV32-NEXT: vlse64.v v9, (a0), zero
1229 ; RV32-NEXT: vsetvli zero, a2, e64, m1, ta, ma
1230 ; RV32-NEXT: vredsum.vs v9, v8, v9, v0.t
1231 ; RV32-NEXT: vmv.x.s a0, v9
1232 ; RV32-NEXT: li a1, 32
1233 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1234 ; RV32-NEXT: vsrl.vx v8, v9, a1
1235 ; RV32-NEXT: vmv.x.s a1, v8
1236 ; RV32-NEXT: addi sp, sp, 16
1239 ; RV64-LABEL: vpreduce_add_nxv1i64:
1241 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1242 ; RV64-NEXT: vmv.s.x v9, a0
1243 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
1244 ; RV64-NEXT: vredsum.vs v9, v8, v9, v0.t
1245 ; RV64-NEXT: vmv.x.s a0, v9
1247 %r = call i64 @llvm.vp.reduce.add.nxv1i64(i64 %s, <vscale x 1 x i64> %v, <vscale x 1 x i1> %m, i32 %evl)
1251 define signext i64 @vpwreduce_add_nxv1i32(i64 signext %s, <vscale x 1 x i32> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1252 ; RV32-LABEL: vpwreduce_add_nxv1i32:
1254 ; RV32-NEXT: addi sp, sp, -16
1255 ; RV32-NEXT: .cfi_def_cfa_offset 16
1256 ; RV32-NEXT: sw a1, 12(sp)
1257 ; RV32-NEXT: sw a0, 8(sp)
1258 ; RV32-NEXT: addi a0, sp, 8
1259 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1260 ; RV32-NEXT: vlse64.v v9, (a0), zero
1261 ; RV32-NEXT: vsetvli zero, a2, e32, mf2, ta, ma
1262 ; RV32-NEXT: vwredsum.vs v9, v8, v9, v0.t
1263 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1264 ; RV32-NEXT: vmv.x.s a0, v9
1265 ; RV32-NEXT: li a1, 32
1266 ; RV32-NEXT: vsrl.vx v8, v9, a1
1267 ; RV32-NEXT: vmv.x.s a1, v8
1268 ; RV32-NEXT: addi sp, sp, 16
1271 ; RV64-LABEL: vpwreduce_add_nxv1i32:
1273 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1274 ; RV64-NEXT: vmv.s.x v9, a0
1275 ; RV64-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
1276 ; RV64-NEXT: vwredsum.vs v9, v8, v9, v0.t
1277 ; RV64-NEXT: vsetvli zero, zero, e64, m1, ta, ma
1278 ; RV64-NEXT: vmv.x.s a0, v9
1280 %e = sext <vscale x 1 x i32> %v to <vscale x 1 x i64>
1281 %r = call i64 @llvm.vp.reduce.add.nxv1i64(i64 %s, <vscale x 1 x i64> %e, <vscale x 1 x i1> %m, i32 %evl)
1285 define signext i64 @vpwreduce_uadd_nxv1i32(i64 signext %s, <vscale x 1 x i32> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1286 ; RV32-LABEL: vpwreduce_uadd_nxv1i32:
1288 ; RV32-NEXT: addi sp, sp, -16
1289 ; RV32-NEXT: .cfi_def_cfa_offset 16
1290 ; RV32-NEXT: sw a1, 12(sp)
1291 ; RV32-NEXT: sw a0, 8(sp)
1292 ; RV32-NEXT: addi a0, sp, 8
1293 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1294 ; RV32-NEXT: vlse64.v v9, (a0), zero
1295 ; RV32-NEXT: vsetvli zero, a2, e32, mf2, ta, ma
1296 ; RV32-NEXT: vwredsum.vs v9, v8, v9, v0.t
1297 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1298 ; RV32-NEXT: vmv.x.s a0, v9
1299 ; RV32-NEXT: li a1, 32
1300 ; RV32-NEXT: vsrl.vx v8, v9, a1
1301 ; RV32-NEXT: vmv.x.s a1, v8
1302 ; RV32-NEXT: addi sp, sp, 16
1305 ; RV64-LABEL: vpwreduce_uadd_nxv1i32:
1307 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1308 ; RV64-NEXT: vmv.s.x v9, a0
1309 ; RV64-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
1310 ; RV64-NEXT: vwredsum.vs v9, v8, v9, v0.t
1311 ; RV64-NEXT: vsetvli zero, zero, e64, m1, ta, ma
1312 ; RV64-NEXT: vmv.x.s a0, v9
1314 %e = sext <vscale x 1 x i32> %v to <vscale x 1 x i64>
1315 %r = call i64 @llvm.vp.reduce.add.nxv1i64(i64 %s, <vscale x 1 x i64> %e, <vscale x 1 x i1> %m, i32 %evl)
1319 declare i64 @llvm.vp.reduce.umax.nxv1i64(i64, <vscale x 1 x i64>, <vscale x 1 x i1>, i32)
1321 define signext i64 @vpreduce_umax_nxv1i64(i64 signext %s, <vscale x 1 x i64> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1322 ; RV32-LABEL: vpreduce_umax_nxv1i64:
1324 ; RV32-NEXT: addi sp, sp, -16
1325 ; RV32-NEXT: .cfi_def_cfa_offset 16
1326 ; RV32-NEXT: sw a1, 12(sp)
1327 ; RV32-NEXT: sw a0, 8(sp)
1328 ; RV32-NEXT: addi a0, sp, 8
1329 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1330 ; RV32-NEXT: vlse64.v v9, (a0), zero
1331 ; RV32-NEXT: vsetvli zero, a2, e64, m1, ta, ma
1332 ; RV32-NEXT: vredmaxu.vs v9, v8, v9, v0.t
1333 ; RV32-NEXT: vmv.x.s a0, v9
1334 ; RV32-NEXT: li a1, 32
1335 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1336 ; RV32-NEXT: vsrl.vx v8, v9, a1
1337 ; RV32-NEXT: vmv.x.s a1, v8
1338 ; RV32-NEXT: addi sp, sp, 16
1341 ; RV64-LABEL: vpreduce_umax_nxv1i64:
1343 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1344 ; RV64-NEXT: vmv.s.x v9, a0
1345 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
1346 ; RV64-NEXT: vredmaxu.vs v9, v8, v9, v0.t
1347 ; RV64-NEXT: vmv.x.s a0, v9
1349 %r = call i64 @llvm.vp.reduce.umax.nxv1i64(i64 %s, <vscale x 1 x i64> %v, <vscale x 1 x i1> %m, i32 %evl)
1353 declare i64 @llvm.vp.reduce.smax.nxv1i64(i64, <vscale x 1 x i64>, <vscale x 1 x i1>, i32)
1355 define signext i64 @vpreduce_smax_nxv1i64(i64 signext %s, <vscale x 1 x i64> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1356 ; RV32-LABEL: vpreduce_smax_nxv1i64:
1358 ; RV32-NEXT: addi sp, sp, -16
1359 ; RV32-NEXT: .cfi_def_cfa_offset 16
1360 ; RV32-NEXT: sw a1, 12(sp)
1361 ; RV32-NEXT: sw a0, 8(sp)
1362 ; RV32-NEXT: addi a0, sp, 8
1363 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1364 ; RV32-NEXT: vlse64.v v9, (a0), zero
1365 ; RV32-NEXT: vsetvli zero, a2, e64, m1, ta, ma
1366 ; RV32-NEXT: vredmax.vs v9, v8, v9, v0.t
1367 ; RV32-NEXT: vmv.x.s a0, v9
1368 ; RV32-NEXT: li a1, 32
1369 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1370 ; RV32-NEXT: vsrl.vx v8, v9, a1
1371 ; RV32-NEXT: vmv.x.s a1, v8
1372 ; RV32-NEXT: addi sp, sp, 16
1375 ; RV64-LABEL: vpreduce_smax_nxv1i64:
1377 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1378 ; RV64-NEXT: vmv.s.x v9, a0
1379 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
1380 ; RV64-NEXT: vredmax.vs v9, v8, v9, v0.t
1381 ; RV64-NEXT: vmv.x.s a0, v9
1383 %r = call i64 @llvm.vp.reduce.smax.nxv1i64(i64 %s, <vscale x 1 x i64> %v, <vscale x 1 x i1> %m, i32 %evl)
1387 declare i64 @llvm.vp.reduce.umin.nxv1i64(i64, <vscale x 1 x i64>, <vscale x 1 x i1>, i32)
1389 define signext i64 @vpreduce_umin_nxv1i64(i64 signext %s, <vscale x 1 x i64> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1390 ; RV32-LABEL: vpreduce_umin_nxv1i64:
1392 ; RV32-NEXT: addi sp, sp, -16
1393 ; RV32-NEXT: .cfi_def_cfa_offset 16
1394 ; RV32-NEXT: sw a1, 12(sp)
1395 ; RV32-NEXT: sw a0, 8(sp)
1396 ; RV32-NEXT: addi a0, sp, 8
1397 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1398 ; RV32-NEXT: vlse64.v v9, (a0), zero
1399 ; RV32-NEXT: vsetvli zero, a2, e64, m1, ta, ma
1400 ; RV32-NEXT: vredminu.vs v9, v8, v9, v0.t
1401 ; RV32-NEXT: vmv.x.s a0, v9
1402 ; RV32-NEXT: li a1, 32
1403 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1404 ; RV32-NEXT: vsrl.vx v8, v9, a1
1405 ; RV32-NEXT: vmv.x.s a1, v8
1406 ; RV32-NEXT: addi sp, sp, 16
1409 ; RV64-LABEL: vpreduce_umin_nxv1i64:
1411 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1412 ; RV64-NEXT: vmv.s.x v9, a0
1413 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
1414 ; RV64-NEXT: vredminu.vs v9, v8, v9, v0.t
1415 ; RV64-NEXT: vmv.x.s a0, v9
1417 %r = call i64 @llvm.vp.reduce.umin.nxv1i64(i64 %s, <vscale x 1 x i64> %v, <vscale x 1 x i1> %m, i32 %evl)
1421 declare i64 @llvm.vp.reduce.smin.nxv1i64(i64, <vscale x 1 x i64>, <vscale x 1 x i1>, i32)
1423 define signext i64 @vpreduce_smin_nxv1i64(i64 signext %s, <vscale x 1 x i64> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1424 ; RV32-LABEL: vpreduce_smin_nxv1i64:
1426 ; RV32-NEXT: addi sp, sp, -16
1427 ; RV32-NEXT: .cfi_def_cfa_offset 16
1428 ; RV32-NEXT: sw a1, 12(sp)
1429 ; RV32-NEXT: sw a0, 8(sp)
1430 ; RV32-NEXT: addi a0, sp, 8
1431 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1432 ; RV32-NEXT: vlse64.v v9, (a0), zero
1433 ; RV32-NEXT: vsetvli zero, a2, e64, m1, ta, ma
1434 ; RV32-NEXT: vredmin.vs v9, v8, v9, v0.t
1435 ; RV32-NEXT: vmv.x.s a0, v9
1436 ; RV32-NEXT: li a1, 32
1437 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1438 ; RV32-NEXT: vsrl.vx v8, v9, a1
1439 ; RV32-NEXT: vmv.x.s a1, v8
1440 ; RV32-NEXT: addi sp, sp, 16
1443 ; RV64-LABEL: vpreduce_smin_nxv1i64:
1445 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1446 ; RV64-NEXT: vmv.s.x v9, a0
1447 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
1448 ; RV64-NEXT: vredmin.vs v9, v8, v9, v0.t
1449 ; RV64-NEXT: vmv.x.s a0, v9
1451 %r = call i64 @llvm.vp.reduce.smin.nxv1i64(i64 %s, <vscale x 1 x i64> %v, <vscale x 1 x i1> %m, i32 %evl)
1455 declare i64 @llvm.vp.reduce.and.nxv1i64(i64, <vscale x 1 x i64>, <vscale x 1 x i1>, i32)
1457 define signext i64 @vpreduce_and_nxv1i64(i64 signext %s, <vscale x 1 x i64> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1458 ; RV32-LABEL: vpreduce_and_nxv1i64:
1460 ; RV32-NEXT: addi sp, sp, -16
1461 ; RV32-NEXT: .cfi_def_cfa_offset 16
1462 ; RV32-NEXT: sw a1, 12(sp)
1463 ; RV32-NEXT: sw a0, 8(sp)
1464 ; RV32-NEXT: addi a0, sp, 8
1465 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1466 ; RV32-NEXT: vlse64.v v9, (a0), zero
1467 ; RV32-NEXT: vsetvli zero, a2, e64, m1, ta, ma
1468 ; RV32-NEXT: vredand.vs v9, v8, v9, v0.t
1469 ; RV32-NEXT: vmv.x.s a0, v9
1470 ; RV32-NEXT: li a1, 32
1471 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1472 ; RV32-NEXT: vsrl.vx v8, v9, a1
1473 ; RV32-NEXT: vmv.x.s a1, v8
1474 ; RV32-NEXT: addi sp, sp, 16
1477 ; RV64-LABEL: vpreduce_and_nxv1i64:
1479 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1480 ; RV64-NEXT: vmv.s.x v9, a0
1481 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
1482 ; RV64-NEXT: vredand.vs v9, v8, v9, v0.t
1483 ; RV64-NEXT: vmv.x.s a0, v9
1485 %r = call i64 @llvm.vp.reduce.and.nxv1i64(i64 %s, <vscale x 1 x i64> %v, <vscale x 1 x i1> %m, i32 %evl)
1489 declare i64 @llvm.vp.reduce.or.nxv1i64(i64, <vscale x 1 x i64>, <vscale x 1 x i1>, i32)
1491 define signext i64 @vpreduce_or_nxv1i64(i64 signext %s, <vscale x 1 x i64> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1492 ; RV32-LABEL: vpreduce_or_nxv1i64:
1494 ; RV32-NEXT: addi sp, sp, -16
1495 ; RV32-NEXT: .cfi_def_cfa_offset 16
1496 ; RV32-NEXT: sw a1, 12(sp)
1497 ; RV32-NEXT: sw a0, 8(sp)
1498 ; RV32-NEXT: addi a0, sp, 8
1499 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1500 ; RV32-NEXT: vlse64.v v9, (a0), zero
1501 ; RV32-NEXT: vsetvli zero, a2, e64, m1, ta, ma
1502 ; RV32-NEXT: vredor.vs v9, v8, v9, v0.t
1503 ; RV32-NEXT: vmv.x.s a0, v9
1504 ; RV32-NEXT: li a1, 32
1505 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1506 ; RV32-NEXT: vsrl.vx v8, v9, a1
1507 ; RV32-NEXT: vmv.x.s a1, v8
1508 ; RV32-NEXT: addi sp, sp, 16
1511 ; RV64-LABEL: vpreduce_or_nxv1i64:
1513 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1514 ; RV64-NEXT: vmv.s.x v9, a0
1515 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
1516 ; RV64-NEXT: vredor.vs v9, v8, v9, v0.t
1517 ; RV64-NEXT: vmv.x.s a0, v9
1519 %r = call i64 @llvm.vp.reduce.or.nxv1i64(i64 %s, <vscale x 1 x i64> %v, <vscale x 1 x i1> %m, i32 %evl)
1523 declare i64 @llvm.vp.reduce.xor.nxv1i64(i64, <vscale x 1 x i64>, <vscale x 1 x i1>, i32)
1525 define signext i64 @vpreduce_xor_nxv1i64(i64 signext %s, <vscale x 1 x i64> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1526 ; RV32-LABEL: vpreduce_xor_nxv1i64:
1528 ; RV32-NEXT: addi sp, sp, -16
1529 ; RV32-NEXT: .cfi_def_cfa_offset 16
1530 ; RV32-NEXT: sw a1, 12(sp)
1531 ; RV32-NEXT: sw a0, 8(sp)
1532 ; RV32-NEXT: addi a0, sp, 8
1533 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1534 ; RV32-NEXT: vlse64.v v9, (a0), zero
1535 ; RV32-NEXT: vsetvli zero, a2, e64, m1, ta, ma
1536 ; RV32-NEXT: vredxor.vs v9, v8, v9, v0.t
1537 ; RV32-NEXT: vmv.x.s a0, v9
1538 ; RV32-NEXT: li a1, 32
1539 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1540 ; RV32-NEXT: vsrl.vx v8, v9, a1
1541 ; RV32-NEXT: vmv.x.s a1, v8
1542 ; RV32-NEXT: addi sp, sp, 16
1545 ; RV64-LABEL: vpreduce_xor_nxv1i64:
1547 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1548 ; RV64-NEXT: vmv.s.x v9, a0
1549 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
1550 ; RV64-NEXT: vredxor.vs v9, v8, v9, v0.t
1551 ; RV64-NEXT: vmv.x.s a0, v9
1553 %r = call i64 @llvm.vp.reduce.xor.nxv1i64(i64 %s, <vscale x 1 x i64> %v, <vscale x 1 x i1> %m, i32 %evl)
1557 declare i64 @llvm.vp.reduce.add.nxv2i64(i64, <vscale x 2 x i64>, <vscale x 2 x i1>, i32)
1559 define signext i64 @vpreduce_add_nxv2i64(i64 signext %s, <vscale x 2 x i64> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1560 ; RV32-LABEL: vpreduce_add_nxv2i64:
1562 ; RV32-NEXT: addi sp, sp, -16
1563 ; RV32-NEXT: .cfi_def_cfa_offset 16
1564 ; RV32-NEXT: sw a1, 12(sp)
1565 ; RV32-NEXT: sw a0, 8(sp)
1566 ; RV32-NEXT: addi a0, sp, 8
1567 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1568 ; RV32-NEXT: vlse64.v v10, (a0), zero
1569 ; RV32-NEXT: vsetvli zero, a2, e64, m2, ta, ma
1570 ; RV32-NEXT: vredsum.vs v10, v8, v10, v0.t
1571 ; RV32-NEXT: vmv.x.s a0, v10
1572 ; RV32-NEXT: li a1, 32
1573 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1574 ; RV32-NEXT: vsrl.vx v8, v10, a1
1575 ; RV32-NEXT: vmv.x.s a1, v8
1576 ; RV32-NEXT: addi sp, sp, 16
1579 ; RV64-LABEL: vpreduce_add_nxv2i64:
1581 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1582 ; RV64-NEXT: vmv.s.x v10, a0
1583 ; RV64-NEXT: vsetvli zero, a1, e64, m2, ta, ma
1584 ; RV64-NEXT: vredsum.vs v10, v8, v10, v0.t
1585 ; RV64-NEXT: vmv.x.s a0, v10
1587 %r = call i64 @llvm.vp.reduce.add.nxv2i64(i64 %s, <vscale x 2 x i64> %v, <vscale x 2 x i1> %m, i32 %evl)
1591 define signext i64 @vwpreduce_add_nxv2i32(i64 signext %s, <vscale x 2 x i32> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1592 ; RV32-LABEL: vwpreduce_add_nxv2i32:
1594 ; RV32-NEXT: addi sp, sp, -16
1595 ; RV32-NEXT: .cfi_def_cfa_offset 16
1596 ; RV32-NEXT: sw a1, 12(sp)
1597 ; RV32-NEXT: sw a0, 8(sp)
1598 ; RV32-NEXT: addi a0, sp, 8
1599 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1600 ; RV32-NEXT: vlse64.v v9, (a0), zero
1601 ; RV32-NEXT: vsetvli zero, a2, e32, m1, ta, ma
1602 ; RV32-NEXT: vwredsum.vs v9, v8, v9, v0.t
1603 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1604 ; RV32-NEXT: vmv.x.s a0, v9
1605 ; RV32-NEXT: li a1, 32
1606 ; RV32-NEXT: vsrl.vx v8, v9, a1
1607 ; RV32-NEXT: vmv.x.s a1, v8
1608 ; RV32-NEXT: addi sp, sp, 16
1611 ; RV64-LABEL: vwpreduce_add_nxv2i32:
1613 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1614 ; RV64-NEXT: vmv.s.x v9, a0
1615 ; RV64-NEXT: vsetvli zero, a1, e32, m1, ta, ma
1616 ; RV64-NEXT: vwredsum.vs v9, v8, v9, v0.t
1617 ; RV64-NEXT: vsetvli zero, zero, e64, m2, ta, ma
1618 ; RV64-NEXT: vmv.x.s a0, v9
1620 %e = sext <vscale x 2 x i32> %v to <vscale x 2 x i64>
1621 %r = call i64 @llvm.vp.reduce.add.nxv2i64(i64 %s, <vscale x 2 x i64> %e, <vscale x 2 x i1> %m, i32 %evl)
1625 define signext i64 @vwpreduce_uadd_nxv2i32(i64 signext %s, <vscale x 2 x i32> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1626 ; RV32-LABEL: vwpreduce_uadd_nxv2i32:
1628 ; RV32-NEXT: addi sp, sp, -16
1629 ; RV32-NEXT: .cfi_def_cfa_offset 16
1630 ; RV32-NEXT: sw a1, 12(sp)
1631 ; RV32-NEXT: sw a0, 8(sp)
1632 ; RV32-NEXT: addi a0, sp, 8
1633 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1634 ; RV32-NEXT: vlse64.v v9, (a0), zero
1635 ; RV32-NEXT: vsetvli zero, a2, e32, m1, ta, ma
1636 ; RV32-NEXT: vwredsum.vs v9, v8, v9, v0.t
1637 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1638 ; RV32-NEXT: vmv.x.s a0, v9
1639 ; RV32-NEXT: li a1, 32
1640 ; RV32-NEXT: vsrl.vx v8, v9, a1
1641 ; RV32-NEXT: vmv.x.s a1, v8
1642 ; RV32-NEXT: addi sp, sp, 16
1645 ; RV64-LABEL: vwpreduce_uadd_nxv2i32:
1647 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1648 ; RV64-NEXT: vmv.s.x v9, a0
1649 ; RV64-NEXT: vsetvli zero, a1, e32, m1, ta, ma
1650 ; RV64-NEXT: vwredsum.vs v9, v8, v9, v0.t
1651 ; RV64-NEXT: vsetvli zero, zero, e64, m2, ta, ma
1652 ; RV64-NEXT: vmv.x.s a0, v9
1654 %e = sext <vscale x 2 x i32> %v to <vscale x 2 x i64>
1655 %r = call i64 @llvm.vp.reduce.add.nxv2i64(i64 %s, <vscale x 2 x i64> %e, <vscale x 2 x i1> %m, i32 %evl)
1659 declare i64 @llvm.vp.reduce.umax.nxv2i64(i64, <vscale x 2 x i64>, <vscale x 2 x i1>, i32)
1661 define signext i64 @vpreduce_umax_nxv2i64(i64 signext %s, <vscale x 2 x i64> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1662 ; RV32-LABEL: vpreduce_umax_nxv2i64:
1664 ; RV32-NEXT: addi sp, sp, -16
1665 ; RV32-NEXT: .cfi_def_cfa_offset 16
1666 ; RV32-NEXT: sw a1, 12(sp)
1667 ; RV32-NEXT: sw a0, 8(sp)
1668 ; RV32-NEXT: addi a0, sp, 8
1669 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1670 ; RV32-NEXT: vlse64.v v10, (a0), zero
1671 ; RV32-NEXT: vsetvli zero, a2, e64, m2, ta, ma
1672 ; RV32-NEXT: vredmaxu.vs v10, v8, v10, v0.t
1673 ; RV32-NEXT: vmv.x.s a0, v10
1674 ; RV32-NEXT: li a1, 32
1675 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1676 ; RV32-NEXT: vsrl.vx v8, v10, a1
1677 ; RV32-NEXT: vmv.x.s a1, v8
1678 ; RV32-NEXT: addi sp, sp, 16
1681 ; RV64-LABEL: vpreduce_umax_nxv2i64:
1683 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1684 ; RV64-NEXT: vmv.s.x v10, a0
1685 ; RV64-NEXT: vsetvli zero, a1, e64, m2, ta, ma
1686 ; RV64-NEXT: vredmaxu.vs v10, v8, v10, v0.t
1687 ; RV64-NEXT: vmv.x.s a0, v10
1689 %r = call i64 @llvm.vp.reduce.umax.nxv2i64(i64 %s, <vscale x 2 x i64> %v, <vscale x 2 x i1> %m, i32 %evl)
1693 declare i64 @llvm.vp.reduce.smax.nxv2i64(i64, <vscale x 2 x i64>, <vscale x 2 x i1>, i32)
1695 define signext i64 @vpreduce_smax_nxv2i64(i64 signext %s, <vscale x 2 x i64> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1696 ; RV32-LABEL: vpreduce_smax_nxv2i64:
1698 ; RV32-NEXT: addi sp, sp, -16
1699 ; RV32-NEXT: .cfi_def_cfa_offset 16
1700 ; RV32-NEXT: sw a1, 12(sp)
1701 ; RV32-NEXT: sw a0, 8(sp)
1702 ; RV32-NEXT: addi a0, sp, 8
1703 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1704 ; RV32-NEXT: vlse64.v v10, (a0), zero
1705 ; RV32-NEXT: vsetvli zero, a2, e64, m2, ta, ma
1706 ; RV32-NEXT: vredmax.vs v10, v8, v10, v0.t
1707 ; RV32-NEXT: vmv.x.s a0, v10
1708 ; RV32-NEXT: li a1, 32
1709 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1710 ; RV32-NEXT: vsrl.vx v8, v10, a1
1711 ; RV32-NEXT: vmv.x.s a1, v8
1712 ; RV32-NEXT: addi sp, sp, 16
1715 ; RV64-LABEL: vpreduce_smax_nxv2i64:
1717 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1718 ; RV64-NEXT: vmv.s.x v10, a0
1719 ; RV64-NEXT: vsetvli zero, a1, e64, m2, ta, ma
1720 ; RV64-NEXT: vredmax.vs v10, v8, v10, v0.t
1721 ; RV64-NEXT: vmv.x.s a0, v10
1723 %r = call i64 @llvm.vp.reduce.smax.nxv2i64(i64 %s, <vscale x 2 x i64> %v, <vscale x 2 x i1> %m, i32 %evl)
1727 declare i64 @llvm.vp.reduce.umin.nxv2i64(i64, <vscale x 2 x i64>, <vscale x 2 x i1>, i32)
1729 define signext i64 @vpreduce_umin_nxv2i64(i64 signext %s, <vscale x 2 x i64> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1730 ; RV32-LABEL: vpreduce_umin_nxv2i64:
1732 ; RV32-NEXT: addi sp, sp, -16
1733 ; RV32-NEXT: .cfi_def_cfa_offset 16
1734 ; RV32-NEXT: sw a1, 12(sp)
1735 ; RV32-NEXT: sw a0, 8(sp)
1736 ; RV32-NEXT: addi a0, sp, 8
1737 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1738 ; RV32-NEXT: vlse64.v v10, (a0), zero
1739 ; RV32-NEXT: vsetvli zero, a2, e64, m2, ta, ma
1740 ; RV32-NEXT: vredminu.vs v10, v8, v10, v0.t
1741 ; RV32-NEXT: vmv.x.s a0, v10
1742 ; RV32-NEXT: li a1, 32
1743 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1744 ; RV32-NEXT: vsrl.vx v8, v10, a1
1745 ; RV32-NEXT: vmv.x.s a1, v8
1746 ; RV32-NEXT: addi sp, sp, 16
1749 ; RV64-LABEL: vpreduce_umin_nxv2i64:
1751 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1752 ; RV64-NEXT: vmv.s.x v10, a0
1753 ; RV64-NEXT: vsetvli zero, a1, e64, m2, ta, ma
1754 ; RV64-NEXT: vredminu.vs v10, v8, v10, v0.t
1755 ; RV64-NEXT: vmv.x.s a0, v10
1757 %r = call i64 @llvm.vp.reduce.umin.nxv2i64(i64 %s, <vscale x 2 x i64> %v, <vscale x 2 x i1> %m, i32 %evl)
1761 declare i64 @llvm.vp.reduce.smin.nxv2i64(i64, <vscale x 2 x i64>, <vscale x 2 x i1>, i32)
1763 define signext i64 @vpreduce_smin_nxv2i64(i64 signext %s, <vscale x 2 x i64> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1764 ; RV32-LABEL: vpreduce_smin_nxv2i64:
1766 ; RV32-NEXT: addi sp, sp, -16
1767 ; RV32-NEXT: .cfi_def_cfa_offset 16
1768 ; RV32-NEXT: sw a1, 12(sp)
1769 ; RV32-NEXT: sw a0, 8(sp)
1770 ; RV32-NEXT: addi a0, sp, 8
1771 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1772 ; RV32-NEXT: vlse64.v v10, (a0), zero
1773 ; RV32-NEXT: vsetvli zero, a2, e64, m2, ta, ma
1774 ; RV32-NEXT: vredmin.vs v10, v8, v10, v0.t
1775 ; RV32-NEXT: vmv.x.s a0, v10
1776 ; RV32-NEXT: li a1, 32
1777 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1778 ; RV32-NEXT: vsrl.vx v8, v10, a1
1779 ; RV32-NEXT: vmv.x.s a1, v8
1780 ; RV32-NEXT: addi sp, sp, 16
1783 ; RV64-LABEL: vpreduce_smin_nxv2i64:
1785 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1786 ; RV64-NEXT: vmv.s.x v10, a0
1787 ; RV64-NEXT: vsetvli zero, a1, e64, m2, ta, ma
1788 ; RV64-NEXT: vredmin.vs v10, v8, v10, v0.t
1789 ; RV64-NEXT: vmv.x.s a0, v10
1791 %r = call i64 @llvm.vp.reduce.smin.nxv2i64(i64 %s, <vscale x 2 x i64> %v, <vscale x 2 x i1> %m, i32 %evl)
1795 declare i64 @llvm.vp.reduce.and.nxv2i64(i64, <vscale x 2 x i64>, <vscale x 2 x i1>, i32)
1797 define signext i64 @vpreduce_and_nxv2i64(i64 signext %s, <vscale x 2 x i64> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1798 ; RV32-LABEL: vpreduce_and_nxv2i64:
1800 ; RV32-NEXT: addi sp, sp, -16
1801 ; RV32-NEXT: .cfi_def_cfa_offset 16
1802 ; RV32-NEXT: sw a1, 12(sp)
1803 ; RV32-NEXT: sw a0, 8(sp)
1804 ; RV32-NEXT: addi a0, sp, 8
1805 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1806 ; RV32-NEXT: vlse64.v v10, (a0), zero
1807 ; RV32-NEXT: vsetvli zero, a2, e64, m2, ta, ma
1808 ; RV32-NEXT: vredand.vs v10, v8, v10, v0.t
1809 ; RV32-NEXT: vmv.x.s a0, v10
1810 ; RV32-NEXT: li a1, 32
1811 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1812 ; RV32-NEXT: vsrl.vx v8, v10, a1
1813 ; RV32-NEXT: vmv.x.s a1, v8
1814 ; RV32-NEXT: addi sp, sp, 16
1817 ; RV64-LABEL: vpreduce_and_nxv2i64:
1819 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1820 ; RV64-NEXT: vmv.s.x v10, a0
1821 ; RV64-NEXT: vsetvli zero, a1, e64, m2, ta, ma
1822 ; RV64-NEXT: vredand.vs v10, v8, v10, v0.t
1823 ; RV64-NEXT: vmv.x.s a0, v10
1825 %r = call i64 @llvm.vp.reduce.and.nxv2i64(i64 %s, <vscale x 2 x i64> %v, <vscale x 2 x i1> %m, i32 %evl)
1829 declare i64 @llvm.vp.reduce.or.nxv2i64(i64, <vscale x 2 x i64>, <vscale x 2 x i1>, i32)
1831 define signext i64 @vpreduce_or_nxv2i64(i64 signext %s, <vscale x 2 x i64> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1832 ; RV32-LABEL: vpreduce_or_nxv2i64:
1834 ; RV32-NEXT: addi sp, sp, -16
1835 ; RV32-NEXT: .cfi_def_cfa_offset 16
1836 ; RV32-NEXT: sw a1, 12(sp)
1837 ; RV32-NEXT: sw a0, 8(sp)
1838 ; RV32-NEXT: addi a0, sp, 8
1839 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1840 ; RV32-NEXT: vlse64.v v10, (a0), zero
1841 ; RV32-NEXT: vsetvli zero, a2, e64, m2, ta, ma
1842 ; RV32-NEXT: vredor.vs v10, v8, v10, v0.t
1843 ; RV32-NEXT: vmv.x.s a0, v10
1844 ; RV32-NEXT: li a1, 32
1845 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1846 ; RV32-NEXT: vsrl.vx v8, v10, a1
1847 ; RV32-NEXT: vmv.x.s a1, v8
1848 ; RV32-NEXT: addi sp, sp, 16
1851 ; RV64-LABEL: vpreduce_or_nxv2i64:
1853 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1854 ; RV64-NEXT: vmv.s.x v10, a0
1855 ; RV64-NEXT: vsetvli zero, a1, e64, m2, ta, ma
1856 ; RV64-NEXT: vredor.vs v10, v8, v10, v0.t
1857 ; RV64-NEXT: vmv.x.s a0, v10
1859 %r = call i64 @llvm.vp.reduce.or.nxv2i64(i64 %s, <vscale x 2 x i64> %v, <vscale x 2 x i1> %m, i32 %evl)
1863 declare i64 @llvm.vp.reduce.xor.nxv2i64(i64, <vscale x 2 x i64>, <vscale x 2 x i1>, i32)
1865 define signext i64 @vpreduce_xor_nxv2i64(i64 signext %s, <vscale x 2 x i64> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1866 ; RV32-LABEL: vpreduce_xor_nxv2i64:
1868 ; RV32-NEXT: addi sp, sp, -16
1869 ; RV32-NEXT: .cfi_def_cfa_offset 16
1870 ; RV32-NEXT: sw a1, 12(sp)
1871 ; RV32-NEXT: sw a0, 8(sp)
1872 ; RV32-NEXT: addi a0, sp, 8
1873 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1874 ; RV32-NEXT: vlse64.v v10, (a0), zero
1875 ; RV32-NEXT: vsetvli zero, a2, e64, m2, ta, ma
1876 ; RV32-NEXT: vredxor.vs v10, v8, v10, v0.t
1877 ; RV32-NEXT: vmv.x.s a0, v10
1878 ; RV32-NEXT: li a1, 32
1879 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1880 ; RV32-NEXT: vsrl.vx v8, v10, a1
1881 ; RV32-NEXT: vmv.x.s a1, v8
1882 ; RV32-NEXT: addi sp, sp, 16
1885 ; RV64-LABEL: vpreduce_xor_nxv2i64:
1887 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1888 ; RV64-NEXT: vmv.s.x v10, a0
1889 ; RV64-NEXT: vsetvli zero, a1, e64, m2, ta, ma
1890 ; RV64-NEXT: vredxor.vs v10, v8, v10, v0.t
1891 ; RV64-NEXT: vmv.x.s a0, v10
1893 %r = call i64 @llvm.vp.reduce.xor.nxv2i64(i64 %s, <vscale x 2 x i64> %v, <vscale x 2 x i1> %m, i32 %evl)
1897 declare i64 @llvm.vp.reduce.add.nxv4i64(i64, <vscale x 4 x i64>, <vscale x 4 x i1>, i32)
1899 define signext i64 @vpreduce_add_nxv4i64(i64 signext %s, <vscale x 4 x i64> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1900 ; RV32-LABEL: vpreduce_add_nxv4i64:
1902 ; RV32-NEXT: addi sp, sp, -16
1903 ; RV32-NEXT: .cfi_def_cfa_offset 16
1904 ; RV32-NEXT: sw a1, 12(sp)
1905 ; RV32-NEXT: sw a0, 8(sp)
1906 ; RV32-NEXT: addi a0, sp, 8
1907 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1908 ; RV32-NEXT: vlse64.v v12, (a0), zero
1909 ; RV32-NEXT: vsetvli zero, a2, e64, m4, ta, ma
1910 ; RV32-NEXT: vredsum.vs v12, v8, v12, v0.t
1911 ; RV32-NEXT: vmv.x.s a0, v12
1912 ; RV32-NEXT: li a1, 32
1913 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1914 ; RV32-NEXT: vsrl.vx v8, v12, a1
1915 ; RV32-NEXT: vmv.x.s a1, v8
1916 ; RV32-NEXT: addi sp, sp, 16
1919 ; RV64-LABEL: vpreduce_add_nxv4i64:
1921 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1922 ; RV64-NEXT: vmv.s.x v12, a0
1923 ; RV64-NEXT: vsetvli zero, a1, e64, m4, ta, ma
1924 ; RV64-NEXT: vredsum.vs v12, v8, v12, v0.t
1925 ; RV64-NEXT: vmv.x.s a0, v12
1927 %r = call i64 @llvm.vp.reduce.add.nxv4i64(i64 %s, <vscale x 4 x i64> %v, <vscale x 4 x i1> %m, i32 %evl)
1931 define signext i64 @vpwreduce_add_nxv4i32(i64 signext %s, <vscale x 4 x i32> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1932 ; RV32-LABEL: vpwreduce_add_nxv4i32:
1934 ; RV32-NEXT: addi sp, sp, -16
1935 ; RV32-NEXT: .cfi_def_cfa_offset 16
1936 ; RV32-NEXT: sw a1, 12(sp)
1937 ; RV32-NEXT: sw a0, 8(sp)
1938 ; RV32-NEXT: addi a0, sp, 8
1939 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1940 ; RV32-NEXT: vlse64.v v10, (a0), zero
1941 ; RV32-NEXT: vsetvli zero, a2, e32, m2, ta, ma
1942 ; RV32-NEXT: vwredsum.vs v10, v8, v10, v0.t
1943 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1944 ; RV32-NEXT: vmv.x.s a0, v10
1945 ; RV32-NEXT: li a1, 32
1946 ; RV32-NEXT: vsrl.vx v8, v10, a1
1947 ; RV32-NEXT: vmv.x.s a1, v8
1948 ; RV32-NEXT: addi sp, sp, 16
1951 ; RV64-LABEL: vpwreduce_add_nxv4i32:
1953 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1954 ; RV64-NEXT: vmv.s.x v10, a0
1955 ; RV64-NEXT: vsetvli zero, a1, e32, m2, ta, ma
1956 ; RV64-NEXT: vwredsum.vs v10, v8, v10, v0.t
1957 ; RV64-NEXT: vsetvli zero, zero, e64, m4, ta, ma
1958 ; RV64-NEXT: vmv.x.s a0, v10
1960 %e = sext <vscale x 4 x i32> %v to <vscale x 4 x i64>
1961 %r = call i64 @llvm.vp.reduce.add.nxv4i64(i64 %s, <vscale x 4 x i64> %e, <vscale x 4 x i1> %m, i32 %evl)
1965 define signext i64 @vpwreduce_uadd_nxv4i32(i64 signext %s, <vscale x 4 x i32> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1966 ; RV32-LABEL: vpwreduce_uadd_nxv4i32:
1968 ; RV32-NEXT: addi sp, sp, -16
1969 ; RV32-NEXT: .cfi_def_cfa_offset 16
1970 ; RV32-NEXT: sw a1, 12(sp)
1971 ; RV32-NEXT: sw a0, 8(sp)
1972 ; RV32-NEXT: addi a0, sp, 8
1973 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1974 ; RV32-NEXT: vlse64.v v10, (a0), zero
1975 ; RV32-NEXT: vsetvli zero, a2, e32, m2, ta, ma
1976 ; RV32-NEXT: vwredsumu.vs v10, v8, v10, v0.t
1977 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1978 ; RV32-NEXT: vmv.x.s a0, v10
1979 ; RV32-NEXT: li a1, 32
1980 ; RV32-NEXT: vsrl.vx v8, v10, a1
1981 ; RV32-NEXT: vmv.x.s a1, v8
1982 ; RV32-NEXT: addi sp, sp, 16
1985 ; RV64-LABEL: vpwreduce_uadd_nxv4i32:
1987 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1988 ; RV64-NEXT: vmv.s.x v10, a0
1989 ; RV64-NEXT: vsetvli zero, a1, e32, m2, ta, ma
1990 ; RV64-NEXT: vwredsumu.vs v10, v8, v10, v0.t
1991 ; RV64-NEXT: vsetvli zero, zero, e64, m4, ta, ma
1992 ; RV64-NEXT: vmv.x.s a0, v10
1994 %e = zext <vscale x 4 x i32> %v to <vscale x 4 x i64>
1995 %r = call i64 @llvm.vp.reduce.add.nxv4i64(i64 %s, <vscale x 4 x i64> %e, <vscale x 4 x i1> %m, i32 %evl)
1999 declare i64 @llvm.vp.reduce.umax.nxv4i64(i64, <vscale x 4 x i64>, <vscale x 4 x i1>, i32)
2001 define signext i64 @vpreduce_umax_nxv4i64(i64 signext %s, <vscale x 4 x i64> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
2002 ; RV32-LABEL: vpreduce_umax_nxv4i64:
2004 ; RV32-NEXT: addi sp, sp, -16
2005 ; RV32-NEXT: .cfi_def_cfa_offset 16
2006 ; RV32-NEXT: sw a1, 12(sp)
2007 ; RV32-NEXT: sw a0, 8(sp)
2008 ; RV32-NEXT: addi a0, sp, 8
2009 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2010 ; RV32-NEXT: vlse64.v v12, (a0), zero
2011 ; RV32-NEXT: vsetvli zero, a2, e64, m4, ta, ma
2012 ; RV32-NEXT: vredmaxu.vs v12, v8, v12, v0.t
2013 ; RV32-NEXT: vmv.x.s a0, v12
2014 ; RV32-NEXT: li a1, 32
2015 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2016 ; RV32-NEXT: vsrl.vx v8, v12, a1
2017 ; RV32-NEXT: vmv.x.s a1, v8
2018 ; RV32-NEXT: addi sp, sp, 16
2021 ; RV64-LABEL: vpreduce_umax_nxv4i64:
2023 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2024 ; RV64-NEXT: vmv.s.x v12, a0
2025 ; RV64-NEXT: vsetvli zero, a1, e64, m4, ta, ma
2026 ; RV64-NEXT: vredmaxu.vs v12, v8, v12, v0.t
2027 ; RV64-NEXT: vmv.x.s a0, v12
2029 %r = call i64 @llvm.vp.reduce.umax.nxv4i64(i64 %s, <vscale x 4 x i64> %v, <vscale x 4 x i1> %m, i32 %evl)
2033 declare i64 @llvm.vp.reduce.smax.nxv4i64(i64, <vscale x 4 x i64>, <vscale x 4 x i1>, i32)
2035 define signext i64 @vpreduce_smax_nxv4i64(i64 signext %s, <vscale x 4 x i64> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
2036 ; RV32-LABEL: vpreduce_smax_nxv4i64:
2038 ; RV32-NEXT: addi sp, sp, -16
2039 ; RV32-NEXT: .cfi_def_cfa_offset 16
2040 ; RV32-NEXT: sw a1, 12(sp)
2041 ; RV32-NEXT: sw a0, 8(sp)
2042 ; RV32-NEXT: addi a0, sp, 8
2043 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2044 ; RV32-NEXT: vlse64.v v12, (a0), zero
2045 ; RV32-NEXT: vsetvli zero, a2, e64, m4, ta, ma
2046 ; RV32-NEXT: vredmax.vs v12, v8, v12, v0.t
2047 ; RV32-NEXT: vmv.x.s a0, v12
2048 ; RV32-NEXT: li a1, 32
2049 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2050 ; RV32-NEXT: vsrl.vx v8, v12, a1
2051 ; RV32-NEXT: vmv.x.s a1, v8
2052 ; RV32-NEXT: addi sp, sp, 16
2055 ; RV64-LABEL: vpreduce_smax_nxv4i64:
2057 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2058 ; RV64-NEXT: vmv.s.x v12, a0
2059 ; RV64-NEXT: vsetvli zero, a1, e64, m4, ta, ma
2060 ; RV64-NEXT: vredmax.vs v12, v8, v12, v0.t
2061 ; RV64-NEXT: vmv.x.s a0, v12
2063 %r = call i64 @llvm.vp.reduce.smax.nxv4i64(i64 %s, <vscale x 4 x i64> %v, <vscale x 4 x i1> %m, i32 %evl)
2067 declare i64 @llvm.vp.reduce.umin.nxv4i64(i64, <vscale x 4 x i64>, <vscale x 4 x i1>, i32)
2069 define signext i64 @vpreduce_umin_nxv4i64(i64 signext %s, <vscale x 4 x i64> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
2070 ; RV32-LABEL: vpreduce_umin_nxv4i64:
2072 ; RV32-NEXT: addi sp, sp, -16
2073 ; RV32-NEXT: .cfi_def_cfa_offset 16
2074 ; RV32-NEXT: sw a1, 12(sp)
2075 ; RV32-NEXT: sw a0, 8(sp)
2076 ; RV32-NEXT: addi a0, sp, 8
2077 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2078 ; RV32-NEXT: vlse64.v v12, (a0), zero
2079 ; RV32-NEXT: vsetvli zero, a2, e64, m4, ta, ma
2080 ; RV32-NEXT: vredminu.vs v12, v8, v12, v0.t
2081 ; RV32-NEXT: vmv.x.s a0, v12
2082 ; RV32-NEXT: li a1, 32
2083 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2084 ; RV32-NEXT: vsrl.vx v8, v12, a1
2085 ; RV32-NEXT: vmv.x.s a1, v8
2086 ; RV32-NEXT: addi sp, sp, 16
2089 ; RV64-LABEL: vpreduce_umin_nxv4i64:
2091 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2092 ; RV64-NEXT: vmv.s.x v12, a0
2093 ; RV64-NEXT: vsetvli zero, a1, e64, m4, ta, ma
2094 ; RV64-NEXT: vredminu.vs v12, v8, v12, v0.t
2095 ; RV64-NEXT: vmv.x.s a0, v12
2097 %r = call i64 @llvm.vp.reduce.umin.nxv4i64(i64 %s, <vscale x 4 x i64> %v, <vscale x 4 x i1> %m, i32 %evl)
2101 declare i64 @llvm.vp.reduce.smin.nxv4i64(i64, <vscale x 4 x i64>, <vscale x 4 x i1>, i32)
2103 define signext i64 @vpreduce_smin_nxv4i64(i64 signext %s, <vscale x 4 x i64> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
2104 ; RV32-LABEL: vpreduce_smin_nxv4i64:
2106 ; RV32-NEXT: addi sp, sp, -16
2107 ; RV32-NEXT: .cfi_def_cfa_offset 16
2108 ; RV32-NEXT: sw a1, 12(sp)
2109 ; RV32-NEXT: sw a0, 8(sp)
2110 ; RV32-NEXT: addi a0, sp, 8
2111 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2112 ; RV32-NEXT: vlse64.v v12, (a0), zero
2113 ; RV32-NEXT: vsetvli zero, a2, e64, m4, ta, ma
2114 ; RV32-NEXT: vredmin.vs v12, v8, v12, v0.t
2115 ; RV32-NEXT: vmv.x.s a0, v12
2116 ; RV32-NEXT: li a1, 32
2117 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2118 ; RV32-NEXT: vsrl.vx v8, v12, a1
2119 ; RV32-NEXT: vmv.x.s a1, v8
2120 ; RV32-NEXT: addi sp, sp, 16
2123 ; RV64-LABEL: vpreduce_smin_nxv4i64:
2125 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2126 ; RV64-NEXT: vmv.s.x v12, a0
2127 ; RV64-NEXT: vsetvli zero, a1, e64, m4, ta, ma
2128 ; RV64-NEXT: vredmin.vs v12, v8, v12, v0.t
2129 ; RV64-NEXT: vmv.x.s a0, v12
2131 %r = call i64 @llvm.vp.reduce.smin.nxv4i64(i64 %s, <vscale x 4 x i64> %v, <vscale x 4 x i1> %m, i32 %evl)
2135 declare i64 @llvm.vp.reduce.and.nxv4i64(i64, <vscale x 4 x i64>, <vscale x 4 x i1>, i32)
2137 define signext i64 @vpreduce_and_nxv4i64(i64 signext %s, <vscale x 4 x i64> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
2138 ; RV32-LABEL: vpreduce_and_nxv4i64:
2140 ; RV32-NEXT: addi sp, sp, -16
2141 ; RV32-NEXT: .cfi_def_cfa_offset 16
2142 ; RV32-NEXT: sw a1, 12(sp)
2143 ; RV32-NEXT: sw a0, 8(sp)
2144 ; RV32-NEXT: addi a0, sp, 8
2145 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2146 ; RV32-NEXT: vlse64.v v12, (a0), zero
2147 ; RV32-NEXT: vsetvli zero, a2, e64, m4, ta, ma
2148 ; RV32-NEXT: vredand.vs v12, v8, v12, v0.t
2149 ; RV32-NEXT: vmv.x.s a0, v12
2150 ; RV32-NEXT: li a1, 32
2151 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2152 ; RV32-NEXT: vsrl.vx v8, v12, a1
2153 ; RV32-NEXT: vmv.x.s a1, v8
2154 ; RV32-NEXT: addi sp, sp, 16
2157 ; RV64-LABEL: vpreduce_and_nxv4i64:
2159 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2160 ; RV64-NEXT: vmv.s.x v12, a0
2161 ; RV64-NEXT: vsetvli zero, a1, e64, m4, ta, ma
2162 ; RV64-NEXT: vredand.vs v12, v8, v12, v0.t
2163 ; RV64-NEXT: vmv.x.s a0, v12
2165 %r = call i64 @llvm.vp.reduce.and.nxv4i64(i64 %s, <vscale x 4 x i64> %v, <vscale x 4 x i1> %m, i32 %evl)
2169 declare i64 @llvm.vp.reduce.or.nxv4i64(i64, <vscale x 4 x i64>, <vscale x 4 x i1>, i32)
2171 define signext i64 @vpreduce_or_nxv4i64(i64 signext %s, <vscale x 4 x i64> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
2172 ; RV32-LABEL: vpreduce_or_nxv4i64:
2174 ; RV32-NEXT: addi sp, sp, -16
2175 ; RV32-NEXT: .cfi_def_cfa_offset 16
2176 ; RV32-NEXT: sw a1, 12(sp)
2177 ; RV32-NEXT: sw a0, 8(sp)
2178 ; RV32-NEXT: addi a0, sp, 8
2179 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2180 ; RV32-NEXT: vlse64.v v12, (a0), zero
2181 ; RV32-NEXT: vsetvli zero, a2, e64, m4, ta, ma
2182 ; RV32-NEXT: vredor.vs v12, v8, v12, v0.t
2183 ; RV32-NEXT: vmv.x.s a0, v12
2184 ; RV32-NEXT: li a1, 32
2185 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2186 ; RV32-NEXT: vsrl.vx v8, v12, a1
2187 ; RV32-NEXT: vmv.x.s a1, v8
2188 ; RV32-NEXT: addi sp, sp, 16
2191 ; RV64-LABEL: vpreduce_or_nxv4i64:
2193 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2194 ; RV64-NEXT: vmv.s.x v12, a0
2195 ; RV64-NEXT: vsetvli zero, a1, e64, m4, ta, ma
2196 ; RV64-NEXT: vredor.vs v12, v8, v12, v0.t
2197 ; RV64-NEXT: vmv.x.s a0, v12
2199 %r = call i64 @llvm.vp.reduce.or.nxv4i64(i64 %s, <vscale x 4 x i64> %v, <vscale x 4 x i1> %m, i32 %evl)
2203 declare i64 @llvm.vp.reduce.xor.nxv4i64(i64, <vscale x 4 x i64>, <vscale x 4 x i1>, i32)
2205 define signext i64 @vpreduce_xor_nxv4i64(i64 signext %s, <vscale x 4 x i64> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
2206 ; RV32-LABEL: vpreduce_xor_nxv4i64:
2208 ; RV32-NEXT: addi sp, sp, -16
2209 ; RV32-NEXT: .cfi_def_cfa_offset 16
2210 ; RV32-NEXT: sw a1, 12(sp)
2211 ; RV32-NEXT: sw a0, 8(sp)
2212 ; RV32-NEXT: addi a0, sp, 8
2213 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2214 ; RV32-NEXT: vlse64.v v12, (a0), zero
2215 ; RV32-NEXT: vsetvli zero, a2, e64, m4, ta, ma
2216 ; RV32-NEXT: vredxor.vs v12, v8, v12, v0.t
2217 ; RV32-NEXT: vmv.x.s a0, v12
2218 ; RV32-NEXT: li a1, 32
2219 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2220 ; RV32-NEXT: vsrl.vx v8, v12, a1
2221 ; RV32-NEXT: vmv.x.s a1, v8
2222 ; RV32-NEXT: addi sp, sp, 16
2225 ; RV64-LABEL: vpreduce_xor_nxv4i64:
2227 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2228 ; RV64-NEXT: vmv.s.x v12, a0
2229 ; RV64-NEXT: vsetvli zero, a1, e64, m4, ta, ma
2230 ; RV64-NEXT: vredxor.vs v12, v8, v12, v0.t
2231 ; RV64-NEXT: vmv.x.s a0, v12
2233 %r = call i64 @llvm.vp.reduce.xor.nxv4i64(i64 %s, <vscale x 4 x i64> %v, <vscale x 4 x i1> %m, i32 %evl)