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 <8 x i7> @llvm.vp.add.v8i7(<8 x i7>, <8 x i7>, <8 x i1>, i32)
9 define <8 x i7> @vadd_vv_v8i7(<8 x i7> %va, <8 x i7> %b, <8 x i1> %m, i32 zeroext %evl) {
10 ; CHECK-LABEL: vadd_vv_v8i7:
12 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
13 ; CHECK-NEXT: vadd.vv v8, v8, v9, v0.t
15 %v = call <8 x i7> @llvm.vp.add.v8i7(<8 x i7> %va, <8 x i7> %b, <8 x i1> %m, i32 %evl)
19 declare <2 x i8> @llvm.vp.add.v2i8(<2 x i8>, <2 x i8>, <2 x i1>, i32)
21 define <2 x i8> @vadd_vv_v2i8(<2 x i8> %va, <2 x i8> %b, <2 x i1> %m, i32 zeroext %evl) {
22 ; CHECK-LABEL: vadd_vv_v2i8:
24 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
25 ; CHECK-NEXT: vadd.vv v8, v8, v9, v0.t
27 %v = call <2 x i8> @llvm.vp.add.v2i8(<2 x i8> %va, <2 x i8> %b, <2 x i1> %m, i32 %evl)
31 define <2 x i8> @vadd_vv_v2i8_unmasked(<2 x i8> %va, <2 x i8> %b, i32 zeroext %evl) {
32 ; CHECK-LABEL: vadd_vv_v2i8_unmasked:
34 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
35 ; CHECK-NEXT: vadd.vv v8, v8, v9
37 %head = insertelement <2 x i1> poison, i1 true, i32 0
38 %m = shufflevector <2 x i1> %head, <2 x i1> poison, <2 x i32> zeroinitializer
39 %v = call <2 x i8> @llvm.vp.add.v2i8(<2 x i8> %va, <2 x i8> %b, <2 x i1> %m, i32 %evl)
43 define <2 x i8> @vadd_vx_v2i8(<2 x i8> %va, i8 %b, <2 x i1> %m, i32 zeroext %evl) {
44 ; CHECK-LABEL: vadd_vx_v2i8:
46 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
47 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
49 %elt.head = insertelement <2 x i8> poison, i8 %b, i32 0
50 %vb = shufflevector <2 x i8> %elt.head, <2 x i8> poison, <2 x i32> zeroinitializer
51 %v = call <2 x i8> @llvm.vp.add.v2i8(<2 x i8> %va, <2 x i8> %vb, <2 x i1> %m, i32 %evl)
55 define <2 x i8> @vadd_vx_v2i8_unmasked(<2 x i8> %va, i8 %b, i32 zeroext %evl) {
56 ; CHECK-LABEL: vadd_vx_v2i8_unmasked:
58 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
59 ; CHECK-NEXT: vadd.vx v8, v8, a0
61 %elt.head = insertelement <2 x i8> poison, i8 %b, i32 0
62 %vb = shufflevector <2 x i8> %elt.head, <2 x i8> poison, <2 x i32> zeroinitializer
63 %head = insertelement <2 x i1> poison, i1 true, i32 0
64 %m = shufflevector <2 x i1> %head, <2 x i1> poison, <2 x i32> zeroinitializer
65 %v = call <2 x i8> @llvm.vp.add.v2i8(<2 x i8> %va, <2 x i8> %vb, <2 x i1> %m, i32 %evl)
69 define <2 x i8> @vadd_vi_v2i8(<2 x i8> %va, <2 x i1> %m, i32 zeroext %evl) {
70 ; CHECK-LABEL: vadd_vi_v2i8:
72 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
73 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
75 %elt.head = insertelement <2 x i8> poison, i8 -1, i32 0
76 %vb = shufflevector <2 x i8> %elt.head, <2 x i8> poison, <2 x i32> zeroinitializer
77 %v = call <2 x i8> @llvm.vp.add.v2i8(<2 x i8> %va, <2 x i8> %vb, <2 x i1> %m, i32 %evl)
81 define <2 x i8> @vadd_vi_v2i8_unmasked(<2 x i8> %va, i32 zeroext %evl) {
82 ; CHECK-LABEL: vadd_vi_v2i8_unmasked:
84 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
85 ; CHECK-NEXT: vadd.vi v8, v8, -1
87 %elt.head = insertelement <2 x i8> poison, i8 -1, i32 0
88 %vb = shufflevector <2 x i8> %elt.head, <2 x i8> poison, <2 x i32> zeroinitializer
89 %head = insertelement <2 x i1> poison, i1 true, i32 0
90 %m = shufflevector <2 x i1> %head, <2 x i1> poison, <2 x i32> zeroinitializer
91 %v = call <2 x i8> @llvm.vp.add.v2i8(<2 x i8> %va, <2 x i8> %vb, <2 x i1> %m, i32 %evl)
95 declare <4 x i8> @llvm.vp.add.v4i8(<4 x i8>, <4 x i8>, <4 x i1>, i32)
97 define <4 x i8> @vadd_vv_v4i8(<4 x i8> %va, <4 x i8> %b, <4 x i1> %m, i32 zeroext %evl) {
98 ; CHECK-LABEL: vadd_vv_v4i8:
100 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
101 ; CHECK-NEXT: vadd.vv v8, v8, v9, v0.t
103 %v = call <4 x i8> @llvm.vp.add.v4i8(<4 x i8> %va, <4 x i8> %b, <4 x i1> %m, i32 %evl)
107 define <4 x i8> @vadd_vv_v4i8_unmasked(<4 x i8> %va, <4 x i8> %b, i32 zeroext %evl) {
108 ; CHECK-LABEL: vadd_vv_v4i8_unmasked:
110 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
111 ; CHECK-NEXT: vadd.vv v8, v8, v9
113 %head = insertelement <4 x i1> poison, i1 true, i32 0
114 %m = shufflevector <4 x i1> %head, <4 x i1> poison, <4 x i32> zeroinitializer
115 %v = call <4 x i8> @llvm.vp.add.v4i8(<4 x i8> %va, <4 x i8> %b, <4 x i1> %m, i32 %evl)
119 define <4 x i8> @vadd_vx_v4i8(<4 x i8> %va, i8 %b, <4 x i1> %m, i32 zeroext %evl) {
120 ; CHECK-LABEL: vadd_vx_v4i8:
122 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
123 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
125 %elt.head = insertelement <4 x i8> poison, i8 %b, i32 0
126 %vb = shufflevector <4 x i8> %elt.head, <4 x i8> poison, <4 x i32> zeroinitializer
127 %v = call <4 x i8> @llvm.vp.add.v4i8(<4 x i8> %va, <4 x i8> %vb, <4 x i1> %m, i32 %evl)
131 define <4 x i8> @vadd_vx_v4i8_commute(<4 x i8> %va, i8 %b, <4 x i1> %m, i32 zeroext %evl) {
132 ; CHECK-LABEL: vadd_vx_v4i8_commute:
134 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
135 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
137 %elt.head = insertelement <4 x i8> poison, i8 %b, i32 0
138 %vb = shufflevector <4 x i8> %elt.head, <4 x i8> poison, <4 x i32> zeroinitializer
139 %v = call <4 x i8> @llvm.vp.add.v4i8(<4 x i8> %vb, <4 x i8> %va, <4 x i1> %m, i32 %evl)
143 define <4 x i8> @vadd_vx_v4i8_unmasked(<4 x i8> %va, i8 %b, i32 zeroext %evl) {
144 ; CHECK-LABEL: vadd_vx_v4i8_unmasked:
146 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
147 ; CHECK-NEXT: vadd.vx v8, v8, a0
149 %elt.head = insertelement <4 x i8> poison, i8 %b, i32 0
150 %vb = shufflevector <4 x i8> %elt.head, <4 x i8> poison, <4 x i32> zeroinitializer
151 %head = insertelement <4 x i1> poison, i1 true, i32 0
152 %m = shufflevector <4 x i1> %head, <4 x i1> poison, <4 x i32> zeroinitializer
153 %v = call <4 x i8> @llvm.vp.add.v4i8(<4 x i8> %va, <4 x i8> %vb, <4 x i1> %m, i32 %evl)
157 define <4 x i8> @vadd_vi_v4i8(<4 x i8> %va, <4 x i1> %m, i32 zeroext %evl) {
158 ; CHECK-LABEL: vadd_vi_v4i8:
160 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
161 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
163 %elt.head = insertelement <4 x i8> poison, i8 -1, i32 0
164 %vb = shufflevector <4 x i8> %elt.head, <4 x i8> poison, <4 x i32> zeroinitializer
165 %v = call <4 x i8> @llvm.vp.add.v4i8(<4 x i8> %va, <4 x i8> %vb, <4 x i1> %m, i32 %evl)
169 define <4 x i8> @vadd_vi_v4i8_unmasked(<4 x i8> %va, i32 zeroext %evl) {
170 ; CHECK-LABEL: vadd_vi_v4i8_unmasked:
172 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
173 ; CHECK-NEXT: vadd.vi v8, v8, -1
175 %elt.head = insertelement <4 x i8> poison, i8 -1, i32 0
176 %vb = shufflevector <4 x i8> %elt.head, <4 x i8> poison, <4 x i32> zeroinitializer
177 %head = insertelement <4 x i1> poison, i1 true, i32 0
178 %m = shufflevector <4 x i1> %head, <4 x i1> poison, <4 x i32> zeroinitializer
179 %v = call <4 x i8> @llvm.vp.add.v4i8(<4 x i8> %va, <4 x i8> %vb, <4 x i1> %m, i32 %evl)
183 declare <5 x i8> @llvm.vp.add.v5i8(<5 x i8>, <5 x i8>, <5 x i1>, i32)
185 define <5 x i8> @vadd_vv_v5i8(<5 x i8> %va, <5 x i8> %b, <5 x i1> %m, i32 zeroext %evl) {
186 ; CHECK-LABEL: vadd_vv_v5i8:
188 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
189 ; CHECK-NEXT: vadd.vv v8, v8, v9, v0.t
191 %v = call <5 x i8> @llvm.vp.add.v5i8(<5 x i8> %va, <5 x i8> %b, <5 x i1> %m, i32 %evl)
195 define <5 x i8> @vadd_vv_v5i8_unmasked(<5 x i8> %va, <5 x i8> %b, i32 zeroext %evl) {
196 ; CHECK-LABEL: vadd_vv_v5i8_unmasked:
198 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
199 ; CHECK-NEXT: vadd.vv v8, v8, v9
201 %head = insertelement <5 x i1> poison, i1 true, i32 0
202 %m = shufflevector <5 x i1> %head, <5 x i1> poison, <5 x i32> zeroinitializer
203 %v = call <5 x i8> @llvm.vp.add.v5i8(<5 x i8> %va, <5 x i8> %b, <5 x i1> %m, i32 %evl)
207 define <5 x i8> @vadd_vx_v5i8(<5 x i8> %va, i8 %b, <5 x i1> %m, i32 zeroext %evl) {
208 ; CHECK-LABEL: vadd_vx_v5i8:
210 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
211 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
213 %elt.head = insertelement <5 x i8> poison, i8 %b, i32 0
214 %vb = shufflevector <5 x i8> %elt.head, <5 x i8> poison, <5 x i32> zeroinitializer
215 %v = call <5 x i8> @llvm.vp.add.v5i8(<5 x i8> %va, <5 x i8> %vb, <5 x i1> %m, i32 %evl)
219 define <5 x i8> @vadd_vx_v5i8_unmasked(<5 x i8> %va, i8 %b, i32 zeroext %evl) {
220 ; CHECK-LABEL: vadd_vx_v5i8_unmasked:
222 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
223 ; CHECK-NEXT: vadd.vx v8, v8, a0
225 %elt.head = insertelement <5 x i8> poison, i8 %b, i32 0
226 %vb = shufflevector <5 x i8> %elt.head, <5 x i8> poison, <5 x i32> zeroinitializer
227 %head = insertelement <5 x i1> poison, i1 true, i32 0
228 %m = shufflevector <5 x i1> %head, <5 x i1> poison, <5 x i32> zeroinitializer
229 %v = call <5 x i8> @llvm.vp.add.v5i8(<5 x i8> %va, <5 x i8> %vb, <5 x i1> %m, i32 %evl)
233 define <5 x i8> @vadd_vi_v5i8(<5 x i8> %va, <5 x i1> %m, i32 zeroext %evl) {
234 ; CHECK-LABEL: vadd_vi_v5i8:
236 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
237 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
239 %elt.head = insertelement <5 x i8> poison, i8 -1, i32 0
240 %vb = shufflevector <5 x i8> %elt.head, <5 x i8> poison, <5 x i32> zeroinitializer
241 %v = call <5 x i8> @llvm.vp.add.v5i8(<5 x i8> %va, <5 x i8> %vb, <5 x i1> %m, i32 %evl)
245 define <5 x i8> @vadd_vi_v5i8_unmasked(<5 x i8> %va, i32 zeroext %evl) {
246 ; CHECK-LABEL: vadd_vi_v5i8_unmasked:
248 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
249 ; CHECK-NEXT: vadd.vi v8, v8, -1
251 %elt.head = insertelement <5 x i8> poison, i8 -1, i32 0
252 %vb = shufflevector <5 x i8> %elt.head, <5 x i8> poison, <5 x i32> zeroinitializer
253 %head = insertelement <5 x i1> poison, i1 true, i32 0
254 %m = shufflevector <5 x i1> %head, <5 x i1> poison, <5 x i32> zeroinitializer
255 %v = call <5 x i8> @llvm.vp.add.v5i8(<5 x i8> %va, <5 x i8> %vb, <5 x i1> %m, i32 %evl)
259 declare <8 x i8> @llvm.vp.add.v8i8(<8 x i8>, <8 x i8>, <8 x i1>, i32)
261 define <8 x i8> @vadd_vv_v8i8(<8 x i8> %va, <8 x i8> %b, <8 x i1> %m, i32 zeroext %evl) {
262 ; CHECK-LABEL: vadd_vv_v8i8:
264 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
265 ; CHECK-NEXT: vadd.vv v8, v8, v9, v0.t
267 %v = call <8 x i8> @llvm.vp.add.v8i8(<8 x i8> %va, <8 x i8> %b, <8 x i1> %m, i32 %evl)
271 define <8 x i8> @vadd_vv_v8i8_unmasked(<8 x i8> %va, <8 x i8> %b, i32 zeroext %evl) {
272 ; CHECK-LABEL: vadd_vv_v8i8_unmasked:
274 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
275 ; CHECK-NEXT: vadd.vv v8, v8, v9
277 %head = insertelement <8 x i1> poison, i1 true, i32 0
278 %m = shufflevector <8 x i1> %head, <8 x i1> poison, <8 x i32> zeroinitializer
279 %v = call <8 x i8> @llvm.vp.add.v8i8(<8 x i8> %va, <8 x i8> %b, <8 x i1> %m, i32 %evl)
283 define <8 x i8> @vadd_vx_v8i8(<8 x i8> %va, i8 %b, <8 x i1> %m, i32 zeroext %evl) {
284 ; CHECK-LABEL: vadd_vx_v8i8:
286 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
287 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
289 %elt.head = insertelement <8 x i8> poison, i8 %b, i32 0
290 %vb = shufflevector <8 x i8> %elt.head, <8 x i8> poison, <8 x i32> zeroinitializer
291 %v = call <8 x i8> @llvm.vp.add.v8i8(<8 x i8> %va, <8 x i8> %vb, <8 x i1> %m, i32 %evl)
295 define <8 x i8> @vadd_vx_v8i8_unmasked(<8 x i8> %va, i8 %b, i32 zeroext %evl) {
296 ; CHECK-LABEL: vadd_vx_v8i8_unmasked:
298 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
299 ; CHECK-NEXT: vadd.vx v8, v8, a0
301 %elt.head = insertelement <8 x i8> poison, i8 %b, i32 0
302 %vb = shufflevector <8 x i8> %elt.head, <8 x i8> poison, <8 x i32> zeroinitializer
303 %head = insertelement <8 x i1> poison, i1 true, i32 0
304 %m = shufflevector <8 x i1> %head, <8 x i1> poison, <8 x i32> zeroinitializer
305 %v = call <8 x i8> @llvm.vp.add.v8i8(<8 x i8> %va, <8 x i8> %vb, <8 x i1> %m, i32 %evl)
309 define <8 x i8> @vadd_vi_v8i8(<8 x i8> %va, <8 x i1> %m, i32 zeroext %evl) {
310 ; CHECK-LABEL: vadd_vi_v8i8:
312 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
313 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
315 %elt.head = insertelement <8 x i8> poison, i8 -1, i32 0
316 %vb = shufflevector <8 x i8> %elt.head, <8 x i8> poison, <8 x i32> zeroinitializer
317 %v = call <8 x i8> @llvm.vp.add.v8i8(<8 x i8> %va, <8 x i8> %vb, <8 x i1> %m, i32 %evl)
321 define <8 x i8> @vadd_vi_v8i8_unmasked(<8 x i8> %va, i32 zeroext %evl) {
322 ; CHECK-LABEL: vadd_vi_v8i8_unmasked:
324 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
325 ; CHECK-NEXT: vadd.vi v8, v8, -1
327 %elt.head = insertelement <8 x i8> poison, i8 -1, i32 0
328 %vb = shufflevector <8 x i8> %elt.head, <8 x i8> poison, <8 x i32> zeroinitializer
329 %head = insertelement <8 x i1> poison, i1 true, i32 0
330 %m = shufflevector <8 x i1> %head, <8 x i1> poison, <8 x i32> zeroinitializer
331 %v = call <8 x i8> @llvm.vp.add.v8i8(<8 x i8> %va, <8 x i8> %vb, <8 x i1> %m, i32 %evl)
335 declare <16 x i8> @llvm.vp.add.v16i8(<16 x i8>, <16 x i8>, <16 x i1>, i32)
337 define <16 x i8> @vadd_vv_v16i8(<16 x i8> %va, <16 x i8> %b, <16 x i1> %m, i32 zeroext %evl) {
338 ; CHECK-LABEL: vadd_vv_v16i8:
340 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
341 ; CHECK-NEXT: vadd.vv v8, v8, v9, v0.t
343 %v = call <16 x i8> @llvm.vp.add.v16i8(<16 x i8> %va, <16 x i8> %b, <16 x i1> %m, i32 %evl)
347 define <16 x i8> @vadd_vv_v16i8_unmasked(<16 x i8> %va, <16 x i8> %b, i32 zeroext %evl) {
348 ; CHECK-LABEL: vadd_vv_v16i8_unmasked:
350 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
351 ; CHECK-NEXT: vadd.vv v8, v8, v9
353 %head = insertelement <16 x i1> poison, i1 true, i32 0
354 %m = shufflevector <16 x i1> %head, <16 x i1> poison, <16 x i32> zeroinitializer
355 %v = call <16 x i8> @llvm.vp.add.v16i8(<16 x i8> %va, <16 x i8> %b, <16 x i1> %m, i32 %evl)
359 define <16 x i8> @vadd_vx_v16i8(<16 x i8> %va, i8 %b, <16 x i1> %m, i32 zeroext %evl) {
360 ; CHECK-LABEL: vadd_vx_v16i8:
362 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
363 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
365 %elt.head = insertelement <16 x i8> poison, i8 %b, i32 0
366 %vb = shufflevector <16 x i8> %elt.head, <16 x i8> poison, <16 x i32> zeroinitializer
367 %v = call <16 x i8> @llvm.vp.add.v16i8(<16 x i8> %va, <16 x i8> %vb, <16 x i1> %m, i32 %evl)
371 define <16 x i8> @vadd_vx_v16i8_unmasked(<16 x i8> %va, i8 %b, i32 zeroext %evl) {
372 ; CHECK-LABEL: vadd_vx_v16i8_unmasked:
374 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
375 ; CHECK-NEXT: vadd.vx v8, v8, a0
377 %elt.head = insertelement <16 x i8> poison, i8 %b, i32 0
378 %vb = shufflevector <16 x i8> %elt.head, <16 x i8> poison, <16 x i32> zeroinitializer
379 %head = insertelement <16 x i1> poison, i1 true, i32 0
380 %m = shufflevector <16 x i1> %head, <16 x i1> poison, <16 x i32> zeroinitializer
381 %v = call <16 x i8> @llvm.vp.add.v16i8(<16 x i8> %va, <16 x i8> %vb, <16 x i1> %m, i32 %evl)
385 define <16 x i8> @vadd_vi_v16i8(<16 x i8> %va, <16 x i1> %m, i32 zeroext %evl) {
386 ; CHECK-LABEL: vadd_vi_v16i8:
388 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
389 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
391 %elt.head = insertelement <16 x i8> poison, i8 -1, i32 0
392 %vb = shufflevector <16 x i8> %elt.head, <16 x i8> poison, <16 x i32> zeroinitializer
393 %v = call <16 x i8> @llvm.vp.add.v16i8(<16 x i8> %va, <16 x i8> %vb, <16 x i1> %m, i32 %evl)
397 define <16 x i8> @vadd_vi_v16i8_unmasked(<16 x i8> %va, i32 zeroext %evl) {
398 ; CHECK-LABEL: vadd_vi_v16i8_unmasked:
400 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
401 ; CHECK-NEXT: vadd.vi v8, v8, -1
403 %elt.head = insertelement <16 x i8> poison, i8 -1, i32 0
404 %vb = shufflevector <16 x i8> %elt.head, <16 x i8> poison, <16 x i32> zeroinitializer
405 %head = insertelement <16 x i1> poison, i1 true, i32 0
406 %m = shufflevector <16 x i1> %head, <16 x i1> poison, <16 x i32> zeroinitializer
407 %v = call <16 x i8> @llvm.vp.add.v16i8(<16 x i8> %va, <16 x i8> %vb, <16 x i1> %m, i32 %evl)
411 declare <256 x i8> @llvm.vp.add.v258i8(<256 x i8>, <256 x i8>, <256 x i1>, i32)
413 define <256 x i8> @vadd_vi_v258i8(<256 x i8> %va, <256 x i1> %m, i32 zeroext %evl) {
414 ; CHECK-LABEL: vadd_vi_v258i8:
416 ; CHECK-NEXT: vmv1r.v v24, v0
417 ; CHECK-NEXT: li a2, 128
418 ; CHECK-NEXT: vsetvli zero, a2, e8, m8, ta, ma
419 ; CHECK-NEXT: vlm.v v0, (a0)
420 ; CHECK-NEXT: addi a0, a1, -128
421 ; CHECK-NEXT: sltu a3, a1, a0
422 ; CHECK-NEXT: addi a3, a3, -1
423 ; CHECK-NEXT: and a0, a3, a0
424 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
425 ; CHECK-NEXT: vadd.vi v16, v16, -1, v0.t
426 ; CHECK-NEXT: bltu a1, a2, .LBB32_2
427 ; CHECK-NEXT: # %bb.1:
428 ; CHECK-NEXT: li a1, 128
429 ; CHECK-NEXT: .LBB32_2:
430 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
431 ; CHECK-NEXT: vmv1r.v v0, v24
432 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
434 %elt.head = insertelement <256 x i8> poison, i8 -1, i32 0
435 %vb = shufflevector <256 x i8> %elt.head, <256 x i8> poison, <256 x i32> zeroinitializer
436 %v = call <256 x i8> @llvm.vp.add.v258i8(<256 x i8> %va, <256 x i8> %vb, <256 x i1> %m, i32 %evl)
440 define <256 x i8> @vadd_vi_v258i8_unmasked(<256 x i8> %va, i32 zeroext %evl) {
441 ; CHECK-LABEL: vadd_vi_v258i8_unmasked:
443 ; CHECK-NEXT: li a2, 128
444 ; CHECK-NEXT: mv a1, a0
445 ; CHECK-NEXT: bltu a0, a2, .LBB33_2
446 ; CHECK-NEXT: # %bb.1:
447 ; CHECK-NEXT: li a1, 128
448 ; CHECK-NEXT: .LBB33_2:
449 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
450 ; CHECK-NEXT: vadd.vi v8, v8, -1
451 ; CHECK-NEXT: addi a1, a0, -128
452 ; CHECK-NEXT: sltu a0, a0, a1
453 ; CHECK-NEXT: addi a0, a0, -1
454 ; CHECK-NEXT: and a0, a0, a1
455 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
456 ; CHECK-NEXT: vadd.vi v16, v16, -1
458 %elt.head = insertelement <256 x i8> poison, i8 -1, i32 0
459 %vb = shufflevector <256 x i8> %elt.head, <256 x i8> poison, <256 x i32> zeroinitializer
460 %head = insertelement <256 x i1> poison, i1 true, i32 0
461 %m = shufflevector <256 x i1> %head, <256 x i1> poison, <256 x i32> zeroinitializer
462 %v = call <256 x i8> @llvm.vp.add.v258i8(<256 x i8> %va, <256 x i8> %vb, <256 x i1> %m, i32 %evl)
466 ; Test splitting when the %evl is a known constant.
468 define <256 x i8> @vadd_vi_v258i8_evl129(<256 x i8> %va, <256 x i1> %m) {
469 ; CHECK-LABEL: vadd_vi_v258i8_evl129:
471 ; CHECK-NEXT: li a1, 128
472 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
473 ; CHECK-NEXT: vlm.v v24, (a0)
474 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
475 ; CHECK-NEXT: vsetivli zero, 1, e8, m8, ta, ma
476 ; CHECK-NEXT: vmv1r.v v0, v24
477 ; CHECK-NEXT: vadd.vi v16, v16, -1, v0.t
479 %elt.head = insertelement <256 x i8> poison, i8 -1, i32 0
480 %vb = shufflevector <256 x i8> %elt.head, <256 x i8> poison, <256 x i32> zeroinitializer
481 %v = call <256 x i8> @llvm.vp.add.v258i8(<256 x i8> %va, <256 x i8> %vb, <256 x i1> %m, i32 129)
485 ; FIXME: The upper half is doing nothing.
487 define <256 x i8> @vadd_vi_v258i8_evl128(<256 x i8> %va, <256 x i1> %m) {
488 ; CHECK-LABEL: vadd_vi_v258i8_evl128:
490 ; CHECK-NEXT: li a0, 128
491 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
492 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
494 %elt.head = insertelement <256 x i8> poison, i8 -1, i32 0
495 %vb = shufflevector <256 x i8> %elt.head, <256 x i8> poison, <256 x i32> zeroinitializer
496 %v = call <256 x i8> @llvm.vp.add.v258i8(<256 x i8> %va, <256 x i8> %vb, <256 x i1> %m, i32 128)
500 declare <2 x i16> @llvm.vp.add.v2i16(<2 x i16>, <2 x i16>, <2 x i1>, i32)
502 define <2 x i16> @vadd_vv_v2i16(<2 x i16> %va, <2 x i16> %b, <2 x i1> %m, i32 zeroext %evl) {
503 ; CHECK-LABEL: vadd_vv_v2i16:
505 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
506 ; CHECK-NEXT: vadd.vv v8, v8, v9, v0.t
508 %v = call <2 x i16> @llvm.vp.add.v2i16(<2 x i16> %va, <2 x i16> %b, <2 x i1> %m, i32 %evl)
512 define <2 x i16> @vadd_vv_v2i16_unmasked(<2 x i16> %va, <2 x i16> %b, i32 zeroext %evl) {
513 ; CHECK-LABEL: vadd_vv_v2i16_unmasked:
515 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
516 ; CHECK-NEXT: vadd.vv v8, v8, v9
518 %head = insertelement <2 x i1> poison, i1 true, i32 0
519 %m = shufflevector <2 x i1> %head, <2 x i1> poison, <2 x i32> zeroinitializer
520 %v = call <2 x i16> @llvm.vp.add.v2i16(<2 x i16> %va, <2 x i16> %b, <2 x i1> %m, i32 %evl)
524 define <2 x i16> @vadd_vx_v2i16(<2 x i16> %va, i16 %b, <2 x i1> %m, i32 zeroext %evl) {
525 ; CHECK-LABEL: vadd_vx_v2i16:
527 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
528 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
530 %elt.head = insertelement <2 x i16> poison, i16 %b, i32 0
531 %vb = shufflevector <2 x i16> %elt.head, <2 x i16> poison, <2 x i32> zeroinitializer
532 %v = call <2 x i16> @llvm.vp.add.v2i16(<2 x i16> %va, <2 x i16> %vb, <2 x i1> %m, i32 %evl)
536 define <2 x i16> @vadd_vx_v2i16_unmasked(<2 x i16> %va, i16 %b, i32 zeroext %evl) {
537 ; CHECK-LABEL: vadd_vx_v2i16_unmasked:
539 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
540 ; CHECK-NEXT: vadd.vx v8, v8, a0
542 %elt.head = insertelement <2 x i16> poison, i16 %b, i32 0
543 %vb = shufflevector <2 x i16> %elt.head, <2 x i16> poison, <2 x i32> zeroinitializer
544 %head = insertelement <2 x i1> poison, i1 true, i32 0
545 %m = shufflevector <2 x i1> %head, <2 x i1> poison, <2 x i32> zeroinitializer
546 %v = call <2 x i16> @llvm.vp.add.v2i16(<2 x i16> %va, <2 x i16> %vb, <2 x i1> %m, i32 %evl)
550 define <2 x i16> @vadd_vi_v2i16(<2 x i16> %va, <2 x i1> %m, i32 zeroext %evl) {
551 ; CHECK-LABEL: vadd_vi_v2i16:
553 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
554 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
556 %elt.head = insertelement <2 x i16> poison, i16 -1, i32 0
557 %vb = shufflevector <2 x i16> %elt.head, <2 x i16> poison, <2 x i32> zeroinitializer
558 %v = call <2 x i16> @llvm.vp.add.v2i16(<2 x i16> %va, <2 x i16> %vb, <2 x i1> %m, i32 %evl)
562 define <2 x i16> @vadd_vi_v2i16_unmasked(<2 x i16> %va, i32 zeroext %evl) {
563 ; CHECK-LABEL: vadd_vi_v2i16_unmasked:
565 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
566 ; CHECK-NEXT: vadd.vi v8, v8, -1
568 %elt.head = insertelement <2 x i16> poison, i16 -1, i32 0
569 %vb = shufflevector <2 x i16> %elt.head, <2 x i16> poison, <2 x i32> zeroinitializer
570 %head = insertelement <2 x i1> poison, i1 true, i32 0
571 %m = shufflevector <2 x i1> %head, <2 x i1> poison, <2 x i32> zeroinitializer
572 %v = call <2 x i16> @llvm.vp.add.v2i16(<2 x i16> %va, <2 x i16> %vb, <2 x i1> %m, i32 %evl)
576 declare <4 x i16> @llvm.vp.add.v4i16(<4 x i16>, <4 x i16>, <4 x i1>, i32)
578 define <4 x i16> @vadd_vv_v4i16(<4 x i16> %va, <4 x i16> %b, <4 x i1> %m, i32 zeroext %evl) {
579 ; CHECK-LABEL: vadd_vv_v4i16:
581 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
582 ; CHECK-NEXT: vadd.vv v8, v8, v9, v0.t
584 %v = call <4 x i16> @llvm.vp.add.v4i16(<4 x i16> %va, <4 x i16> %b, <4 x i1> %m, i32 %evl)
588 define <4 x i16> @vadd_vv_v4i16_unmasked(<4 x i16> %va, <4 x i16> %b, i32 zeroext %evl) {
589 ; CHECK-LABEL: vadd_vv_v4i16_unmasked:
591 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
592 ; CHECK-NEXT: vadd.vv v8, v8, v9
594 %head = insertelement <4 x i1> poison, i1 true, i32 0
595 %m = shufflevector <4 x i1> %head, <4 x i1> poison, <4 x i32> zeroinitializer
596 %v = call <4 x i16> @llvm.vp.add.v4i16(<4 x i16> %va, <4 x i16> %b, <4 x i1> %m, i32 %evl)
600 define <4 x i16> @vadd_vx_v4i16(<4 x i16> %va, i16 %b, <4 x i1> %m, i32 zeroext %evl) {
601 ; CHECK-LABEL: vadd_vx_v4i16:
603 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
604 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
606 %elt.head = insertelement <4 x i16> poison, i16 %b, i32 0
607 %vb = shufflevector <4 x i16> %elt.head, <4 x i16> poison, <4 x i32> zeroinitializer
608 %v = call <4 x i16> @llvm.vp.add.v4i16(<4 x i16> %va, <4 x i16> %vb, <4 x i1> %m, i32 %evl)
612 define <4 x i16> @vadd_vx_v4i16_unmasked(<4 x i16> %va, i16 %b, i32 zeroext %evl) {
613 ; CHECK-LABEL: vadd_vx_v4i16_unmasked:
615 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
616 ; CHECK-NEXT: vadd.vx v8, v8, a0
618 %elt.head = insertelement <4 x i16> poison, i16 %b, i32 0
619 %vb = shufflevector <4 x i16> %elt.head, <4 x i16> poison, <4 x i32> zeroinitializer
620 %head = insertelement <4 x i1> poison, i1 true, i32 0
621 %m = shufflevector <4 x i1> %head, <4 x i1> poison, <4 x i32> zeroinitializer
622 %v = call <4 x i16> @llvm.vp.add.v4i16(<4 x i16> %va, <4 x i16> %vb, <4 x i1> %m, i32 %evl)
626 define <4 x i16> @vadd_vi_v4i16(<4 x i16> %va, <4 x i1> %m, i32 zeroext %evl) {
627 ; CHECK-LABEL: vadd_vi_v4i16:
629 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
630 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
632 %elt.head = insertelement <4 x i16> poison, i16 -1, i32 0
633 %vb = shufflevector <4 x i16> %elt.head, <4 x i16> poison, <4 x i32> zeroinitializer
634 %v = call <4 x i16> @llvm.vp.add.v4i16(<4 x i16> %va, <4 x i16> %vb, <4 x i1> %m, i32 %evl)
638 define <4 x i16> @vadd_vi_v4i16_unmasked(<4 x i16> %va, i32 zeroext %evl) {
639 ; CHECK-LABEL: vadd_vi_v4i16_unmasked:
641 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
642 ; CHECK-NEXT: vadd.vi v8, v8, -1
644 %elt.head = insertelement <4 x i16> poison, i16 -1, i32 0
645 %vb = shufflevector <4 x i16> %elt.head, <4 x i16> poison, <4 x i32> zeroinitializer
646 %head = insertelement <4 x i1> poison, i1 true, i32 0
647 %m = shufflevector <4 x i1> %head, <4 x i1> poison, <4 x i32> zeroinitializer
648 %v = call <4 x i16> @llvm.vp.add.v4i16(<4 x i16> %va, <4 x i16> %vb, <4 x i1> %m, i32 %evl)
652 declare <8 x i16> @llvm.vp.add.v8i16(<8 x i16>, <8 x i16>, <8 x i1>, i32)
654 define <8 x i16> @vadd_vv_v8i16(<8 x i16> %va, <8 x i16> %b, <8 x i1> %m, i32 zeroext %evl) {
655 ; CHECK-LABEL: vadd_vv_v8i16:
657 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
658 ; CHECK-NEXT: vadd.vv v8, v8, v9, v0.t
660 %v = call <8 x i16> @llvm.vp.add.v8i16(<8 x i16> %va, <8 x i16> %b, <8 x i1> %m, i32 %evl)
664 define <8 x i16> @vadd_vv_v8i16_unmasked(<8 x i16> %va, <8 x i16> %b, i32 zeroext %evl) {
665 ; CHECK-LABEL: vadd_vv_v8i16_unmasked:
667 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
668 ; CHECK-NEXT: vadd.vv v8, v8, v9
670 %head = insertelement <8 x i1> poison, i1 true, i32 0
671 %m = shufflevector <8 x i1> %head, <8 x i1> poison, <8 x i32> zeroinitializer
672 %v = call <8 x i16> @llvm.vp.add.v8i16(<8 x i16> %va, <8 x i16> %b, <8 x i1> %m, i32 %evl)
676 define <8 x i16> @vadd_vx_v8i16(<8 x i16> %va, i16 %b, <8 x i1> %m, i32 zeroext %evl) {
677 ; CHECK-LABEL: vadd_vx_v8i16:
679 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, ta, ma
680 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
682 %elt.head = insertelement <8 x i16> poison, i16 %b, i32 0
683 %vb = shufflevector <8 x i16> %elt.head, <8 x i16> poison, <8 x i32> zeroinitializer
684 %v = call <8 x i16> @llvm.vp.add.v8i16(<8 x i16> %va, <8 x i16> %vb, <8 x i1> %m, i32 %evl)
688 define <8 x i16> @vadd_vx_v8i16_unmasked(<8 x i16> %va, i16 %b, i32 zeroext %evl) {
689 ; CHECK-LABEL: vadd_vx_v8i16_unmasked:
691 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, ta, ma
692 ; CHECK-NEXT: vadd.vx v8, v8, a0
694 %elt.head = insertelement <8 x i16> poison, i16 %b, i32 0
695 %vb = shufflevector <8 x i16> %elt.head, <8 x i16> poison, <8 x i32> zeroinitializer
696 %head = insertelement <8 x i1> poison, i1 true, i32 0
697 %m = shufflevector <8 x i1> %head, <8 x i1> poison, <8 x i32> zeroinitializer
698 %v = call <8 x i16> @llvm.vp.add.v8i16(<8 x i16> %va, <8 x i16> %vb, <8 x i1> %m, i32 %evl)
702 define <8 x i16> @vadd_vi_v8i16(<8 x i16> %va, <8 x i1> %m, i32 zeroext %evl) {
703 ; CHECK-LABEL: vadd_vi_v8i16:
705 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
706 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
708 %elt.head = insertelement <8 x i16> poison, i16 -1, i32 0
709 %vb = shufflevector <8 x i16> %elt.head, <8 x i16> poison, <8 x i32> zeroinitializer
710 %v = call <8 x i16> @llvm.vp.add.v8i16(<8 x i16> %va, <8 x i16> %vb, <8 x i1> %m, i32 %evl)
714 define <8 x i16> @vadd_vi_v8i16_unmasked(<8 x i16> %va, i32 zeroext %evl) {
715 ; CHECK-LABEL: vadd_vi_v8i16_unmasked:
717 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
718 ; CHECK-NEXT: vadd.vi v8, v8, -1
720 %elt.head = insertelement <8 x i16> poison, i16 -1, i32 0
721 %vb = shufflevector <8 x i16> %elt.head, <8 x i16> poison, <8 x i32> zeroinitializer
722 %head = insertelement <8 x i1> poison, i1 true, i32 0
723 %m = shufflevector <8 x i1> %head, <8 x i1> poison, <8 x i32> zeroinitializer
724 %v = call <8 x i16> @llvm.vp.add.v8i16(<8 x i16> %va, <8 x i16> %vb, <8 x i1> %m, i32 %evl)
728 declare <16 x i16> @llvm.vp.add.v16i16(<16 x i16>, <16 x i16>, <16 x i1>, i32)
730 define <16 x i16> @vadd_vv_v16i16(<16 x i16> %va, <16 x i16> %b, <16 x i1> %m, i32 zeroext %evl) {
731 ; CHECK-LABEL: vadd_vv_v16i16:
733 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
734 ; CHECK-NEXT: vadd.vv v8, v8, v10, v0.t
736 %v = call <16 x i16> @llvm.vp.add.v16i16(<16 x i16> %va, <16 x i16> %b, <16 x i1> %m, i32 %evl)
740 define <16 x i16> @vadd_vv_v16i16_unmasked(<16 x i16> %va, <16 x i16> %b, i32 zeroext %evl) {
741 ; CHECK-LABEL: vadd_vv_v16i16_unmasked:
743 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
744 ; CHECK-NEXT: vadd.vv v8, v8, v10
746 %head = insertelement <16 x i1> poison, i1 true, i32 0
747 %m = shufflevector <16 x i1> %head, <16 x i1> poison, <16 x i32> zeroinitializer
748 %v = call <16 x i16> @llvm.vp.add.v16i16(<16 x i16> %va, <16 x i16> %b, <16 x i1> %m, i32 %evl)
752 define <16 x i16> @vadd_vx_v16i16(<16 x i16> %va, i16 %b, <16 x i1> %m, i32 zeroext %evl) {
753 ; CHECK-LABEL: vadd_vx_v16i16:
755 ; CHECK-NEXT: vsetvli zero, a1, e16, m2, ta, ma
756 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
758 %elt.head = insertelement <16 x i16> poison, i16 %b, i32 0
759 %vb = shufflevector <16 x i16> %elt.head, <16 x i16> poison, <16 x i32> zeroinitializer
760 %v = call <16 x i16> @llvm.vp.add.v16i16(<16 x i16> %va, <16 x i16> %vb, <16 x i1> %m, i32 %evl)
764 define <16 x i16> @vadd_vx_v16i16_unmasked(<16 x i16> %va, i16 %b, i32 zeroext %evl) {
765 ; CHECK-LABEL: vadd_vx_v16i16_unmasked:
767 ; CHECK-NEXT: vsetvli zero, a1, e16, m2, ta, ma
768 ; CHECK-NEXT: vadd.vx v8, v8, a0
770 %elt.head = insertelement <16 x i16> poison, i16 %b, i32 0
771 %vb = shufflevector <16 x i16> %elt.head, <16 x i16> poison, <16 x i32> zeroinitializer
772 %head = insertelement <16 x i1> poison, i1 true, i32 0
773 %m = shufflevector <16 x i1> %head, <16 x i1> poison, <16 x i32> zeroinitializer
774 %v = call <16 x i16> @llvm.vp.add.v16i16(<16 x i16> %va, <16 x i16> %vb, <16 x i1> %m, i32 %evl)
778 define <16 x i16> @vadd_vi_v16i16(<16 x i16> %va, <16 x i1> %m, i32 zeroext %evl) {
779 ; CHECK-LABEL: vadd_vi_v16i16:
781 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
782 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
784 %elt.head = insertelement <16 x i16> poison, i16 -1, i32 0
785 %vb = shufflevector <16 x i16> %elt.head, <16 x i16> poison, <16 x i32> zeroinitializer
786 %v = call <16 x i16> @llvm.vp.add.v16i16(<16 x i16> %va, <16 x i16> %vb, <16 x i1> %m, i32 %evl)
790 define <16 x i16> @vadd_vi_v16i16_unmasked(<16 x i16> %va, i32 zeroext %evl) {
791 ; CHECK-LABEL: vadd_vi_v16i16_unmasked:
793 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
794 ; CHECK-NEXT: vadd.vi v8, v8, -1
796 %elt.head = insertelement <16 x i16> poison, i16 -1, i32 0
797 %vb = shufflevector <16 x i16> %elt.head, <16 x i16> poison, <16 x i32> zeroinitializer
798 %head = insertelement <16 x i1> poison, i1 true, i32 0
799 %m = shufflevector <16 x i1> %head, <16 x i1> poison, <16 x i32> zeroinitializer
800 %v = call <16 x i16> @llvm.vp.add.v16i16(<16 x i16> %va, <16 x i16> %vb, <16 x i1> %m, i32 %evl)
804 declare <2 x i32> @llvm.vp.add.v2i32(<2 x i32>, <2 x i32>, <2 x i1>, i32)
806 define <2 x i32> @vadd_vv_v2i32(<2 x i32> %va, <2 x i32> %b, <2 x i1> %m, i32 zeroext %evl) {
807 ; CHECK-LABEL: vadd_vv_v2i32:
809 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
810 ; CHECK-NEXT: vadd.vv v8, v8, v9, v0.t
812 %v = call <2 x i32> @llvm.vp.add.v2i32(<2 x i32> %va, <2 x i32> %b, <2 x i1> %m, i32 %evl)
816 define <2 x i32> @vadd_vv_v2i32_unmasked(<2 x i32> %va, <2 x i32> %b, i32 zeroext %evl) {
817 ; CHECK-LABEL: vadd_vv_v2i32_unmasked:
819 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
820 ; CHECK-NEXT: vadd.vv v8, v8, v9
822 %head = insertelement <2 x i1> poison, i1 true, i32 0
823 %m = shufflevector <2 x i1> %head, <2 x i1> poison, <2 x i32> zeroinitializer
824 %v = call <2 x i32> @llvm.vp.add.v2i32(<2 x i32> %va, <2 x i32> %b, <2 x i1> %m, i32 %evl)
828 define <2 x i32> @vadd_vx_v2i32(<2 x i32> %va, i32 %b, <2 x i1> %m, i32 zeroext %evl) {
829 ; CHECK-LABEL: vadd_vx_v2i32:
831 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
832 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
834 %elt.head = insertelement <2 x i32> poison, i32 %b, i32 0
835 %vb = shufflevector <2 x i32> %elt.head, <2 x i32> poison, <2 x i32> zeroinitializer
836 %v = call <2 x i32> @llvm.vp.add.v2i32(<2 x i32> %va, <2 x i32> %vb, <2 x i1> %m, i32 %evl)
840 define <2 x i32> @vadd_vx_v2i32_unmasked(<2 x i32> %va, i32 %b, i32 zeroext %evl) {
841 ; CHECK-LABEL: vadd_vx_v2i32_unmasked:
843 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
844 ; CHECK-NEXT: vadd.vx v8, v8, a0
846 %elt.head = insertelement <2 x i32> poison, i32 %b, i32 0
847 %vb = shufflevector <2 x i32> %elt.head, <2 x i32> poison, <2 x i32> zeroinitializer
848 %head = insertelement <2 x i1> poison, i1 true, i32 0
849 %m = shufflevector <2 x i1> %head, <2 x i1> poison, <2 x i32> zeroinitializer
850 %v = call <2 x i32> @llvm.vp.add.v2i32(<2 x i32> %va, <2 x i32> %vb, <2 x i1> %m, i32 %evl)
854 define <2 x i32> @vadd_vi_v2i32(<2 x i32> %va, <2 x i1> %m, i32 zeroext %evl) {
855 ; CHECK-LABEL: vadd_vi_v2i32:
857 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
858 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
860 %elt.head = insertelement <2 x i32> poison, i32 -1, i32 0
861 %vb = shufflevector <2 x i32> %elt.head, <2 x i32> poison, <2 x i32> zeroinitializer
862 %v = call <2 x i32> @llvm.vp.add.v2i32(<2 x i32> %va, <2 x i32> %vb, <2 x i1> %m, i32 %evl)
866 define <2 x i32> @vadd_vi_v2i32_unmasked(<2 x i32> %va, i32 zeroext %evl) {
867 ; CHECK-LABEL: vadd_vi_v2i32_unmasked:
869 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
870 ; CHECK-NEXT: vadd.vi v8, v8, -1
872 %elt.head = insertelement <2 x i32> poison, i32 -1, i32 0
873 %vb = shufflevector <2 x i32> %elt.head, <2 x i32> poison, <2 x i32> zeroinitializer
874 %head = insertelement <2 x i1> poison, i1 true, i32 0
875 %m = shufflevector <2 x i1> %head, <2 x i1> poison, <2 x i32> zeroinitializer
876 %v = call <2 x i32> @llvm.vp.add.v2i32(<2 x i32> %va, <2 x i32> %vb, <2 x i1> %m, i32 %evl)
880 declare <4 x i32> @llvm.vp.add.v4i32(<4 x i32>, <4 x i32>, <4 x i1>, i32)
882 define <4 x i32> @vadd_vv_v4i32(<4 x i32> %va, <4 x i32> %b, <4 x i1> %m, i32 zeroext %evl) {
883 ; CHECK-LABEL: vadd_vv_v4i32:
885 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
886 ; CHECK-NEXT: vadd.vv v8, v8, v9, v0.t
888 %v = call <4 x i32> @llvm.vp.add.v4i32(<4 x i32> %va, <4 x i32> %b, <4 x i1> %m, i32 %evl)
892 define <4 x i32> @vadd_vv_v4i32_unmasked(<4 x i32> %va, <4 x i32> %b, i32 zeroext %evl) {
893 ; CHECK-LABEL: vadd_vv_v4i32_unmasked:
895 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
896 ; CHECK-NEXT: vadd.vv v8, v8, v9
898 %head = insertelement <4 x i1> poison, i1 true, i32 0
899 %m = shufflevector <4 x i1> %head, <4 x i1> poison, <4 x i32> zeroinitializer
900 %v = call <4 x i32> @llvm.vp.add.v4i32(<4 x i32> %va, <4 x i32> %b, <4 x i1> %m, i32 %evl)
904 define <4 x i32> @vadd_vx_v4i32(<4 x i32> %va, i32 %b, <4 x i1> %m, i32 zeroext %evl) {
905 ; CHECK-LABEL: vadd_vx_v4i32:
907 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
908 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
910 %elt.head = insertelement <4 x i32> poison, i32 %b, i32 0
911 %vb = shufflevector <4 x i32> %elt.head, <4 x i32> poison, <4 x i32> zeroinitializer
912 %v = call <4 x i32> @llvm.vp.add.v4i32(<4 x i32> %va, <4 x i32> %vb, <4 x i1> %m, i32 %evl)
916 define <4 x i32> @vadd_vx_v4i32_unmasked(<4 x i32> %va, i32 %b, i32 zeroext %evl) {
917 ; CHECK-LABEL: vadd_vx_v4i32_unmasked:
919 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
920 ; CHECK-NEXT: vadd.vx v8, v8, a0
922 %elt.head = insertelement <4 x i32> poison, i32 %b, i32 0
923 %vb = shufflevector <4 x i32> %elt.head, <4 x i32> poison, <4 x i32> zeroinitializer
924 %head = insertelement <4 x i1> poison, i1 true, i32 0
925 %m = shufflevector <4 x i1> %head, <4 x i1> poison, <4 x i32> zeroinitializer
926 %v = call <4 x i32> @llvm.vp.add.v4i32(<4 x i32> %va, <4 x i32> %vb, <4 x i1> %m, i32 %evl)
930 define <4 x i32> @vadd_vi_v4i32(<4 x i32> %va, <4 x i1> %m, i32 zeroext %evl) {
931 ; CHECK-LABEL: vadd_vi_v4i32:
933 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
934 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
936 %elt.head = insertelement <4 x i32> poison, i32 -1, i32 0
937 %vb = shufflevector <4 x i32> %elt.head, <4 x i32> poison, <4 x i32> zeroinitializer
938 %v = call <4 x i32> @llvm.vp.add.v4i32(<4 x i32> %va, <4 x i32> %vb, <4 x i1> %m, i32 %evl)
942 define <4 x i32> @vadd_vi_v4i32_unmasked(<4 x i32> %va, i32 zeroext %evl) {
943 ; CHECK-LABEL: vadd_vi_v4i32_unmasked:
945 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
946 ; CHECK-NEXT: vadd.vi v8, v8, -1
948 %elt.head = insertelement <4 x i32> poison, i32 -1, i32 0
949 %vb = shufflevector <4 x i32> %elt.head, <4 x i32> poison, <4 x i32> zeroinitializer
950 %head = insertelement <4 x i1> poison, i1 true, i32 0
951 %m = shufflevector <4 x i1> %head, <4 x i1> poison, <4 x i32> zeroinitializer
952 %v = call <4 x i32> @llvm.vp.add.v4i32(<4 x i32> %va, <4 x i32> %vb, <4 x i1> %m, i32 %evl)
956 declare <8 x i32> @llvm.vp.add.v8i32(<8 x i32>, <8 x i32>, <8 x i1>, i32)
958 define <8 x i32> @vadd_vv_v8i32(<8 x i32> %va, <8 x i32> %b, <8 x i1> %m, i32 zeroext %evl) {
959 ; CHECK-LABEL: vadd_vv_v8i32:
961 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
962 ; CHECK-NEXT: vadd.vv v8, v8, v10, v0.t
964 %v = call <8 x i32> @llvm.vp.add.v8i32(<8 x i32> %va, <8 x i32> %b, <8 x i1> %m, i32 %evl)
968 define <8 x i32> @vadd_vv_v8i32_unmasked(<8 x i32> %va, <8 x i32> %b, i32 zeroext %evl) {
969 ; CHECK-LABEL: vadd_vv_v8i32_unmasked:
971 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
972 ; CHECK-NEXT: vadd.vv v8, v8, v10
974 %head = insertelement <8 x i1> poison, i1 true, i32 0
975 %m = shufflevector <8 x i1> %head, <8 x i1> poison, <8 x i32> zeroinitializer
976 %v = call <8 x i32> @llvm.vp.add.v8i32(<8 x i32> %va, <8 x i32> %b, <8 x i1> %m, i32 %evl)
980 define <8 x i32> @vadd_vx_v8i32(<8 x i32> %va, i32 %b, <8 x i1> %m, i32 zeroext %evl) {
981 ; CHECK-LABEL: vadd_vx_v8i32:
983 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
984 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
986 %elt.head = insertelement <8 x i32> poison, i32 %b, i32 0
987 %vb = shufflevector <8 x i32> %elt.head, <8 x i32> poison, <8 x i32> zeroinitializer
988 %v = call <8 x i32> @llvm.vp.add.v8i32(<8 x i32> %va, <8 x i32> %vb, <8 x i1> %m, i32 %evl)
992 define <8 x i32> @vadd_vx_v8i32_unmasked(<8 x i32> %va, i32 %b, i32 zeroext %evl) {
993 ; CHECK-LABEL: vadd_vx_v8i32_unmasked:
995 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
996 ; CHECK-NEXT: vadd.vx v8, v8, a0
998 %elt.head = insertelement <8 x i32> poison, i32 %b, i32 0
999 %vb = shufflevector <8 x i32> %elt.head, <8 x i32> poison, <8 x i32> zeroinitializer
1000 %head = insertelement <8 x i1> poison, i1 true, i32 0
1001 %m = shufflevector <8 x i1> %head, <8 x i1> poison, <8 x i32> zeroinitializer
1002 %v = call <8 x i32> @llvm.vp.add.v8i32(<8 x i32> %va, <8 x i32> %vb, <8 x i1> %m, i32 %evl)
1006 define <8 x i32> @vadd_vi_v8i32(<8 x i32> %va, <8 x i1> %m, i32 zeroext %evl) {
1007 ; CHECK-LABEL: vadd_vi_v8i32:
1009 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
1010 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
1012 %elt.head = insertelement <8 x i32> poison, i32 -1, i32 0
1013 %vb = shufflevector <8 x i32> %elt.head, <8 x i32> poison, <8 x i32> zeroinitializer
1014 %v = call <8 x i32> @llvm.vp.add.v8i32(<8 x i32> %va, <8 x i32> %vb, <8 x i1> %m, i32 %evl)
1018 define <8 x i32> @vadd_vi_v8i32_unmasked(<8 x i32> %va, i32 zeroext %evl) {
1019 ; CHECK-LABEL: vadd_vi_v8i32_unmasked:
1021 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
1022 ; CHECK-NEXT: vadd.vi v8, v8, -1
1024 %elt.head = insertelement <8 x i32> poison, i32 -1, i32 0
1025 %vb = shufflevector <8 x i32> %elt.head, <8 x i32> poison, <8 x i32> zeroinitializer
1026 %head = insertelement <8 x i1> poison, i1 true, i32 0
1027 %m = shufflevector <8 x i1> %head, <8 x i1> poison, <8 x i32> zeroinitializer
1028 %v = call <8 x i32> @llvm.vp.add.v8i32(<8 x i32> %va, <8 x i32> %vb, <8 x i1> %m, i32 %evl)
1032 declare <16 x i32> @llvm.vp.add.v16i32(<16 x i32>, <16 x i32>, <16 x i1>, i32)
1034 define <16 x i32> @vadd_vv_v16i32(<16 x i32> %va, <16 x i32> %b, <16 x i1> %m, i32 zeroext %evl) {
1035 ; CHECK-LABEL: vadd_vv_v16i32:
1037 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
1038 ; CHECK-NEXT: vadd.vv v8, v8, v12, v0.t
1040 %v = call <16 x i32> @llvm.vp.add.v16i32(<16 x i32> %va, <16 x i32> %b, <16 x i1> %m, i32 %evl)
1044 define <16 x i32> @vadd_vv_v16i32_unmasked(<16 x i32> %va, <16 x i32> %b, i32 zeroext %evl) {
1045 ; CHECK-LABEL: vadd_vv_v16i32_unmasked:
1047 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
1048 ; CHECK-NEXT: vadd.vv v8, v8, v12
1050 %head = insertelement <16 x i1> poison, i1 true, i32 0
1051 %m = shufflevector <16 x i1> %head, <16 x i1> poison, <16 x i32> zeroinitializer
1052 %v = call <16 x i32> @llvm.vp.add.v16i32(<16 x i32> %va, <16 x i32> %b, <16 x i1> %m, i32 %evl)
1056 define <16 x i32> @vadd_vx_v16i32(<16 x i32> %va, i32 %b, <16 x i1> %m, i32 zeroext %evl) {
1057 ; CHECK-LABEL: vadd_vx_v16i32:
1059 ; CHECK-NEXT: vsetvli zero, a1, e32, m4, ta, ma
1060 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
1062 %elt.head = insertelement <16 x i32> poison, i32 %b, i32 0
1063 %vb = shufflevector <16 x i32> %elt.head, <16 x i32> poison, <16 x i32> zeroinitializer
1064 %v = call <16 x i32> @llvm.vp.add.v16i32(<16 x i32> %va, <16 x i32> %vb, <16 x i1> %m, i32 %evl)
1068 define <16 x i32> @vadd_vx_v16i32_unmasked(<16 x i32> %va, i32 %b, i32 zeroext %evl) {
1069 ; CHECK-LABEL: vadd_vx_v16i32_unmasked:
1071 ; CHECK-NEXT: vsetvli zero, a1, e32, m4, ta, ma
1072 ; CHECK-NEXT: vadd.vx v8, v8, a0
1074 %elt.head = insertelement <16 x i32> poison, i32 %b, i32 0
1075 %vb = shufflevector <16 x i32> %elt.head, <16 x i32> poison, <16 x i32> zeroinitializer
1076 %head = insertelement <16 x i1> poison, i1 true, i32 0
1077 %m = shufflevector <16 x i1> %head, <16 x i1> poison, <16 x i32> zeroinitializer
1078 %v = call <16 x i32> @llvm.vp.add.v16i32(<16 x i32> %va, <16 x i32> %vb, <16 x i1> %m, i32 %evl)
1082 define <16 x i32> @vadd_vi_v16i32(<16 x i32> %va, <16 x i1> %m, i32 zeroext %evl) {
1083 ; CHECK-LABEL: vadd_vi_v16i32:
1085 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
1086 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
1088 %elt.head = insertelement <16 x i32> poison, i32 -1, i32 0
1089 %vb = shufflevector <16 x i32> %elt.head, <16 x i32> poison, <16 x i32> zeroinitializer
1090 %v = call <16 x i32> @llvm.vp.add.v16i32(<16 x i32> %va, <16 x i32> %vb, <16 x i1> %m, i32 %evl)
1094 define <16 x i32> @vadd_vi_v16i32_unmasked(<16 x i32> %va, i32 zeroext %evl) {
1095 ; CHECK-LABEL: vadd_vi_v16i32_unmasked:
1097 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
1098 ; CHECK-NEXT: vadd.vi v8, v8, -1
1100 %elt.head = insertelement <16 x i32> poison, i32 -1, i32 0
1101 %vb = shufflevector <16 x i32> %elt.head, <16 x i32> poison, <16 x i32> zeroinitializer
1102 %head = insertelement <16 x i1> poison, i1 true, i32 0
1103 %m = shufflevector <16 x i1> %head, <16 x i1> poison, <16 x i32> zeroinitializer
1104 %v = call <16 x i32> @llvm.vp.add.v16i32(<16 x i32> %va, <16 x i32> %vb, <16 x i1> %m, i32 %evl)
1108 declare <2 x i64> @llvm.vp.add.v2i64(<2 x i64>, <2 x i64>, <2 x i1>, i32)
1110 define <2 x i64> @vadd_vv_v2i64(<2 x i64> %va, <2 x i64> %b, <2 x i1> %m, i32 zeroext %evl) {
1111 ; CHECK-LABEL: vadd_vv_v2i64:
1113 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
1114 ; CHECK-NEXT: vadd.vv v8, v8, v9, v0.t
1116 %v = call <2 x i64> @llvm.vp.add.v2i64(<2 x i64> %va, <2 x i64> %b, <2 x i1> %m, i32 %evl)
1120 define <2 x i64> @vadd_vv_v2i64_unmasked(<2 x i64> %va, <2 x i64> %b, i32 zeroext %evl) {
1121 ; CHECK-LABEL: vadd_vv_v2i64_unmasked:
1123 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
1124 ; CHECK-NEXT: vadd.vv v8, v8, v9
1126 %head = insertelement <2 x i1> poison, i1 true, i32 0
1127 %m = shufflevector <2 x i1> %head, <2 x i1> poison, <2 x i32> zeroinitializer
1128 %v = call <2 x i64> @llvm.vp.add.v2i64(<2 x i64> %va, <2 x i64> %b, <2 x i1> %m, i32 %evl)
1132 define <2 x i64> @vadd_vx_v2i64(<2 x i64> %va, i64 %b, <2 x i1> %m, i32 zeroext %evl) {
1133 ; RV32-LABEL: vadd_vx_v2i64:
1135 ; RV32-NEXT: addi sp, sp, -16
1136 ; RV32-NEXT: .cfi_def_cfa_offset 16
1137 ; RV32-NEXT: sw a1, 12(sp)
1138 ; RV32-NEXT: sw a0, 8(sp)
1139 ; RV32-NEXT: addi a0, sp, 8
1140 ; RV32-NEXT: vsetivli zero, 2, e64, m1, ta, ma
1141 ; RV32-NEXT: vlse64.v v9, (a0), zero
1142 ; RV32-NEXT: vsetvli zero, a2, e64, m1, ta, ma
1143 ; RV32-NEXT: vadd.vv v8, v8, v9, v0.t
1144 ; RV32-NEXT: addi sp, sp, 16
1147 ; RV64-LABEL: vadd_vx_v2i64:
1149 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
1150 ; RV64-NEXT: vadd.vx v8, v8, a0, v0.t
1152 %elt.head = insertelement <2 x i64> poison, i64 %b, i32 0
1153 %vb = shufflevector <2 x i64> %elt.head, <2 x i64> poison, <2 x i32> zeroinitializer
1154 %v = call <2 x i64> @llvm.vp.add.v2i64(<2 x i64> %va, <2 x i64> %vb, <2 x i1> %m, i32 %evl)
1158 define <2 x i64> @vadd_vx_v2i64_unmasked(<2 x i64> %va, i64 %b, i32 zeroext %evl) {
1159 ; RV32-LABEL: vadd_vx_v2i64_unmasked:
1161 ; RV32-NEXT: addi sp, sp, -16
1162 ; RV32-NEXT: .cfi_def_cfa_offset 16
1163 ; RV32-NEXT: sw a1, 12(sp)
1164 ; RV32-NEXT: sw a0, 8(sp)
1165 ; RV32-NEXT: addi a0, sp, 8
1166 ; RV32-NEXT: vsetivli zero, 2, e64, m1, ta, ma
1167 ; RV32-NEXT: vlse64.v v9, (a0), zero
1168 ; RV32-NEXT: vsetvli zero, a2, e64, m1, ta, ma
1169 ; RV32-NEXT: vadd.vv v8, v8, v9
1170 ; RV32-NEXT: addi sp, sp, 16
1173 ; RV64-LABEL: vadd_vx_v2i64_unmasked:
1175 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
1176 ; RV64-NEXT: vadd.vx v8, v8, a0
1178 %elt.head = insertelement <2 x i64> poison, i64 %b, i32 0
1179 %vb = shufflevector <2 x i64> %elt.head, <2 x i64> poison, <2 x i32> zeroinitializer
1180 %head = insertelement <2 x i1> poison, i1 true, i32 0
1181 %m = shufflevector <2 x i1> %head, <2 x i1> poison, <2 x i32> zeroinitializer
1182 %v = call <2 x i64> @llvm.vp.add.v2i64(<2 x i64> %va, <2 x i64> %vb, <2 x i1> %m, i32 %evl)
1186 define <2 x i64> @vadd_vi_v2i64(<2 x i64> %va, <2 x i1> %m, i32 zeroext %evl) {
1187 ; CHECK-LABEL: vadd_vi_v2i64:
1189 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
1190 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
1192 %elt.head = insertelement <2 x i64> poison, i64 -1, i32 0
1193 %vb = shufflevector <2 x i64> %elt.head, <2 x i64> poison, <2 x i32> zeroinitializer
1194 %v = call <2 x i64> @llvm.vp.add.v2i64(<2 x i64> %va, <2 x i64> %vb, <2 x i1> %m, i32 %evl)
1198 define <2 x i64> @vadd_vi_v2i64_unmasked(<2 x i64> %va, i32 zeroext %evl) {
1199 ; CHECK-LABEL: vadd_vi_v2i64_unmasked:
1201 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
1202 ; CHECK-NEXT: vadd.vi v8, v8, -1
1204 %elt.head = insertelement <2 x i64> poison, i64 -1, i32 0
1205 %vb = shufflevector <2 x i64> %elt.head, <2 x i64> poison, <2 x i32> zeroinitializer
1206 %head = insertelement <2 x i1> poison, i1 true, i32 0
1207 %m = shufflevector <2 x i1> %head, <2 x i1> poison, <2 x i32> zeroinitializer
1208 %v = call <2 x i64> @llvm.vp.add.v2i64(<2 x i64> %va, <2 x i64> %vb, <2 x i1> %m, i32 %evl)
1212 declare <4 x i64> @llvm.vp.add.v4i64(<4 x i64>, <4 x i64>, <4 x i1>, i32)
1214 define <4 x i64> @vadd_vv_v4i64(<4 x i64> %va, <4 x i64> %b, <4 x i1> %m, i32 zeroext %evl) {
1215 ; CHECK-LABEL: vadd_vv_v4i64:
1217 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
1218 ; CHECK-NEXT: vadd.vv v8, v8, v10, v0.t
1220 %v = call <4 x i64> @llvm.vp.add.v4i64(<4 x i64> %va, <4 x i64> %b, <4 x i1> %m, i32 %evl)
1224 define <4 x i64> @vadd_vv_v4i64_unmasked(<4 x i64> %va, <4 x i64> %b, i32 zeroext %evl) {
1225 ; CHECK-LABEL: vadd_vv_v4i64_unmasked:
1227 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
1228 ; CHECK-NEXT: vadd.vv v8, v8, v10
1230 %head = insertelement <4 x i1> poison, i1 true, i32 0
1231 %m = shufflevector <4 x i1> %head, <4 x i1> poison, <4 x i32> zeroinitializer
1232 %v = call <4 x i64> @llvm.vp.add.v4i64(<4 x i64> %va, <4 x i64> %b, <4 x i1> %m, i32 %evl)
1236 define <4 x i64> @vadd_vx_v4i64(<4 x i64> %va, i64 %b, <4 x i1> %m, i32 zeroext %evl) {
1237 ; RV32-LABEL: vadd_vx_v4i64:
1239 ; RV32-NEXT: addi sp, sp, -16
1240 ; RV32-NEXT: .cfi_def_cfa_offset 16
1241 ; RV32-NEXT: sw a1, 12(sp)
1242 ; RV32-NEXT: sw a0, 8(sp)
1243 ; RV32-NEXT: addi a0, sp, 8
1244 ; RV32-NEXT: vsetivli zero, 4, e64, m2, ta, ma
1245 ; RV32-NEXT: vlse64.v v10, (a0), zero
1246 ; RV32-NEXT: vsetvli zero, a2, e64, m2, ta, ma
1247 ; RV32-NEXT: vadd.vv v8, v8, v10, v0.t
1248 ; RV32-NEXT: addi sp, sp, 16
1251 ; RV64-LABEL: vadd_vx_v4i64:
1253 ; RV64-NEXT: vsetvli zero, a1, e64, m2, ta, ma
1254 ; RV64-NEXT: vadd.vx v8, v8, a0, v0.t
1256 %elt.head = insertelement <4 x i64> poison, i64 %b, i32 0
1257 %vb = shufflevector <4 x i64> %elt.head, <4 x i64> poison, <4 x i32> zeroinitializer
1258 %v = call <4 x i64> @llvm.vp.add.v4i64(<4 x i64> %va, <4 x i64> %vb, <4 x i1> %m, i32 %evl)
1262 define <4 x i64> @vadd_vx_v4i64_unmasked(<4 x i64> %va, i64 %b, i32 zeroext %evl) {
1263 ; RV32-LABEL: vadd_vx_v4i64_unmasked:
1265 ; RV32-NEXT: addi sp, sp, -16
1266 ; RV32-NEXT: .cfi_def_cfa_offset 16
1267 ; RV32-NEXT: sw a1, 12(sp)
1268 ; RV32-NEXT: sw a0, 8(sp)
1269 ; RV32-NEXT: addi a0, sp, 8
1270 ; RV32-NEXT: vsetivli zero, 4, e64, m2, ta, ma
1271 ; RV32-NEXT: vlse64.v v10, (a0), zero
1272 ; RV32-NEXT: vsetvli zero, a2, e64, m2, ta, ma
1273 ; RV32-NEXT: vadd.vv v8, v8, v10
1274 ; RV32-NEXT: addi sp, sp, 16
1277 ; RV64-LABEL: vadd_vx_v4i64_unmasked:
1279 ; RV64-NEXT: vsetvli zero, a1, e64, m2, ta, ma
1280 ; RV64-NEXT: vadd.vx v8, v8, a0
1282 %elt.head = insertelement <4 x i64> poison, i64 %b, i32 0
1283 %vb = shufflevector <4 x i64> %elt.head, <4 x i64> poison, <4 x i32> zeroinitializer
1284 %head = insertelement <4 x i1> poison, i1 true, i32 0
1285 %m = shufflevector <4 x i1> %head, <4 x i1> poison, <4 x i32> zeroinitializer
1286 %v = call <4 x i64> @llvm.vp.add.v4i64(<4 x i64> %va, <4 x i64> %vb, <4 x i1> %m, i32 %evl)
1290 define <4 x i64> @vadd_vi_v4i64(<4 x i64> %va, <4 x i1> %m, i32 zeroext %evl) {
1291 ; CHECK-LABEL: vadd_vi_v4i64:
1293 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
1294 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
1296 %elt.head = insertelement <4 x i64> poison, i64 -1, i32 0
1297 %vb = shufflevector <4 x i64> %elt.head, <4 x i64> poison, <4 x i32> zeroinitializer
1298 %v = call <4 x i64> @llvm.vp.add.v4i64(<4 x i64> %va, <4 x i64> %vb, <4 x i1> %m, i32 %evl)
1302 define <4 x i64> @vadd_vi_v4i64_unmasked(<4 x i64> %va, i32 zeroext %evl) {
1303 ; CHECK-LABEL: vadd_vi_v4i64_unmasked:
1305 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
1306 ; CHECK-NEXT: vadd.vi v8, v8, -1
1308 %elt.head = insertelement <4 x i64> poison, i64 -1, i32 0
1309 %vb = shufflevector <4 x i64> %elt.head, <4 x i64> poison, <4 x i32> zeroinitializer
1310 %head = insertelement <4 x i1> poison, i1 true, i32 0
1311 %m = shufflevector <4 x i1> %head, <4 x i1> poison, <4 x i32> zeroinitializer
1312 %v = call <4 x i64> @llvm.vp.add.v4i64(<4 x i64> %va, <4 x i64> %vb, <4 x i1> %m, i32 %evl)
1316 declare <8 x i64> @llvm.vp.add.v8i64(<8 x i64>, <8 x i64>, <8 x i1>, i32)
1318 define <8 x i64> @vadd_vv_v8i64(<8 x i64> %va, <8 x i64> %b, <8 x i1> %m, i32 zeroext %evl) {
1319 ; CHECK-LABEL: vadd_vv_v8i64:
1321 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
1322 ; CHECK-NEXT: vadd.vv v8, v8, v12, v0.t
1324 %v = call <8 x i64> @llvm.vp.add.v8i64(<8 x i64> %va, <8 x i64> %b, <8 x i1> %m, i32 %evl)
1328 define <8 x i64> @vadd_vv_v8i64_unmasked(<8 x i64> %va, <8 x i64> %b, i32 zeroext %evl) {
1329 ; CHECK-LABEL: vadd_vv_v8i64_unmasked:
1331 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
1332 ; CHECK-NEXT: vadd.vv v8, v8, v12
1334 %head = insertelement <8 x i1> poison, i1 true, i32 0
1335 %m = shufflevector <8 x i1> %head, <8 x i1> poison, <8 x i32> zeroinitializer
1336 %v = call <8 x i64> @llvm.vp.add.v8i64(<8 x i64> %va, <8 x i64> %b, <8 x i1> %m, i32 %evl)
1340 define <8 x i64> @vadd_vx_v8i64(<8 x i64> %va, i64 %b, <8 x i1> %m, i32 zeroext %evl) {
1341 ; RV32-LABEL: vadd_vx_v8i64:
1343 ; RV32-NEXT: addi sp, sp, -16
1344 ; RV32-NEXT: .cfi_def_cfa_offset 16
1345 ; RV32-NEXT: sw a1, 12(sp)
1346 ; RV32-NEXT: sw a0, 8(sp)
1347 ; RV32-NEXT: addi a0, sp, 8
1348 ; RV32-NEXT: vsetivli zero, 8, e64, m4, ta, ma
1349 ; RV32-NEXT: vlse64.v v12, (a0), zero
1350 ; RV32-NEXT: vsetvli zero, a2, e64, m4, ta, ma
1351 ; RV32-NEXT: vadd.vv v8, v8, v12, v0.t
1352 ; RV32-NEXT: addi sp, sp, 16
1355 ; RV64-LABEL: vadd_vx_v8i64:
1357 ; RV64-NEXT: vsetvli zero, a1, e64, m4, ta, ma
1358 ; RV64-NEXT: vadd.vx v8, v8, a0, v0.t
1360 %elt.head = insertelement <8 x i64> poison, i64 %b, i32 0
1361 %vb = shufflevector <8 x i64> %elt.head, <8 x i64> poison, <8 x i32> zeroinitializer
1362 %v = call <8 x i64> @llvm.vp.add.v8i64(<8 x i64> %va, <8 x i64> %vb, <8 x i1> %m, i32 %evl)
1366 define <8 x i64> @vadd_vx_v8i64_unmasked(<8 x i64> %va, i64 %b, i32 zeroext %evl) {
1367 ; RV32-LABEL: vadd_vx_v8i64_unmasked:
1369 ; RV32-NEXT: addi sp, sp, -16
1370 ; RV32-NEXT: .cfi_def_cfa_offset 16
1371 ; RV32-NEXT: sw a1, 12(sp)
1372 ; RV32-NEXT: sw a0, 8(sp)
1373 ; RV32-NEXT: addi a0, sp, 8
1374 ; RV32-NEXT: vsetivli zero, 8, e64, m4, ta, ma
1375 ; RV32-NEXT: vlse64.v v12, (a0), zero
1376 ; RV32-NEXT: vsetvli zero, a2, e64, m4, ta, ma
1377 ; RV32-NEXT: vadd.vv v8, v8, v12
1378 ; RV32-NEXT: addi sp, sp, 16
1381 ; RV64-LABEL: vadd_vx_v8i64_unmasked:
1383 ; RV64-NEXT: vsetvli zero, a1, e64, m4, ta, ma
1384 ; RV64-NEXT: vadd.vx v8, v8, a0
1386 %elt.head = insertelement <8 x i64> poison, i64 %b, i32 0
1387 %vb = shufflevector <8 x i64> %elt.head, <8 x i64> poison, <8 x i32> zeroinitializer
1388 %head = insertelement <8 x i1> poison, i1 true, i32 0
1389 %m = shufflevector <8 x i1> %head, <8 x i1> poison, <8 x i32> zeroinitializer
1390 %v = call <8 x i64> @llvm.vp.add.v8i64(<8 x i64> %va, <8 x i64> %vb, <8 x i1> %m, i32 %evl)
1394 define <8 x i64> @vadd_vi_v8i64(<8 x i64> %va, <8 x i1> %m, i32 zeroext %evl) {
1395 ; CHECK-LABEL: vadd_vi_v8i64:
1397 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
1398 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
1400 %elt.head = insertelement <8 x i64> poison, i64 -1, i32 0
1401 %vb = shufflevector <8 x i64> %elt.head, <8 x i64> poison, <8 x i32> zeroinitializer
1402 %v = call <8 x i64> @llvm.vp.add.v8i64(<8 x i64> %va, <8 x i64> %vb, <8 x i1> %m, i32 %evl)
1406 define <8 x i64> @vadd_vi_v8i64_unmasked(<8 x i64> %va, i32 zeroext %evl) {
1407 ; CHECK-LABEL: vadd_vi_v8i64_unmasked:
1409 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
1410 ; CHECK-NEXT: vadd.vi v8, v8, -1
1412 %elt.head = insertelement <8 x i64> poison, i64 -1, i32 0
1413 %vb = shufflevector <8 x i64> %elt.head, <8 x i64> poison, <8 x i32> zeroinitializer
1414 %head = insertelement <8 x i1> poison, i1 true, i32 0
1415 %m = shufflevector <8 x i1> %head, <8 x i1> poison, <8 x i32> zeroinitializer
1416 %v = call <8 x i64> @llvm.vp.add.v8i64(<8 x i64> %va, <8 x i64> %vb, <8 x i1> %m, i32 %evl)
1420 declare <16 x i64> @llvm.vp.add.v16i64(<16 x i64>, <16 x i64>, <16 x i1>, i32)
1422 define <16 x i64> @vadd_vv_v16i64(<16 x i64> %va, <16 x i64> %b, <16 x i1> %m, i32 zeroext %evl) {
1423 ; CHECK-LABEL: vadd_vv_v16i64:
1425 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1426 ; CHECK-NEXT: vadd.vv v8, v8, v16, v0.t
1428 %v = call <16 x i64> @llvm.vp.add.v16i64(<16 x i64> %va, <16 x i64> %b, <16 x i1> %m, i32 %evl)
1432 define <16 x i64> @vadd_vv_v16i64_unmasked(<16 x i64> %va, <16 x i64> %b, i32 zeroext %evl) {
1433 ; CHECK-LABEL: vadd_vv_v16i64_unmasked:
1435 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1436 ; CHECK-NEXT: vadd.vv v8, v8, v16
1438 %head = insertelement <16 x i1> poison, i1 true, i32 0
1439 %m = shufflevector <16 x i1> %head, <16 x i1> poison, <16 x i32> zeroinitializer
1440 %v = call <16 x i64> @llvm.vp.add.v16i64(<16 x i64> %va, <16 x i64> %b, <16 x i1> %m, i32 %evl)
1444 define <16 x i64> @vadd_vx_v16i64(<16 x i64> %va, i64 %b, <16 x i1> %m, i32 zeroext %evl) {
1445 ; RV32-LABEL: vadd_vx_v16i64:
1447 ; RV32-NEXT: addi sp, sp, -16
1448 ; RV32-NEXT: .cfi_def_cfa_offset 16
1449 ; RV32-NEXT: sw a1, 12(sp)
1450 ; RV32-NEXT: sw a0, 8(sp)
1451 ; RV32-NEXT: addi a0, sp, 8
1452 ; RV32-NEXT: vsetivli zero, 16, e64, m8, ta, ma
1453 ; RV32-NEXT: vlse64.v v16, (a0), zero
1454 ; RV32-NEXT: vsetvli zero, a2, e64, m8, ta, ma
1455 ; RV32-NEXT: vadd.vv v8, v8, v16, v0.t
1456 ; RV32-NEXT: addi sp, sp, 16
1459 ; RV64-LABEL: vadd_vx_v16i64:
1461 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1462 ; RV64-NEXT: vadd.vx v8, v8, a0, v0.t
1464 %elt.head = insertelement <16 x i64> poison, i64 %b, i32 0
1465 %vb = shufflevector <16 x i64> %elt.head, <16 x i64> poison, <16 x i32> zeroinitializer
1466 %v = call <16 x i64> @llvm.vp.add.v16i64(<16 x i64> %va, <16 x i64> %vb, <16 x i1> %m, i32 %evl)
1470 define <16 x i64> @vadd_vx_v16i64_unmasked(<16 x i64> %va, i64 %b, i32 zeroext %evl) {
1471 ; RV32-LABEL: vadd_vx_v16i64_unmasked:
1473 ; RV32-NEXT: addi sp, sp, -16
1474 ; RV32-NEXT: .cfi_def_cfa_offset 16
1475 ; RV32-NEXT: sw a1, 12(sp)
1476 ; RV32-NEXT: sw a0, 8(sp)
1477 ; RV32-NEXT: addi a0, sp, 8
1478 ; RV32-NEXT: vsetivli zero, 16, e64, m8, ta, ma
1479 ; RV32-NEXT: vlse64.v v16, (a0), zero
1480 ; RV32-NEXT: vsetvli zero, a2, e64, m8, ta, ma
1481 ; RV32-NEXT: vadd.vv v8, v8, v16
1482 ; RV32-NEXT: addi sp, sp, 16
1485 ; RV64-LABEL: vadd_vx_v16i64_unmasked:
1487 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1488 ; RV64-NEXT: vadd.vx v8, v8, a0
1490 %elt.head = insertelement <16 x i64> poison, i64 %b, i32 0
1491 %vb = shufflevector <16 x i64> %elt.head, <16 x i64> poison, <16 x i32> zeroinitializer
1492 %head = insertelement <16 x i1> poison, i1 true, i32 0
1493 %m = shufflevector <16 x i1> %head, <16 x i1> poison, <16 x i32> zeroinitializer
1494 %v = call <16 x i64> @llvm.vp.add.v16i64(<16 x i64> %va, <16 x i64> %vb, <16 x i1> %m, i32 %evl)
1498 define <16 x i64> @vadd_vi_v16i64(<16 x i64> %va, <16 x i1> %m, i32 zeroext %evl) {
1499 ; CHECK-LABEL: vadd_vi_v16i64:
1501 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1502 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
1504 %elt.head = insertelement <16 x i64> poison, i64 -1, i32 0
1505 %vb = shufflevector <16 x i64> %elt.head, <16 x i64> poison, <16 x i32> zeroinitializer
1506 %v = call <16 x i64> @llvm.vp.add.v16i64(<16 x i64> %va, <16 x i64> %vb, <16 x i1> %m, i32 %evl)
1510 define <16 x i64> @vadd_vi_v16i64_unmasked(<16 x i64> %va, i32 zeroext %evl) {
1511 ; CHECK-LABEL: vadd_vi_v16i64_unmasked:
1513 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1514 ; CHECK-NEXT: vadd.vi v8, v8, -1
1516 %elt.head = insertelement <16 x i64> poison, i64 -1, i32 0
1517 %vb = shufflevector <16 x i64> %elt.head, <16 x i64> poison, <16 x i32> zeroinitializer
1518 %head = insertelement <16 x i1> poison, i1 true, i32 0
1519 %m = shufflevector <16 x i1> %head, <16 x i1> poison, <16 x i32> zeroinitializer
1520 %v = call <16 x i64> @llvm.vp.add.v16i64(<16 x i64> %va, <16 x i64> %vb, <16 x i1> %m, i32 %evl)
1524 ; Test that split-legalization works as expected.
1526 declare <32 x i64> @llvm.vp.add.v32i64(<32 x i64>, <32 x i64>, <32 x i1>, i32)
1528 define <32 x i64> @vadd_vx_v32i64(<32 x i64> %va, <32 x i1> %m, i32 zeroext %evl) {
1529 ; RV32-LABEL: vadd_vx_v32i64:
1531 ; RV32-NEXT: vsetivli zero, 2, e8, mf4, ta, ma
1532 ; RV32-NEXT: vslidedown.vi v1, v0, 2
1533 ; RV32-NEXT: li a1, 32
1534 ; RV32-NEXT: vsetvli zero, a1, e32, m8, ta, ma
1535 ; RV32-NEXT: li a2, 16
1536 ; RV32-NEXT: vmv.v.i v24, -1
1537 ; RV32-NEXT: mv a1, a0
1538 ; RV32-NEXT: bltu a0, a2, .LBB108_2
1539 ; RV32-NEXT: # %bb.1:
1540 ; RV32-NEXT: li a1, 16
1541 ; RV32-NEXT: .LBB108_2:
1542 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1543 ; RV32-NEXT: vadd.vv v8, v8, v24, v0.t
1544 ; RV32-NEXT: addi a1, a0, -16
1545 ; RV32-NEXT: sltu a0, a0, a1
1546 ; RV32-NEXT: addi a0, a0, -1
1547 ; RV32-NEXT: and a0, a0, a1
1548 ; RV32-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1549 ; RV32-NEXT: vmv1r.v v0, v1
1550 ; RV32-NEXT: vadd.vv v16, v16, v24, v0.t
1553 ; RV64-LABEL: vadd_vx_v32i64:
1555 ; RV64-NEXT: vsetivli zero, 2, e8, mf4, ta, ma
1556 ; RV64-NEXT: li a2, 16
1557 ; RV64-NEXT: vslidedown.vi v24, v0, 2
1558 ; RV64-NEXT: mv a1, a0
1559 ; RV64-NEXT: bltu a0, a2, .LBB108_2
1560 ; RV64-NEXT: # %bb.1:
1561 ; RV64-NEXT: li a1, 16
1562 ; RV64-NEXT: .LBB108_2:
1563 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1564 ; RV64-NEXT: vadd.vi v8, v8, -1, v0.t
1565 ; RV64-NEXT: addi a1, a0, -16
1566 ; RV64-NEXT: sltu a0, a0, a1
1567 ; RV64-NEXT: addi a0, a0, -1
1568 ; RV64-NEXT: and a0, a0, a1
1569 ; RV64-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1570 ; RV64-NEXT: vmv1r.v v0, v24
1571 ; RV64-NEXT: vadd.vi v16, v16, -1, v0.t
1573 %elt.head = insertelement <32 x i64> poison, i64 -1, i32 0
1574 %vb = shufflevector <32 x i64> %elt.head, <32 x i64> poison, <32 x i32> zeroinitializer
1575 %v = call <32 x i64> @llvm.vp.add.v32i64(<32 x i64> %va, <32 x i64> %vb, <32 x i1> %m, i32 %evl)
1579 define <32 x i64> @vadd_vi_v32i64_unmasked(<32 x i64> %va, i32 zeroext %evl) {
1580 ; RV32-LABEL: vadd_vi_v32i64_unmasked:
1582 ; RV32-NEXT: li a1, 32
1583 ; RV32-NEXT: vsetvli zero, a1, e32, m8, ta, ma
1584 ; RV32-NEXT: li a2, 16
1585 ; RV32-NEXT: vmv.v.i v24, -1
1586 ; RV32-NEXT: mv a1, a0
1587 ; RV32-NEXT: bltu a0, a2, .LBB109_2
1588 ; RV32-NEXT: # %bb.1:
1589 ; RV32-NEXT: li a1, 16
1590 ; RV32-NEXT: .LBB109_2:
1591 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1592 ; RV32-NEXT: vadd.vv v8, v8, v24
1593 ; RV32-NEXT: addi a1, a0, -16
1594 ; RV32-NEXT: sltu a0, a0, a1
1595 ; RV32-NEXT: addi a0, a0, -1
1596 ; RV32-NEXT: and a0, a0, a1
1597 ; RV32-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1598 ; RV32-NEXT: vadd.vv v16, v16, v24
1601 ; RV64-LABEL: vadd_vi_v32i64_unmasked:
1603 ; RV64-NEXT: li a2, 16
1604 ; RV64-NEXT: mv a1, a0
1605 ; RV64-NEXT: bltu a0, a2, .LBB109_2
1606 ; RV64-NEXT: # %bb.1:
1607 ; RV64-NEXT: li a1, 16
1608 ; RV64-NEXT: .LBB109_2:
1609 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1610 ; RV64-NEXT: vadd.vi v8, v8, -1
1611 ; RV64-NEXT: addi a1, a0, -16
1612 ; RV64-NEXT: sltu a0, a0, a1
1613 ; RV64-NEXT: addi a0, a0, -1
1614 ; RV64-NEXT: and a0, a0, a1
1615 ; RV64-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1616 ; RV64-NEXT: vadd.vi v16, v16, -1
1618 %elt.head = insertelement <32 x i64> poison, i64 -1, i32 0
1619 %vb = shufflevector <32 x i64> %elt.head, <32 x i64> poison, <32 x i32> zeroinitializer
1620 %head = insertelement <32 x i1> poison, i1 true, i32 0
1621 %m = shufflevector <32 x i1> %head, <32 x i1> poison, <32 x i32> zeroinitializer
1622 %v = call <32 x i64> @llvm.vp.add.v32i64(<32 x i64> %va, <32 x i64> %vb, <32 x i1> %m, i32 %evl)
1626 ; FIXME: We don't match vadd.vi on RV32.
1628 define <32 x i64> @vadd_vx_v32i64_evl12(<32 x i64> %va, <32 x i1> %m) {
1629 ; RV32-LABEL: vadd_vx_v32i64_evl12:
1631 ; RV32-NEXT: li a0, 32
1632 ; RV32-NEXT: vsetvli zero, a0, e32, m8, ta, ma
1633 ; RV32-NEXT: vmv.v.i v16, -1
1634 ; RV32-NEXT: vsetivli zero, 12, e64, m8, ta, ma
1635 ; RV32-NEXT: vadd.vv v8, v8, v16, v0.t
1638 ; RV64-LABEL: vadd_vx_v32i64_evl12:
1640 ; RV64-NEXT: vsetivli zero, 12, e64, m8, ta, ma
1641 ; RV64-NEXT: vadd.vi v8, v8, -1, v0.t
1643 %elt.head = insertelement <32 x i64> poison, i64 -1, i32 0
1644 %vb = shufflevector <32 x i64> %elt.head, <32 x i64> poison, <32 x i32> zeroinitializer
1645 %v = call <32 x i64> @llvm.vp.add.v32i64(<32 x i64> %va, <32 x i64> %vb, <32 x i1> %m, i32 12)
1649 define <32 x i64> @vadd_vx_v32i64_evl27(<32 x i64> %va, <32 x i1> %m) {
1650 ; RV32-LABEL: vadd_vx_v32i64_evl27:
1652 ; RV32-NEXT: vsetivli zero, 2, e8, mf4, ta, ma
1653 ; RV32-NEXT: vslidedown.vi v1, v0, 2
1654 ; RV32-NEXT: li a0, 32
1655 ; RV32-NEXT: vsetvli zero, a0, e32, m8, ta, ma
1656 ; RV32-NEXT: vmv.v.i v24, -1
1657 ; RV32-NEXT: vsetivli zero, 16, e64, m8, ta, ma
1658 ; RV32-NEXT: vadd.vv v8, v8, v24, v0.t
1659 ; RV32-NEXT: vsetivli zero, 11, e64, m8, ta, ma
1660 ; RV32-NEXT: vmv1r.v v0, v1
1661 ; RV32-NEXT: vadd.vv v16, v16, v24, v0.t
1664 ; RV64-LABEL: vadd_vx_v32i64_evl27:
1666 ; RV64-NEXT: vsetivli zero, 2, e8, mf4, ta, ma
1667 ; RV64-NEXT: vslidedown.vi v24, v0, 2
1668 ; RV64-NEXT: vsetivli zero, 16, e64, m8, ta, ma
1669 ; RV64-NEXT: vadd.vi v8, v8, -1, v0.t
1670 ; RV64-NEXT: vsetivli zero, 11, e64, m8, ta, ma
1671 ; RV64-NEXT: vmv1r.v v0, v24
1672 ; RV64-NEXT: vadd.vi v16, v16, -1, v0.t
1674 %elt.head = insertelement <32 x i64> poison, i64 -1, i32 0
1675 %vb = shufflevector <32 x i64> %elt.head, <32 x i64> poison, <32 x i32> zeroinitializer
1676 %v = call <32 x i64> @llvm.vp.add.v32i64(<32 x i64> %va, <32 x i64> %vb, <32 x i1> %m, i32 27)