1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mattr=+sve2 < %s | FileCheck %s
3 ; RUN: llc -mattr=+sme -force-streaming < %s | FileCheck %s
5 target triple = "aarch64-unknown-linux-gnu"
11 ; Cannot invert the while predicate when %a is MAX_INT.
12 define <vscale x 16 x i1> @whilege_b_ww(i32 %a, i32 %b) {
13 ; CHECK-LABEL: whilege_b_ww:
15 ; CHECK-NEXT: whilele p0.b, w1, w0
16 ; CHECK-NEXT: rev p0.b, p0.b
18 %while = call <vscale x 16 x i1> @llvm.aarch64.sve.whilele.nxv16i1.i32(i32 %b, i32 %a)
19 %while.rev = call <vscale x 16 x i1> @llvm.vector.reverse.nxv16i1(<vscale x 16 x i1> %while)
20 ret <vscale x 16 x i1> %while.rev
23 ; Cannot invert the while predicate when %a is MAX_INT.
24 define <vscale x 16 x i1> @whilege_b_xx(i64 %a, i64 %b) {
25 ; CHECK-LABEL: whilege_b_xx:
27 ; CHECK-NEXT: whilele p0.b, x1, x0
28 ; CHECK-NEXT: rev p0.b, p0.b
30 %while = call <vscale x 16 x i1> @llvm.aarch64.sve.whilele.nxv16i1.i64(i64 %b, i64 %a)
31 %while.rev = call <vscale x 16 x i1> @llvm.vector.reverse.nxv16i1(<vscale x 16 x i1> %while)
32 ret <vscale x 16 x i1> %while.rev
35 ; Cannot invert the while predicate when %a is MAX_INT.
36 define <vscale x 8 x i1> @whilege_h_ww(i32 %a, i32 %b) {
37 ; CHECK-LABEL: whilege_h_ww:
39 ; CHECK-NEXT: whilele p0.h, w1, w0
40 ; CHECK-NEXT: rev p0.h, p0.h
42 %while = call <vscale x 8 x i1> @llvm.aarch64.sve.whilele.nxv8i1.i32(i32 %b, i32 %a)
43 %while.rev = call <vscale x 8 x i1> @llvm.vector.reverse.nxv8i1(<vscale x 8 x i1> %while)
44 ret <vscale x 8 x i1> %while.rev
47 ; Cannot invert the while predicate when %a is MAX_INT.
48 define <vscale x 8 x i1> @whilege_h_xx(i64 %a, i64 %b) {
49 ; CHECK-LABEL: whilege_h_xx:
51 ; CHECK-NEXT: whilele p0.h, x1, x0
52 ; CHECK-NEXT: rev p0.h, p0.h
54 %while = call <vscale x 8 x i1> @llvm.aarch64.sve.whilele.nxv8i1.i64(i64 %b, i64 %a)
55 %while.rev = call <vscale x 8 x i1> @llvm.vector.reverse.nxv8i1(<vscale x 8 x i1> %while)
56 ret <vscale x 8 x i1> %while.rev
59 ; Cannot invert the while predicate when %a is MAX_INT.
60 define <vscale x 4 x i1> @whilege_s_ww(i32 %a, i32 %b) {
61 ; CHECK-LABEL: whilege_s_ww:
63 ; CHECK-NEXT: whilele p0.s, w1, w0
64 ; CHECK-NEXT: rev p0.s, p0.s
66 %while = call <vscale x 4 x i1> @llvm.aarch64.sve.whilele.nxv4i1.i32(i32 %b, i32 %a)
67 %while.rev = call <vscale x 4 x i1> @llvm.vector.reverse.nxv4i1(<vscale x 4 x i1> %while)
68 ret <vscale x 4 x i1> %while.rev
71 ; Cannot invert the while predicate when %a is MAX_INT.
72 define <vscale x 4 x i1> @whilege_s_xx(i64 %a, i64 %b) {
73 ; CHECK-LABEL: whilege_s_xx:
75 ; CHECK-NEXT: whilele p0.s, x1, x0
76 ; CHECK-NEXT: rev p0.s, p0.s
78 %while = call <vscale x 4 x i1> @llvm.aarch64.sve.whilele.nxv4i1.i64(i64 %b, i64 %a)
79 %while.rev = call <vscale x 4 x i1> @llvm.vector.reverse.nxv4i1(<vscale x 4 x i1> %while)
80 ret <vscale x 4 x i1> %while.rev
83 ; Cannot invert the while predicate when %a is MAX_INT.
84 define <vscale x 2 x i1> @whilege_d_ww(i32 %a, i32 %b) {
85 ; CHECK-LABEL: whilege_d_ww:
87 ; CHECK-NEXT: whilele p0.d, w1, w0
88 ; CHECK-NEXT: rev p0.d, p0.d
90 %while = call <vscale x 2 x i1> @llvm.aarch64.sve.whilele.nxv2i1.i32(i32 %b, i32 %a)
91 %while.rev = call <vscale x 2 x i1> @llvm.vector.reverse.nxv2i1(<vscale x 2 x i1> %while)
92 ret <vscale x 2 x i1> %while.rev
95 ; Cannot invert the while predicate when %a is MAX_INT.
96 define <vscale x 2 x i1> @whilege_d_xx(i64 %a, i64 %b) {
97 ; CHECK-LABEL: whilege_d_xx:
99 ; CHECK-NEXT: whilele p0.d, x1, x0
100 ; CHECK-NEXT: rev p0.d, p0.d
102 %while = call <vscale x 2 x i1> @llvm.aarch64.sve.whilele.nxv2i1.i64(i64 %b, i64 %a)
103 %while.rev = call <vscale x 2 x i1> @llvm.vector.reverse.nxv2i1(<vscale x 2 x i1> %while)
104 ret <vscale x 2 x i1> %while.rev
111 ; Cannot invert the while predicate when %a is MAX_UINT.
112 define <vscale x 16 x i1> @whilehs_b_ww(i32 %a, i32 %b) {
113 ; CHECK-LABEL: whilehs_b_ww:
115 ; CHECK-NEXT: whilels p0.b, w1, w0
116 ; CHECK-NEXT: rev p0.b, p0.b
118 %while = call <vscale x 16 x i1> @llvm.aarch64.sve.whilels.nxv16i1.i32(i32 %b, i32 %a)
119 %while.rev = call <vscale x 16 x i1> @llvm.vector.reverse.nxv16i1(<vscale x 16 x i1> %while)
120 ret <vscale x 16 x i1> %while.rev
123 ; Cannot invert the while predicate when %a is MAX_UINT.
124 define <vscale x 16 x i1> @whilehs_b_xx(i64 %a, i64 %b) {
125 ; CHECK-LABEL: whilehs_b_xx:
127 ; CHECK-NEXT: whilels p0.b, x1, x0
128 ; CHECK-NEXT: rev p0.b, p0.b
130 %while = call <vscale x 16 x i1> @llvm.aarch64.sve.whilels.nxv16i1.i64(i64 %b, i64 %a)
131 %while.rev = call <vscale x 16 x i1> @llvm.vector.reverse.nxv16i1(<vscale x 16 x i1> %while)
132 ret <vscale x 16 x i1> %while.rev
135 ; Cannot invert the while predicate when %a is MAX_UINT.
136 define <vscale x 8 x i1> @whilehs_h_ww(i32 %a, i32 %b) {
137 ; CHECK-LABEL: whilehs_h_ww:
139 ; CHECK-NEXT: whilels p0.h, w1, w0
140 ; CHECK-NEXT: rev p0.h, p0.h
142 %while = call <vscale x 8 x i1> @llvm.aarch64.sve.whilels.nxv8i1.i32(i32 %b, i32 %a)
143 %while.rev = call <vscale x 8 x i1> @llvm.vector.reverse.nxv8i1(<vscale x 8 x i1> %while)
144 ret <vscale x 8 x i1> %while.rev
147 ; Cannot invert the while predicate when %a is MAX_UINT.
148 define <vscale x 8 x i1> @whilehs_h_xx(i64 %a, i64 %b) {
149 ; CHECK-LABEL: whilehs_h_xx:
151 ; CHECK-NEXT: whilels p0.h, x1, x0
152 ; CHECK-NEXT: rev p0.h, p0.h
154 %while = call <vscale x 8 x i1> @llvm.aarch64.sve.whilels.nxv8i1.i64(i64 %b, i64 %a)
155 %while.rev = call <vscale x 8 x i1> @llvm.vector.reverse.nxv8i1(<vscale x 8 x i1> %while)
156 ret <vscale x 8 x i1> %while.rev
159 ; Cannot invert the while predicate when %a is MAX_UINT.
160 define <vscale x 4 x i1> @whilehs_s_ww(i32 %a, i32 %b) {
161 ; CHECK-LABEL: whilehs_s_ww:
163 ; CHECK-NEXT: whilels p0.s, w1, w0
164 ; CHECK-NEXT: rev p0.s, p0.s
166 %while = call <vscale x 4 x i1> @llvm.aarch64.sve.whilels.nxv4i1.i32(i32 %b, i32 %a)
167 %while.rev = call <vscale x 4 x i1> @llvm.vector.reverse.nxv4i1(<vscale x 4 x i1> %while)
168 ret <vscale x 4 x i1> %while.rev
171 ; Cannot invert the while predicate when %a is MAX_UINT.
172 define <vscale x 4 x i1> @whilehs_s_xx(i64 %a, i64 %b) {
173 ; CHECK-LABEL: whilehs_s_xx:
175 ; CHECK-NEXT: whilels p0.s, x1, x0
176 ; CHECK-NEXT: rev p0.s, p0.s
178 %while = call <vscale x 4 x i1> @llvm.aarch64.sve.whilels.nxv4i1.i64(i64 %b, i64 %a)
179 %while.rev = call <vscale x 4 x i1> @llvm.vector.reverse.nxv4i1(<vscale x 4 x i1> %while)
180 ret <vscale x 4 x i1> %while.rev
183 ; Cannot invert the while predicate when %a is MAX_UINT.
184 define <vscale x 2 x i1> @whilehs_d_ww(i32 %a, i32 %b) {
185 ; CHECK-LABEL: whilehs_d_ww:
187 ; CHECK-NEXT: whilels p0.d, w1, w0
188 ; CHECK-NEXT: rev p0.d, p0.d
190 %while = call <vscale x 2 x i1> @llvm.aarch64.sve.whilels.nxv2i1.i32(i32 %b, i32 %a)
191 %while.rev = call <vscale x 2 x i1> @llvm.vector.reverse.nxv2i1(<vscale x 2 x i1> %while)
192 ret <vscale x 2 x i1> %while.rev
195 ; Cannot invert the while predicate when %a is MAX_UINT.
196 define <vscale x 2 x i1> @whilehs_d_xx(i64 %a, i64 %b) {
197 ; CHECK-LABEL: whilehs_d_xx:
199 ; CHECK-NEXT: whilels p0.d, x1, x0
200 ; CHECK-NEXT: rev p0.d, p0.d
202 %while = call <vscale x 2 x i1> @llvm.aarch64.sve.whilels.nxv2i1.i64(i64 %b, i64 %a)
203 %while.rev = call <vscale x 2 x i1> @llvm.vector.reverse.nxv2i1(<vscale x 2 x i1> %while)
204 ret <vscale x 2 x i1> %while.rev
211 define <vscale x 16 x i1> @whilegt_b_ww(i32 %a, i32 %b) {
212 ; CHECK-LABEL: whilegt_b_ww:
214 ; CHECK-NEXT: whilegt p0.b, w0, w1
216 %while = call <vscale x 16 x i1> @llvm.aarch64.sve.whilelt.nxv16i1.i32(i32 %b, i32 %a)
217 %while.rev = call <vscale x 16 x i1> @llvm.vector.reverse.nxv16i1(<vscale x 16 x i1> %while)
218 ret <vscale x 16 x i1> %while.rev
221 define <vscale x 16 x i1> @whilegt_b_xx(i64 %a, i64 %b) {
222 ; CHECK-LABEL: whilegt_b_xx:
224 ; CHECK-NEXT: whilegt p0.b, x0, x1
226 %while = call <vscale x 16 x i1> @llvm.aarch64.sve.whilelt.nxv16i1.i64(i64 %b, i64 %a)
227 %while.rev = call <vscale x 16 x i1> @llvm.vector.reverse.nxv16i1(<vscale x 16 x i1> %while)
228 ret <vscale x 16 x i1> %while.rev
231 define <vscale x 8 x i1> @whilegt_h_ww(i32 %a, i32 %b) {
232 ; CHECK-LABEL: whilegt_h_ww:
234 ; CHECK-NEXT: whilegt p0.h, w0, w1
236 %while = call <vscale x 8 x i1> @llvm.aarch64.sve.whilelt.nxv8i1.i32(i32 %b, i32 %a)
237 %while.rev = call <vscale x 8 x i1> @llvm.vector.reverse.nxv8i1(<vscale x 8 x i1> %while)
238 ret <vscale x 8 x i1> %while.rev
241 define <vscale x 8 x i1> @whilegt_h_xx(i64 %a, i64 %b) {
242 ; CHECK-LABEL: whilegt_h_xx:
244 ; CHECK-NEXT: whilegt p0.h, x0, x1
246 %while = call <vscale x 8 x i1> @llvm.aarch64.sve.whilelt.nxv8i1.i64(i64 %b, i64 %a)
247 %while.rev = call <vscale x 8 x i1> @llvm.vector.reverse.nxv8i1(<vscale x 8 x i1> %while)
248 ret <vscale x 8 x i1> %while.rev
251 define <vscale x 4 x i1> @whilegt_s_ww(i32 %a, i32 %b) {
252 ; CHECK-LABEL: whilegt_s_ww:
254 ; CHECK-NEXT: whilegt p0.s, w0, w1
256 %while = call <vscale x 4 x i1> @llvm.aarch64.sve.whilelt.nxv4i1.i32(i32 %b, i32 %a)
257 %while.rev = call <vscale x 4 x i1> @llvm.vector.reverse.nxv4i1(<vscale x 4 x i1> %while)
258 ret <vscale x 4 x i1> %while.rev
261 define <vscale x 4 x i1> @whilegt_s_xx(i64 %a, i64 %b) {
262 ; CHECK-LABEL: whilegt_s_xx:
264 ; CHECK-NEXT: whilegt p0.s, x0, x1
266 %while = call <vscale x 4 x i1> @llvm.aarch64.sve.whilelt.nxv4i1.i64(i64 %b, i64 %a)
267 %while.rev = call <vscale x 4 x i1> @llvm.vector.reverse.nxv4i1(<vscale x 4 x i1> %while)
268 ret <vscale x 4 x i1> %while.rev
271 define <vscale x 2 x i1> @whilegt_d_ww(i32 %a, i32 %b) {
272 ; CHECK-LABEL: whilegt_d_ww:
274 ; CHECK-NEXT: whilegt p0.d, w0, w1
276 %while = call <vscale x 2 x i1> @llvm.aarch64.sve.whilelt.nxv2i1.i32(i32 %b, i32 %a)
277 %while.rev = call <vscale x 2 x i1> @llvm.vector.reverse.nxv2i1(<vscale x 2 x i1> %while)
278 ret <vscale x 2 x i1> %while.rev
281 define <vscale x 2 x i1> @whilegt_d_xx(i64 %a, i64 %b) {
282 ; CHECK-LABEL: whilegt_d_xx:
284 ; CHECK-NEXT: whilegt p0.d, x0, x1
286 %while = call <vscale x 2 x i1> @llvm.aarch64.sve.whilelt.nxv2i1.i64(i64 %b, i64 %a)
287 %while.rev = call <vscale x 2 x i1> @llvm.vector.reverse.nxv2i1(<vscale x 2 x i1> %while)
288 ret <vscale x 2 x i1> %while.rev
295 define <vscale x 16 x i1> @whilehi_b_ww(i32 %a, i32 %b) {
296 ; CHECK-LABEL: whilehi_b_ww:
298 ; CHECK-NEXT: whilehi p0.b, w0, w1
300 %while = call <vscale x 16 x i1> @llvm.aarch64.sve.whilelo.nxv16i1.i32(i32 %b, i32 %a)
301 %while.rev = call <vscale x 16 x i1> @llvm.vector.reverse.nxv16i1(<vscale x 16 x i1> %while)
302 ret <vscale x 16 x i1> %while.rev
305 define <vscale x 16 x i1> @whilehi_b_xx(i64 %a, i64 %b) {
306 ; CHECK-LABEL: whilehi_b_xx:
308 ; CHECK-NEXT: whilehi p0.b, x0, x1
310 %while = call <vscale x 16 x i1> @llvm.aarch64.sve.whilelo.nxv16i1.i64(i64 %b, i64 %a)
311 %while.rev = call <vscale x 16 x i1> @llvm.vector.reverse.nxv16i1(<vscale x 16 x i1> %while)
312 ret <vscale x 16 x i1> %while.rev
315 define <vscale x 8 x i1> @whilehi_h_ww(i32 %a, i32 %b) {
316 ; CHECK-LABEL: whilehi_h_ww:
318 ; CHECK-NEXT: whilehi p0.h, w0, w1
320 %while = call <vscale x 8 x i1> @llvm.aarch64.sve.whilelo.nxv8i1.i32(i32 %b, i32 %a)
321 %while.rev = call <vscale x 8 x i1> @llvm.vector.reverse.nxv8i1(<vscale x 8 x i1> %while)
322 ret <vscale x 8 x i1> %while.rev
325 define <vscale x 8 x i1> @whilehi_h_xx(i64 %a, i64 %b) {
326 ; CHECK-LABEL: whilehi_h_xx:
328 ; CHECK-NEXT: whilehi p0.h, x0, x1
330 %while = call <vscale x 8 x i1> @llvm.aarch64.sve.whilelo.nxv8i1.i64(i64 %b, i64 %a)
331 %while.rev = call <vscale x 8 x i1> @llvm.vector.reverse.nxv8i1(<vscale x 8 x i1> %while)
332 ret <vscale x 8 x i1> %while.rev
335 define <vscale x 4 x i1> @whilehi_s_ww(i32 %a, i32 %b) {
336 ; CHECK-LABEL: whilehi_s_ww:
338 ; CHECK-NEXT: whilehi p0.s, w0, w1
340 %while = call <vscale x 4 x i1> @llvm.aarch64.sve.whilelo.nxv4i1.i32(i32 %b, i32 %a)
341 %while.rev = call <vscale x 4 x i1> @llvm.vector.reverse.nxv4i1(<vscale x 4 x i1> %while)
342 ret <vscale x 4 x i1> %while.rev
345 define <vscale x 4 x i1> @whilehi_s_xx(i64 %a, i64 %b) {
346 ; CHECK-LABEL: whilehi_s_xx:
348 ; CHECK-NEXT: whilehi p0.s, x0, x1
350 %while = call <vscale x 4 x i1> @llvm.aarch64.sve.whilelo.nxv4i1.i64(i64 %b, i64 %a)
351 %while.rev = call <vscale x 4 x i1> @llvm.vector.reverse.nxv4i1(<vscale x 4 x i1> %while)
352 ret <vscale x 4 x i1> %while.rev
355 define <vscale x 2 x i1> @whilehi_d_ww(i32 %a, i32 %b) {
356 ; CHECK-LABEL: whilehi_d_ww:
358 ; CHECK-NEXT: whilehi p0.d, w0, w1
360 %while = call <vscale x 2 x i1> @llvm.aarch64.sve.whilelo.nxv2i1.i32(i32 %b, i32 %a)
361 %while.rev = call <vscale x 2 x i1> @llvm.vector.reverse.nxv2i1(<vscale x 2 x i1> %while)
362 ret <vscale x 2 x i1> %while.rev
365 define <vscale x 2 x i1> @whilehi_d_xx(i64 %a, i64 %b) {
366 ; CHECK-LABEL: whilehi_d_xx:
368 ; CHECK-NEXT: whilehi p0.d, x0, x1
370 %while = call <vscale x 2 x i1> @llvm.aarch64.sve.whilelo.nxv2i1.i64(i64 %b, i64 %a)
371 %while.rev = call <vscale x 2 x i1> @llvm.vector.reverse.nxv2i1(<vscale x 2 x i1> %while)
372 ret <vscale x 2 x i1> %while.rev
379 ; Cannot invert the while predicate when %a is MIN_INT.
380 define <vscale x 16 x i1> @whilele_b_ww(i32 %a, i32 %b) {
381 ; CHECK-LABEL: whilele_b_ww:
383 ; CHECK-NEXT: whilege p0.b, w1, w0
384 ; CHECK-NEXT: rev p0.b, p0.b
386 %while = call <vscale x 16 x i1> @llvm.aarch64.sve.whilege.nxv16i1.i32(i32 %b, i32 %a)
387 %while.rev = call <vscale x 16 x i1> @llvm.vector.reverse.nxv16i1(<vscale x 16 x i1> %while)
388 ret <vscale x 16 x i1> %while.rev
391 ; Cannot invert the while predicate when %a is MIN_INT.
392 define <vscale x 16 x i1> @whilele_b_xx(i64 %a, i64 %b) {
393 ; CHECK-LABEL: whilele_b_xx:
395 ; CHECK-NEXT: whilege p0.b, x1, x0
396 ; CHECK-NEXT: rev p0.b, p0.b
398 %while = call <vscale x 16 x i1> @llvm.aarch64.sve.whilege.nxv16i1.i64(i64 %b, i64 %a)
399 %while.rev = call <vscale x 16 x i1> @llvm.vector.reverse.nxv16i1(<vscale x 16 x i1> %while)
400 ret <vscale x 16 x i1> %while.rev
403 ; Cannot invert the while predicate when %a is MIN_INT.
404 define <vscale x 8 x i1> @whilele_h_ww(i32 %a, i32 %b) {
405 ; CHECK-LABEL: whilele_h_ww:
407 ; CHECK-NEXT: whilege p0.h, w1, w0
408 ; CHECK-NEXT: rev p0.h, p0.h
410 %while = call <vscale x 8 x i1> @llvm.aarch64.sve.whilege.nxv8i1.i32(i32 %b, i32 %a)
411 %while.rev = call <vscale x 8 x i1> @llvm.vector.reverse.nxv8i1(<vscale x 8 x i1> %while)
412 ret <vscale x 8 x i1> %while.rev
415 ; Cannot invert the while predicate when %a is MIN_INT.
416 define <vscale x 8 x i1> @whilele_h_xx(i64 %a, i64 %b) {
417 ; CHECK-LABEL: whilele_h_xx:
419 ; CHECK-NEXT: whilege p0.h, x1, x0
420 ; CHECK-NEXT: rev p0.h, p0.h
422 %while = call <vscale x 8 x i1> @llvm.aarch64.sve.whilege.nxv8i1.i64(i64 %b, i64 %a)
423 %while.rev = call <vscale x 8 x i1> @llvm.vector.reverse.nxv8i1(<vscale x 8 x i1> %while)
424 ret <vscale x 8 x i1> %while.rev
427 ; Cannot invert the while predicate when %a is MIN_INT.
428 define <vscale x 4 x i1> @whilele_s_ww(i32 %a, i32 %b) {
429 ; CHECK-LABEL: whilele_s_ww:
431 ; CHECK-NEXT: whilege p0.s, w1, w0
432 ; CHECK-NEXT: rev p0.s, p0.s
434 %while = call <vscale x 4 x i1> @llvm.aarch64.sve.whilege.nxv4i1.i32(i32 %b, i32 %a)
435 %while.rev = call <vscale x 4 x i1> @llvm.vector.reverse.nxv4i1(<vscale x 4 x i1> %while)
436 ret <vscale x 4 x i1> %while.rev
439 ; Cannot invert the while predicate when %a is MIN_INT.
440 define <vscale x 4 x i1> @whilele_s_xx(i64 %a, i64 %b) {
441 ; CHECK-LABEL: whilele_s_xx:
443 ; CHECK-NEXT: whilege p0.s, x1, x0
444 ; CHECK-NEXT: rev p0.s, p0.s
446 %while = call <vscale x 4 x i1> @llvm.aarch64.sve.whilege.nxv4i1.i64(i64 %b, i64 %a)
447 %while.rev = call <vscale x 4 x i1> @llvm.vector.reverse.nxv4i1(<vscale x 4 x i1> %while)
448 ret <vscale x 4 x i1> %while.rev
451 ; Cannot invert the while predicate when %a is MIN_INT.
452 define <vscale x 2 x i1> @whilele_d_ww(i32 %a, i32 %b) {
453 ; CHECK-LABEL: whilele_d_ww:
455 ; CHECK-NEXT: whilege p0.d, w1, w0
456 ; CHECK-NEXT: rev p0.d, p0.d
458 %while = call <vscale x 2 x i1> @llvm.aarch64.sve.whilege.nxv2i1.i32(i32 %b, i32 %a)
459 %while.rev = call <vscale x 2 x i1> @llvm.vector.reverse.nxv2i1(<vscale x 2 x i1> %while)
460 ret <vscale x 2 x i1> %while.rev
463 ; Cannot invert the while predicate when %a is MIN_INT.
464 define <vscale x 2 x i1> @whilele_d_xx(i64 %a, i64 %b) {
465 ; CHECK-LABEL: whilele_d_xx:
467 ; CHECK-NEXT: whilege p0.d, x1, x0
468 ; CHECK-NEXT: rev p0.d, p0.d
470 %while = call <vscale x 2 x i1> @llvm.aarch64.sve.whilege.nxv2i1.i64(i64 %b, i64 %a)
471 %while.rev = call <vscale x 2 x i1> @llvm.vector.reverse.nxv2i1(<vscale x 2 x i1> %while)
472 ret <vscale x 2 x i1> %while.rev
479 define <vscale x 16 x i1> @whilelo_b_ww(i32 %a, i32 %b) {
480 ; CHECK-LABEL: whilelo_b_ww:
482 ; CHECK-NEXT: whilelo p0.b, w0, w1
484 %while = call <vscale x 16 x i1> @llvm.aarch64.sve.whilehi.nxv16i1.i32(i32 %b, i32 %a)
485 %while.rev = call <vscale x 16 x i1> @llvm.vector.reverse.nxv16i1(<vscale x 16 x i1> %while)
486 ret <vscale x 16 x i1> %while.rev
489 define <vscale x 16 x i1> @whilelo_b_xx(i64 %a, i64 %b) {
490 ; CHECK-LABEL: whilelo_b_xx:
492 ; CHECK-NEXT: whilelo p0.b, x0, x1
494 %while = call <vscale x 16 x i1> @llvm.aarch64.sve.whilehi.nxv16i1.i64(i64 %b, i64 %a)
495 %while.rev = call <vscale x 16 x i1> @llvm.vector.reverse.nxv16i1(<vscale x 16 x i1> %while)
496 ret <vscale x 16 x i1> %while.rev
499 define <vscale x 8 x i1> @whilelo_h_ww(i32 %a, i32 %b) {
500 ; CHECK-LABEL: whilelo_h_ww:
502 ; CHECK-NEXT: whilelo p0.h, w0, w1
504 %while = call <vscale x 8 x i1> @llvm.aarch64.sve.whilehi.nxv8i1.i32(i32 %b, i32 %a)
505 %while.rev = call <vscale x 8 x i1> @llvm.vector.reverse.nxv8i1(<vscale x 8 x i1> %while)
506 ret <vscale x 8 x i1> %while.rev
509 define <vscale x 8 x i1> @whilelo_h_xx(i64 %a, i64 %b) {
510 ; CHECK-LABEL: whilelo_h_xx:
512 ; CHECK-NEXT: whilelo p0.h, x0, x1
514 %while = call <vscale x 8 x i1> @llvm.aarch64.sve.whilehi.nxv8i1.i64(i64 %b, i64 %a)
515 %while.rev = call <vscale x 8 x i1> @llvm.vector.reverse.nxv8i1(<vscale x 8 x i1> %while)
516 ret <vscale x 8 x i1> %while.rev
519 define <vscale x 4 x i1> @whilelo_s_ww(i32 %a, i32 %b) {
520 ; CHECK-LABEL: whilelo_s_ww:
522 ; CHECK-NEXT: whilelo p0.s, w0, w1
524 %while = call <vscale x 4 x i1> @llvm.aarch64.sve.whilehi.nxv4i1.i32(i32 %b, i32 %a)
525 %while.rev = call <vscale x 4 x i1> @llvm.vector.reverse.nxv4i1(<vscale x 4 x i1> %while)
526 ret <vscale x 4 x i1> %while.rev
529 define <vscale x 4 x i1> @whilelo_s_xx(i64 %a, i64 %b) {
530 ; CHECK-LABEL: whilelo_s_xx:
532 ; CHECK-NEXT: whilelo p0.s, x0, x1
534 %while = call <vscale x 4 x i1> @llvm.aarch64.sve.whilehi.nxv4i1.i64(i64 %b, i64 %a)
535 %while.rev = call <vscale x 4 x i1> @llvm.vector.reverse.nxv4i1(<vscale x 4 x i1> %while)
536 ret <vscale x 4 x i1> %while.rev
539 define <vscale x 2 x i1> @whilelo_d_ww(i32 %a, i32 %b) {
540 ; CHECK-LABEL: whilelo_d_ww:
542 ; CHECK-NEXT: whilelo p0.d, w0, w1
544 %while = call <vscale x 2 x i1> @llvm.aarch64.sve.whilehi.nxv2i1.i32(i32 %b, i32 %a)
545 %while.rev = call <vscale x 2 x i1> @llvm.vector.reverse.nxv2i1(<vscale x 2 x i1> %while)
546 ret <vscale x 2 x i1> %while.rev
549 define <vscale x 2 x i1> @whilelo_d_xx(i64 %a, i64 %b) {
550 ; CHECK-LABEL: whilelo_d_xx:
552 ; CHECK-NEXT: whilelo p0.d, x0, x1
554 %while = call <vscale x 2 x i1> @llvm.aarch64.sve.whilehi.nxv2i1.i64(i64 %b, i64 %a)
555 %while.rev = call <vscale x 2 x i1> @llvm.vector.reverse.nxv2i1(<vscale x 2 x i1> %while)
556 ret <vscale x 2 x i1> %while.rev
563 ; Cannot invert the while predicate when %a is MIN_UINT.
564 define <vscale x 16 x i1> @whilels_b_ww(i32 %a, i32 %b) {
565 ; CHECK-LABEL: whilels_b_ww:
567 ; CHECK-NEXT: whilehs p0.b, w1, w0
568 ; CHECK-NEXT: rev p0.b, p0.b
570 %while = call <vscale x 16 x i1> @llvm.aarch64.sve.whilehs.nxv16i1.i32(i32 %b, i32 %a)
571 %while.rev = call <vscale x 16 x i1> @llvm.vector.reverse.nxv16i1(<vscale x 16 x i1> %while)
572 ret <vscale x 16 x i1> %while.rev
575 ; Cannot invert the while predicate when %a is MIN_UINT.
576 define <vscale x 16 x i1> @whilels_b_xx(i64 %a, i64 %b) {
577 ; CHECK-LABEL: whilels_b_xx:
579 ; CHECK-NEXT: whilehs p0.b, x1, x0
580 ; CHECK-NEXT: rev p0.b, p0.b
582 %while = call <vscale x 16 x i1> @llvm.aarch64.sve.whilehs.nxv16i1.i64(i64 %b, i64 %a)
583 %while.rev = call <vscale x 16 x i1> @llvm.vector.reverse.nxv16i1(<vscale x 16 x i1> %while)
584 ret <vscale x 16 x i1> %while.rev
587 ; Cannot invert the while predicate when %a is MIN_UINT.
588 define <vscale x 8 x i1> @whilels_h_ww(i32 %a, i32 %b) {
589 ; CHECK-LABEL: whilels_h_ww:
591 ; CHECK-NEXT: whilehs p0.h, w1, w0
592 ; CHECK-NEXT: rev p0.h, p0.h
594 %while = call <vscale x 8 x i1> @llvm.aarch64.sve.whilehs.nxv8i1.i32(i32 %b, i32 %a)
595 %while.rev = call <vscale x 8 x i1> @llvm.vector.reverse.nxv8i1(<vscale x 8 x i1> %while)
596 ret <vscale x 8 x i1> %while.rev
599 ; Cannot invert the while predicate when %a is MIN_UINT.
600 define <vscale x 8 x i1> @whilels_h_xx(i64 %a, i64 %b) {
601 ; CHECK-LABEL: whilels_h_xx:
603 ; CHECK-NEXT: whilehs p0.h, x1, x0
604 ; CHECK-NEXT: rev p0.h, p0.h
606 %while = call <vscale x 8 x i1> @llvm.aarch64.sve.whilehs.nxv8i1.i64(i64 %b, i64 %a)
607 %while.rev = call <vscale x 8 x i1> @llvm.vector.reverse.nxv8i1(<vscale x 8 x i1> %while)
608 ret <vscale x 8 x i1> %while.rev
611 ; Cannot invert the while predicate when %a is MIN_UINT.
612 define <vscale x 4 x i1> @whilels_s_ww(i32 %a, i32 %b) {
613 ; CHECK-LABEL: whilels_s_ww:
615 ; CHECK-NEXT: whilehs p0.s, w1, w0
616 ; CHECK-NEXT: rev p0.s, p0.s
618 %while = call <vscale x 4 x i1> @llvm.aarch64.sve.whilehs.nxv4i1.i32(i32 %b, i32 %a)
619 %while.rev = call <vscale x 4 x i1> @llvm.vector.reverse.nxv4i1(<vscale x 4 x i1> %while)
620 ret <vscale x 4 x i1> %while.rev
623 ; Cannot invert the while predicate when %a is MIN_UINT.
624 define <vscale x 4 x i1> @whilels_s_xx(i64 %a, i64 %b) {
625 ; CHECK-LABEL: whilels_s_xx:
627 ; CHECK-NEXT: whilehs p0.s, x1, x0
628 ; CHECK-NEXT: rev p0.s, p0.s
630 %while = call <vscale x 4 x i1> @llvm.aarch64.sve.whilehs.nxv4i1.i64(i64 %b, i64 %a)
631 %while.rev = call <vscale x 4 x i1> @llvm.vector.reverse.nxv4i1(<vscale x 4 x i1> %while)
632 ret <vscale x 4 x i1> %while.rev
635 ; Cannot invert the while predicate when %a is MIN_UINT.
636 define <vscale x 2 x i1> @whilels_d_ww(i32 %a, i32 %b) {
637 ; CHECK-LABEL: whilels_d_ww:
639 ; CHECK-NEXT: whilehs p0.d, w1, w0
640 ; CHECK-NEXT: rev p0.d, p0.d
642 %while = call <vscale x 2 x i1> @llvm.aarch64.sve.whilehs.nxv2i1.i32(i32 %b, i32 %a)
643 %while.rev = call <vscale x 2 x i1> @llvm.vector.reverse.nxv2i1(<vscale x 2 x i1> %while)
644 ret <vscale x 2 x i1> %while.rev
647 ; Cannot invert the while predicate when %a is MIN_UINT.
648 define <vscale x 2 x i1> @whilels_d_xx(i64 %a, i64 %b) {
649 ; CHECK-LABEL: whilels_d_xx:
651 ; CHECK-NEXT: whilehs p0.d, x1, x0
652 ; CHECK-NEXT: rev p0.d, p0.d
654 %while = call <vscale x 2 x i1> @llvm.aarch64.sve.whilehs.nxv2i1.i64(i64 %b, i64 %a)
655 %while.rev = call <vscale x 2 x i1> @llvm.vector.reverse.nxv2i1(<vscale x 2 x i1> %while)
656 ret <vscale x 2 x i1> %while.rev
663 define <vscale x 16 x i1> @whilelt_b_ww(i32 %a, i32 %b) {
664 ; CHECK-LABEL: whilelt_b_ww:
666 ; CHECK-NEXT: whilelt p0.b, w0, w1
668 %while = call <vscale x 16 x i1> @llvm.aarch64.sve.whilegt.nxv16i1.i32(i32 %b, i32 %a)
669 %while.rev = call <vscale x 16 x i1> @llvm.vector.reverse.nxv16i1(<vscale x 16 x i1> %while)
670 ret <vscale x 16 x i1> %while.rev
673 define <vscale x 16 x i1> @whilelt_b_xx(i64 %a, i64 %b) {
674 ; CHECK-LABEL: whilelt_b_xx:
676 ; CHECK-NEXT: whilelt p0.b, x0, x1
678 %while = call <vscale x 16 x i1> @llvm.aarch64.sve.whilegt.nxv16i1.i64(i64 %b, i64 %a)
679 %while.rev = call <vscale x 16 x i1> @llvm.vector.reverse.nxv16i1(<vscale x 16 x i1> %while)
680 ret <vscale x 16 x i1> %while.rev
683 define <vscale x 8 x i1> @whilelt_h_ww(i32 %a, i32 %b) {
684 ; CHECK-LABEL: whilelt_h_ww:
686 ; CHECK-NEXT: whilelt p0.h, w0, w1
688 %while = call <vscale x 8 x i1> @llvm.aarch64.sve.whilegt.nxv8i1.i32(i32 %b, i32 %a)
689 %while.rev = call <vscale x 8 x i1> @llvm.vector.reverse.nxv8i1(<vscale x 8 x i1> %while)
690 ret <vscale x 8 x i1> %while.rev
693 define <vscale x 8 x i1> @whilelt_h_xx(i64 %a, i64 %b) {
694 ; CHECK-LABEL: whilelt_h_xx:
696 ; CHECK-NEXT: whilelt p0.h, x0, x1
698 %while = call <vscale x 8 x i1> @llvm.aarch64.sve.whilegt.nxv8i1.i64(i64 %b, i64 %a)
699 %while.rev = call <vscale x 8 x i1> @llvm.vector.reverse.nxv8i1(<vscale x 8 x i1> %while)
700 ret <vscale x 8 x i1> %while.rev
703 define <vscale x 4 x i1> @whilelt_s_ww(i32 %a, i32 %b) {
704 ; CHECK-LABEL: whilelt_s_ww:
706 ; CHECK-NEXT: whilelt p0.s, w0, w1
708 %while = call <vscale x 4 x i1> @llvm.aarch64.sve.whilegt.nxv4i1.i32(i32 %b, i32 %a)
709 %while.rev = call <vscale x 4 x i1> @llvm.vector.reverse.nxv4i1(<vscale x 4 x i1> %while)
710 ret <vscale x 4 x i1> %while.rev
713 define <vscale x 4 x i1> @whilelt_s_xx(i64 %a, i64 %b) {
714 ; CHECK-LABEL: whilelt_s_xx:
716 ; CHECK-NEXT: whilelt p0.s, x0, x1
718 %while = call <vscale x 4 x i1> @llvm.aarch64.sve.whilegt.nxv4i1.i64(i64 %b, i64 %a)
719 %while.rev = call <vscale x 4 x i1> @llvm.vector.reverse.nxv4i1(<vscale x 4 x i1> %while)
720 ret <vscale x 4 x i1> %while.rev
723 define <vscale x 2 x i1> @whilelt_d_ww(i32 %a, i32 %b) {
724 ; CHECK-LABEL: whilelt_d_ww:
726 ; CHECK-NEXT: whilelt p0.d, w0, w1
728 %while = call <vscale x 2 x i1> @llvm.aarch64.sve.whilegt.nxv2i1.i32(i32 %b, i32 %a)
729 %while.rev = call <vscale x 2 x i1> @llvm.vector.reverse.nxv2i1(<vscale x 2 x i1> %while)
730 ret <vscale x 2 x i1> %while.rev
733 define <vscale x 2 x i1> @whilelt_d_xx(i64 %a, i64 %b) {
734 ; CHECK-LABEL: whilelt_d_xx:
736 ; CHECK-NEXT: whilelt p0.d, x0, x1
738 %while = call <vscale x 2 x i1> @llvm.aarch64.sve.whilegt.nxv2i1.i64(i64 %b, i64 %a)
739 %while.rev = call <vscale x 2 x i1> @llvm.vector.reverse.nxv2i1(<vscale x 2 x i1> %while)
740 ret <vscale x 2 x i1> %while.rev