1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=instsimplify -S | FileCheck %s
4 ; There are 10 * 10 combinations of icmp predicates that can be AND'd together.
5 ; The majority of these can be simplified to always false or just one of the icmps.
7 define i1 @eq_eq(i8 %a, i8 %b) {
9 ; CHECK-NEXT: [[CMP1:%.*]] = icmp eq i8 [[A:%.*]], [[B:%.*]]
10 ; CHECK-NEXT: ret i1 [[CMP1]]
12 %cmp1 = icmp eq i8 %a, %b
13 %cmp2 = icmp eq i8 %a, %b
14 %and = and i1 %cmp1, %cmp2
18 define i1 @eq_ne(i8 %a, i8 %b) {
19 ; CHECK-LABEL: @eq_ne(
20 ; CHECK-NEXT: ret i1 false
22 %cmp1 = icmp eq i8 %a, %b
23 %cmp2 = icmp ne i8 %a, %b
24 %and = and i1 %cmp1, %cmp2
28 define i1 @eq_sge(i8 %a, i8 %b) {
29 ; CHECK-LABEL: @eq_sge(
30 ; CHECK-NEXT: [[CMP1:%.*]] = icmp eq i8 [[A:%.*]], [[B:%.*]]
31 ; CHECK-NEXT: ret i1 [[CMP1]]
33 %cmp1 = icmp eq i8 %a, %b
34 %cmp2 = icmp sge i8 %a, %b
35 %and = and i1 %cmp1, %cmp2
39 define i1 @eq_sgt(i8 %a, i8 %b) {
40 ; CHECK-LABEL: @eq_sgt(
41 ; CHECK-NEXT: ret i1 false
43 %cmp1 = icmp eq i8 %a, %b
44 %cmp2 = icmp sgt i8 %a, %b
45 %and = and i1 %cmp1, %cmp2
49 define i1 @eq_sle(i8 %a, i8 %b) {
50 ; CHECK-LABEL: @eq_sle(
51 ; CHECK-NEXT: [[CMP1:%.*]] = icmp eq i8 [[A:%.*]], [[B:%.*]]
52 ; CHECK-NEXT: ret i1 [[CMP1]]
54 %cmp1 = icmp eq i8 %a, %b
55 %cmp2 = icmp sle i8 %a, %b
56 %and = and i1 %cmp1, %cmp2
60 define i1 @eq_slt(i8 %a, i8 %b) {
61 ; CHECK-LABEL: @eq_slt(
62 ; CHECK-NEXT: ret i1 false
64 %cmp1 = icmp eq i8 %a, %b
65 %cmp2 = icmp slt i8 %a, %b
66 %and = and i1 %cmp1, %cmp2
70 define i1 @eq_uge(i8 %a, i8 %b) {
71 ; CHECK-LABEL: @eq_uge(
72 ; CHECK-NEXT: [[CMP1:%.*]] = icmp eq i8 [[A:%.*]], [[B:%.*]]
73 ; CHECK-NEXT: ret i1 [[CMP1]]
75 %cmp1 = icmp eq i8 %a, %b
76 %cmp2 = icmp uge i8 %a, %b
77 %and = and i1 %cmp1, %cmp2
81 define i1 @eq_ugt(i8 %a, i8 %b) {
82 ; CHECK-LABEL: @eq_ugt(
83 ; CHECK-NEXT: ret i1 false
85 %cmp1 = icmp eq i8 %a, %b
86 %cmp2 = icmp ugt i8 %a, %b
87 %and = and i1 %cmp1, %cmp2
91 define i1 @eq_ule(i8 %a, i8 %b) {
92 ; CHECK-LABEL: @eq_ule(
93 ; CHECK-NEXT: [[CMP1:%.*]] = icmp eq i8 [[A:%.*]], [[B:%.*]]
94 ; CHECK-NEXT: ret i1 [[CMP1]]
96 %cmp1 = icmp eq i8 %a, %b
97 %cmp2 = icmp ule i8 %a, %b
98 %and = and i1 %cmp1, %cmp2
102 define i1 @eq_ult(i8 %a, i8 %b) {
103 ; CHECK-LABEL: @eq_ult(
104 ; CHECK-NEXT: ret i1 false
106 %cmp1 = icmp eq i8 %a, %b
107 %cmp2 = icmp ult i8 %a, %b
108 %and = and i1 %cmp1, %cmp2
114 define i1 @ne_eq(i8 %a, i8 %b) {
115 ; CHECK-LABEL: @ne_eq(
116 ; CHECK-NEXT: ret i1 false
118 %cmp1 = icmp ne i8 %a, %b
119 %cmp2 = icmp eq i8 %a, %b
120 %and = and i1 %cmp1, %cmp2
124 define i1 @ne_ne(i8 %a, i8 %b) {
125 ; CHECK-LABEL: @ne_ne(
126 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ne i8 [[A:%.*]], [[B:%.*]]
127 ; CHECK-NEXT: ret i1 [[CMP1]]
129 %cmp1 = icmp ne i8 %a, %b
130 %cmp2 = icmp ne i8 %a, %b
131 %and = and i1 %cmp1, %cmp2
135 define i1 @ne_sge(i8 %a, i8 %b) {
136 ; CHECK-LABEL: @ne_sge(
137 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ne i8 [[A:%.*]], [[B:%.*]]
138 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sge i8 [[A]], [[B]]
139 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
140 ; CHECK-NEXT: ret i1 [[AND]]
142 %cmp1 = icmp ne i8 %a, %b
143 %cmp2 = icmp sge i8 %a, %b
144 %and = and i1 %cmp1, %cmp2
148 define i1 @ne_sgt(i8 %a, i8 %b) {
149 ; CHECK-LABEL: @ne_sgt(
150 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sgt i8 [[A:%.*]], [[B:%.*]]
151 ; CHECK-NEXT: ret i1 [[CMP2]]
153 %cmp1 = icmp ne i8 %a, %b
154 %cmp2 = icmp sgt i8 %a, %b
155 %and = and i1 %cmp1, %cmp2
159 define i1 @ne_sle(i8 %a, i8 %b) {
160 ; CHECK-LABEL: @ne_sle(
161 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ne i8 [[A:%.*]], [[B:%.*]]
162 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sle i8 [[A]], [[B]]
163 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
164 ; CHECK-NEXT: ret i1 [[AND]]
166 %cmp1 = icmp ne i8 %a, %b
167 %cmp2 = icmp sle i8 %a, %b
168 %and = and i1 %cmp1, %cmp2
172 define i1 @ne_slt(i8 %a, i8 %b) {
173 ; CHECK-LABEL: @ne_slt(
174 ; CHECK-NEXT: [[CMP2:%.*]] = icmp slt i8 [[A:%.*]], [[B:%.*]]
175 ; CHECK-NEXT: ret i1 [[CMP2]]
177 %cmp1 = icmp ne i8 %a, %b
178 %cmp2 = icmp slt i8 %a, %b
179 %and = and i1 %cmp1, %cmp2
183 define i1 @ne_uge(i8 %a, i8 %b) {
184 ; CHECK-LABEL: @ne_uge(
185 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ne i8 [[A:%.*]], [[B:%.*]]
186 ; CHECK-NEXT: [[CMP2:%.*]] = icmp uge i8 [[A]], [[B]]
187 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
188 ; CHECK-NEXT: ret i1 [[AND]]
190 %cmp1 = icmp ne i8 %a, %b
191 %cmp2 = icmp uge i8 %a, %b
192 %and = and i1 %cmp1, %cmp2
196 define i1 @ne_ugt(i8 %a, i8 %b) {
197 ; CHECK-LABEL: @ne_ugt(
198 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ugt i8 [[A:%.*]], [[B:%.*]]
199 ; CHECK-NEXT: ret i1 [[CMP2]]
201 %cmp1 = icmp ne i8 %a, %b
202 %cmp2 = icmp ugt i8 %a, %b
203 %and = and i1 %cmp1, %cmp2
207 define i1 @ne_ule(i8 %a, i8 %b) {
208 ; CHECK-LABEL: @ne_ule(
209 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ne i8 [[A:%.*]], [[B:%.*]]
210 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ule i8 [[A]], [[B]]
211 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
212 ; CHECK-NEXT: ret i1 [[AND]]
214 %cmp1 = icmp ne i8 %a, %b
215 %cmp2 = icmp ule i8 %a, %b
216 %and = and i1 %cmp1, %cmp2
220 define i1 @ne_ult(i8 %a, i8 %b) {
221 ; CHECK-LABEL: @ne_ult(
222 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ult i8 [[A:%.*]], [[B:%.*]]
223 ; CHECK-NEXT: ret i1 [[CMP2]]
225 %cmp1 = icmp ne i8 %a, %b
226 %cmp2 = icmp ult i8 %a, %b
227 %and = and i1 %cmp1, %cmp2
233 define i1 @sge_eq(i8 %a, i8 %b) {
234 ; CHECK-LABEL: @sge_eq(
235 ; CHECK-NEXT: [[CMP2:%.*]] = icmp eq i8 [[A:%.*]], [[B:%.*]]
236 ; CHECK-NEXT: ret i1 [[CMP2]]
238 %cmp1 = icmp sge i8 %a, %b
239 %cmp2 = icmp eq i8 %a, %b
240 %and = and i1 %cmp1, %cmp2
244 define i1 @sge_ne(i8 %a, i8 %b) {
245 ; CHECK-LABEL: @sge_ne(
246 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sge i8 [[A:%.*]], [[B:%.*]]
247 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ne i8 [[A]], [[B]]
248 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
249 ; CHECK-NEXT: ret i1 [[AND]]
251 %cmp1 = icmp sge i8 %a, %b
252 %cmp2 = icmp ne i8 %a, %b
253 %and = and i1 %cmp1, %cmp2
257 define i1 @sge_sge(i8 %a, i8 %b) {
258 ; CHECK-LABEL: @sge_sge(
259 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sge i8 [[A:%.*]], [[B:%.*]]
260 ; CHECK-NEXT: ret i1 [[CMP1]]
262 %cmp1 = icmp sge i8 %a, %b
263 %cmp2 = icmp sge i8 %a, %b
264 %and = and i1 %cmp1, %cmp2
268 define i1 @sge_sgt(i8 %a, i8 %b) {
269 ; CHECK-LABEL: @sge_sgt(
270 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sgt i8 [[A:%.*]], [[B:%.*]]
271 ; CHECK-NEXT: ret i1 [[CMP2]]
273 %cmp1 = icmp sge i8 %a, %b
274 %cmp2 = icmp sgt i8 %a, %b
275 %and = and i1 %cmp1, %cmp2
279 define i1 @sge_sle(i8 %a, i8 %b) {
280 ; CHECK-LABEL: @sge_sle(
281 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sge i8 [[A:%.*]], [[B:%.*]]
282 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sle i8 [[A]], [[B]]
283 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
284 ; CHECK-NEXT: ret i1 [[AND]]
286 %cmp1 = icmp sge i8 %a, %b
287 %cmp2 = icmp sle i8 %a, %b
288 %and = and i1 %cmp1, %cmp2
292 define i1 @sge_slt(i8 %a, i8 %b) {
293 ; CHECK-LABEL: @sge_slt(
294 ; CHECK-NEXT: ret i1 false
296 %cmp1 = icmp sge i8 %a, %b
297 %cmp2 = icmp slt i8 %a, %b
298 %and = and i1 %cmp1, %cmp2
302 define i1 @sge_uge(i8 %a, i8 %b) {
303 ; CHECK-LABEL: @sge_uge(
304 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sge i8 [[A:%.*]], [[B:%.*]]
305 ; CHECK-NEXT: [[CMP2:%.*]] = icmp uge i8 [[A]], [[B]]
306 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
307 ; CHECK-NEXT: ret i1 [[AND]]
309 %cmp1 = icmp sge i8 %a, %b
310 %cmp2 = icmp uge i8 %a, %b
311 %and = and i1 %cmp1, %cmp2
315 define i1 @sge_ugt(i8 %a, i8 %b) {
316 ; CHECK-LABEL: @sge_ugt(
317 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sge i8 [[A:%.*]], [[B:%.*]]
318 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ugt i8 [[A]], [[B]]
319 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
320 ; CHECK-NEXT: ret i1 [[AND]]
322 %cmp1 = icmp sge i8 %a, %b
323 %cmp2 = icmp ugt i8 %a, %b
324 %and = and i1 %cmp1, %cmp2
328 define i1 @sge_ule(i8 %a, i8 %b) {
329 ; CHECK-LABEL: @sge_ule(
330 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sge i8 [[A:%.*]], [[B:%.*]]
331 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ule i8 [[A]], [[B]]
332 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
333 ; CHECK-NEXT: ret i1 [[AND]]
335 %cmp1 = icmp sge i8 %a, %b
336 %cmp2 = icmp ule i8 %a, %b
337 %and = and i1 %cmp1, %cmp2
341 define i1 @sge_ult(i8 %a, i8 %b) {
342 ; CHECK-LABEL: @sge_ult(
343 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sge i8 [[A:%.*]], [[B:%.*]]
344 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ult i8 [[A]], [[B]]
345 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
346 ; CHECK-NEXT: ret i1 [[AND]]
348 %cmp1 = icmp sge i8 %a, %b
349 %cmp2 = icmp ult i8 %a, %b
350 %and = and i1 %cmp1, %cmp2
356 define i1 @sgt_eq(i8 %a, i8 %b) {
357 ; CHECK-LABEL: @sgt_eq(
358 ; CHECK-NEXT: ret i1 false
360 %cmp1 = icmp sgt i8 %a, %b
361 %cmp2 = icmp eq i8 %a, %b
362 %and = and i1 %cmp1, %cmp2
366 define i1 @sgt_ne(i8 %a, i8 %b) {
367 ; CHECK-LABEL: @sgt_ne(
368 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sgt i8 [[A:%.*]], [[B:%.*]]
369 ; CHECK-NEXT: ret i1 [[CMP1]]
371 %cmp1 = icmp sgt i8 %a, %b
372 %cmp2 = icmp ne i8 %a, %b
373 %and = and i1 %cmp1, %cmp2
377 define i1 @sgt_sge(i8 %a, i8 %b) {
378 ; CHECK-LABEL: @sgt_sge(
379 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sgt i8 [[A:%.*]], [[B:%.*]]
380 ; CHECK-NEXT: ret i1 [[CMP1]]
382 %cmp1 = icmp sgt i8 %a, %b
383 %cmp2 = icmp sge i8 %a, %b
384 %and = and i1 %cmp1, %cmp2
388 define i1 @sgt_sgt(i8 %a, i8 %b) {
389 ; CHECK-LABEL: @sgt_sgt(
390 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sgt i8 [[A:%.*]], [[B:%.*]]
391 ; CHECK-NEXT: ret i1 [[CMP1]]
393 %cmp1 = icmp sgt i8 %a, %b
394 %cmp2 = icmp sgt i8 %a, %b
395 %and = and i1 %cmp1, %cmp2
399 define i1 @sgt_sle(i8 %a, i8 %b) {
400 ; CHECK-LABEL: @sgt_sle(
401 ; CHECK-NEXT: ret i1 false
403 %cmp1 = icmp sgt i8 %a, %b
404 %cmp2 = icmp sle i8 %a, %b
405 %and = and i1 %cmp1, %cmp2
409 define i1 @sgt_slt(i8 %a, i8 %b) {
410 ; CHECK-LABEL: @sgt_slt(
411 ; CHECK-NEXT: ret i1 false
413 %cmp1 = icmp sgt i8 %a, %b
414 %cmp2 = icmp slt i8 %a, %b
415 %and = and i1 %cmp1, %cmp2
419 define i1 @sgt_uge(i8 %a, i8 %b) {
420 ; CHECK-LABEL: @sgt_uge(
421 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sgt i8 [[A:%.*]], [[B:%.*]]
422 ; CHECK-NEXT: [[CMP2:%.*]] = icmp uge i8 [[A]], [[B]]
423 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
424 ; CHECK-NEXT: ret i1 [[AND]]
426 %cmp1 = icmp sgt i8 %a, %b
427 %cmp2 = icmp uge i8 %a, %b
428 %and = and i1 %cmp1, %cmp2
432 define i1 @sgt_ugt(i8 %a, i8 %b) {
433 ; CHECK-LABEL: @sgt_ugt(
434 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sgt i8 [[A:%.*]], [[B:%.*]]
435 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ugt i8 [[A]], [[B]]
436 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
437 ; CHECK-NEXT: ret i1 [[AND]]
439 %cmp1 = icmp sgt i8 %a, %b
440 %cmp2 = icmp ugt i8 %a, %b
441 %and = and i1 %cmp1, %cmp2
445 define i1 @sgt_ule(i8 %a, i8 %b) {
446 ; CHECK-LABEL: @sgt_ule(
447 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sgt i8 [[A:%.*]], [[B:%.*]]
448 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ule i8 [[A]], [[B]]
449 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
450 ; CHECK-NEXT: ret i1 [[AND]]
452 %cmp1 = icmp sgt i8 %a, %b
453 %cmp2 = icmp ule i8 %a, %b
454 %and = and i1 %cmp1, %cmp2
458 define i1 @sgt_ult(i8 %a, i8 %b) {
459 ; CHECK-LABEL: @sgt_ult(
460 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sgt i8 [[A:%.*]], [[B:%.*]]
461 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ult i8 [[A]], [[B]]
462 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
463 ; CHECK-NEXT: ret i1 [[AND]]
465 %cmp1 = icmp sgt i8 %a, %b
466 %cmp2 = icmp ult i8 %a, %b
467 %and = and i1 %cmp1, %cmp2
473 define i1 @sle_eq(i8 %a, i8 %b) {
474 ; CHECK-LABEL: @sle_eq(
475 ; CHECK-NEXT: [[CMP2:%.*]] = icmp eq i8 [[A:%.*]], [[B:%.*]]
476 ; CHECK-NEXT: ret i1 [[CMP2]]
478 %cmp1 = icmp sle i8 %a, %b
479 %cmp2 = icmp eq i8 %a, %b
480 %and = and i1 %cmp1, %cmp2
484 define i1 @sle_ne(i8 %a, i8 %b) {
485 ; CHECK-LABEL: @sle_ne(
486 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sle i8 [[A:%.*]], [[B:%.*]]
487 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ne i8 [[A]], [[B]]
488 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
489 ; CHECK-NEXT: ret i1 [[AND]]
491 %cmp1 = icmp sle i8 %a, %b
492 %cmp2 = icmp ne i8 %a, %b
493 %and = and i1 %cmp1, %cmp2
497 define i1 @sle_sge(i8 %a, i8 %b) {
498 ; CHECK-LABEL: @sle_sge(
499 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sle i8 [[A:%.*]], [[B:%.*]]
500 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sge i8 [[A]], [[B]]
501 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
502 ; CHECK-NEXT: ret i1 [[AND]]
504 %cmp1 = icmp sle i8 %a, %b
505 %cmp2 = icmp sge i8 %a, %b
506 %and = and i1 %cmp1, %cmp2
510 define i1 @sle_sgt(i8 %a, i8 %b) {
511 ; CHECK-LABEL: @sle_sgt(
512 ; CHECK-NEXT: ret i1 false
514 %cmp1 = icmp sle i8 %a, %b
515 %cmp2 = icmp sgt i8 %a, %b
516 %and = and i1 %cmp1, %cmp2
520 define i1 @sle_sle(i8 %a, i8 %b) {
521 ; CHECK-LABEL: @sle_sle(
522 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sle i8 [[A:%.*]], [[B:%.*]]
523 ; CHECK-NEXT: ret i1 [[CMP1]]
525 %cmp1 = icmp sle i8 %a, %b
526 %cmp2 = icmp sle i8 %a, %b
527 %and = and i1 %cmp1, %cmp2
531 define i1 @sle_slt(i8 %a, i8 %b) {
532 ; CHECK-LABEL: @sle_slt(
533 ; CHECK-NEXT: [[CMP2:%.*]] = icmp slt i8 [[A:%.*]], [[B:%.*]]
534 ; CHECK-NEXT: ret i1 [[CMP2]]
536 %cmp1 = icmp sle i8 %a, %b
537 %cmp2 = icmp slt i8 %a, %b
538 %and = and i1 %cmp1, %cmp2
542 define i1 @sle_uge(i8 %a, i8 %b) {
543 ; CHECK-LABEL: @sle_uge(
544 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sle i8 [[A:%.*]], [[B:%.*]]
545 ; CHECK-NEXT: [[CMP2:%.*]] = icmp uge i8 [[A]], [[B]]
546 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
547 ; CHECK-NEXT: ret i1 [[AND]]
549 %cmp1 = icmp sle i8 %a, %b
550 %cmp2 = icmp uge i8 %a, %b
551 %and = and i1 %cmp1, %cmp2
555 define i1 @sle_ugt(i8 %a, i8 %b) {
556 ; CHECK-LABEL: @sle_ugt(
557 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sle i8 [[A:%.*]], [[B:%.*]]
558 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ugt i8 [[A]], [[B]]
559 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
560 ; CHECK-NEXT: ret i1 [[AND]]
562 %cmp1 = icmp sle i8 %a, %b
563 %cmp2 = icmp ugt i8 %a, %b
564 %and = and i1 %cmp1, %cmp2
568 define i1 @sle_ule(i8 %a, i8 %b) {
569 ; CHECK-LABEL: @sle_ule(
570 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sle i8 [[A:%.*]], [[B:%.*]]
571 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ule i8 [[A]], [[B]]
572 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
573 ; CHECK-NEXT: ret i1 [[AND]]
575 %cmp1 = icmp sle i8 %a, %b
576 %cmp2 = icmp ule i8 %a, %b
577 %and = and i1 %cmp1, %cmp2
581 define i1 @sle_ult(i8 %a, i8 %b) {
582 ; CHECK-LABEL: @sle_ult(
583 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sle i8 [[A:%.*]], [[B:%.*]]
584 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ult i8 [[A]], [[B]]
585 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
586 ; CHECK-NEXT: ret i1 [[AND]]
588 %cmp1 = icmp sle i8 %a, %b
589 %cmp2 = icmp ult i8 %a, %b
590 %and = and i1 %cmp1, %cmp2
596 define i1 @slt_eq(i8 %a, i8 %b) {
597 ; CHECK-LABEL: @slt_eq(
598 ; CHECK-NEXT: ret i1 false
600 %cmp1 = icmp slt i8 %a, %b
601 %cmp2 = icmp eq i8 %a, %b
602 %and = and i1 %cmp1, %cmp2
606 define i1 @slt_ne(i8 %a, i8 %b) {
607 ; CHECK-LABEL: @slt_ne(
608 ; CHECK-NEXT: [[CMP1:%.*]] = icmp slt i8 [[A:%.*]], [[B:%.*]]
609 ; CHECK-NEXT: ret i1 [[CMP1]]
611 %cmp1 = icmp slt i8 %a, %b
612 %cmp2 = icmp ne i8 %a, %b
613 %and = and i1 %cmp1, %cmp2
617 define i1 @slt_sge(i8 %a, i8 %b) {
618 ; CHECK-LABEL: @slt_sge(
619 ; CHECK-NEXT: ret i1 false
621 %cmp1 = icmp slt i8 %a, %b
622 %cmp2 = icmp sge i8 %a, %b
623 %and = and i1 %cmp1, %cmp2
627 define i1 @slt_sgt(i8 %a, i8 %b) {
628 ; CHECK-LABEL: @slt_sgt(
629 ; CHECK-NEXT: ret i1 false
631 %cmp1 = icmp slt i8 %a, %b
632 %cmp2 = icmp sgt i8 %a, %b
633 %and = and i1 %cmp1, %cmp2
637 define i1 @slt_sle(i8 %a, i8 %b) {
638 ; CHECK-LABEL: @slt_sle(
639 ; CHECK-NEXT: [[CMP1:%.*]] = icmp slt i8 [[A:%.*]], [[B:%.*]]
640 ; CHECK-NEXT: ret i1 [[CMP1]]
642 %cmp1 = icmp slt i8 %a, %b
643 %cmp2 = icmp sle i8 %a, %b
644 %and = and i1 %cmp1, %cmp2
648 define i1 @slt_slt(i8 %a, i8 %b) {
649 ; CHECK-LABEL: @slt_slt(
650 ; CHECK-NEXT: [[CMP1:%.*]] = icmp slt i8 [[A:%.*]], [[B:%.*]]
651 ; CHECK-NEXT: ret i1 [[CMP1]]
653 %cmp1 = icmp slt i8 %a, %b
654 %cmp2 = icmp slt i8 %a, %b
655 %and = and i1 %cmp1, %cmp2
659 define i1 @slt_uge(i8 %a, i8 %b) {
660 ; CHECK-LABEL: @slt_uge(
661 ; CHECK-NEXT: [[CMP1:%.*]] = icmp slt i8 [[A:%.*]], [[B:%.*]]
662 ; CHECK-NEXT: [[CMP2:%.*]] = icmp uge i8 [[A]], [[B]]
663 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
664 ; CHECK-NEXT: ret i1 [[AND]]
666 %cmp1 = icmp slt i8 %a, %b
667 %cmp2 = icmp uge i8 %a, %b
668 %and = and i1 %cmp1, %cmp2
672 define i1 @slt_ugt(i8 %a, i8 %b) {
673 ; CHECK-LABEL: @slt_ugt(
674 ; CHECK-NEXT: [[CMP1:%.*]] = icmp slt i8 [[A:%.*]], [[B:%.*]]
675 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ugt i8 [[A]], [[B]]
676 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
677 ; CHECK-NEXT: ret i1 [[AND]]
679 %cmp1 = icmp slt i8 %a, %b
680 %cmp2 = icmp ugt i8 %a, %b
681 %and = and i1 %cmp1, %cmp2
685 define i1 @slt_ule(i8 %a, i8 %b) {
686 ; CHECK-LABEL: @slt_ule(
687 ; CHECK-NEXT: [[CMP1:%.*]] = icmp slt i8 [[A:%.*]], [[B:%.*]]
688 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ule i8 [[A]], [[B]]
689 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
690 ; CHECK-NEXT: ret i1 [[AND]]
692 %cmp1 = icmp slt i8 %a, %b
693 %cmp2 = icmp ule i8 %a, %b
694 %and = and i1 %cmp1, %cmp2
698 define i1 @slt_ult(i8 %a, i8 %b) {
699 ; CHECK-LABEL: @slt_ult(
700 ; CHECK-NEXT: [[CMP1:%.*]] = icmp slt i8 [[A:%.*]], [[B:%.*]]
701 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ult i8 [[A]], [[B]]
702 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
703 ; CHECK-NEXT: ret i1 [[AND]]
705 %cmp1 = icmp slt i8 %a, %b
706 %cmp2 = icmp ult i8 %a, %b
707 %and = and i1 %cmp1, %cmp2
713 define i1 @uge_eq(i8 %a, i8 %b) {
714 ; CHECK-LABEL: @uge_eq(
715 ; CHECK-NEXT: [[CMP2:%.*]] = icmp eq i8 [[A:%.*]], [[B:%.*]]
716 ; CHECK-NEXT: ret i1 [[CMP2]]
718 %cmp1 = icmp uge i8 %a, %b
719 %cmp2 = icmp eq i8 %a, %b
720 %and = and i1 %cmp1, %cmp2
724 define i1 @uge_ne(i8 %a, i8 %b) {
725 ; CHECK-LABEL: @uge_ne(
726 ; CHECK-NEXT: [[CMP1:%.*]] = icmp uge i8 [[A:%.*]], [[B:%.*]]
727 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ne i8 [[A]], [[B]]
728 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
729 ; CHECK-NEXT: ret i1 [[AND]]
731 %cmp1 = icmp uge i8 %a, %b
732 %cmp2 = icmp ne i8 %a, %b
733 %and = and i1 %cmp1, %cmp2
737 define i1 @uge_sge(i8 %a, i8 %b) {
738 ; CHECK-LABEL: @uge_sge(
739 ; CHECK-NEXT: [[CMP1:%.*]] = icmp uge i8 [[A:%.*]], [[B:%.*]]
740 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sge i8 [[A]], [[B]]
741 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
742 ; CHECK-NEXT: ret i1 [[AND]]
744 %cmp1 = icmp uge i8 %a, %b
745 %cmp2 = icmp sge i8 %a, %b
746 %and = and i1 %cmp1, %cmp2
750 define i1 @uge_sgt(i8 %a, i8 %b) {
751 ; CHECK-LABEL: @uge_sgt(
752 ; CHECK-NEXT: [[CMP1:%.*]] = icmp uge i8 [[A:%.*]], [[B:%.*]]
753 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sgt i8 [[A]], [[B]]
754 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
755 ; CHECK-NEXT: ret i1 [[AND]]
757 %cmp1 = icmp uge i8 %a, %b
758 %cmp2 = icmp sgt i8 %a, %b
759 %and = and i1 %cmp1, %cmp2
763 define i1 @uge_sle(i8 %a, i8 %b) {
764 ; CHECK-LABEL: @uge_sle(
765 ; CHECK-NEXT: [[CMP1:%.*]] = icmp uge i8 [[A:%.*]], [[B:%.*]]
766 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sle i8 [[A]], [[B]]
767 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
768 ; CHECK-NEXT: ret i1 [[AND]]
770 %cmp1 = icmp uge i8 %a, %b
771 %cmp2 = icmp sle i8 %a, %b
772 %and = and i1 %cmp1, %cmp2
776 define i1 @uge_slt(i8 %a, i8 %b) {
777 ; CHECK-LABEL: @uge_slt(
778 ; CHECK-NEXT: [[CMP1:%.*]] = icmp uge i8 [[A:%.*]], [[B:%.*]]
779 ; CHECK-NEXT: [[CMP2:%.*]] = icmp slt i8 [[A]], [[B]]
780 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
781 ; CHECK-NEXT: ret i1 [[AND]]
783 %cmp1 = icmp uge i8 %a, %b
784 %cmp2 = icmp slt i8 %a, %b
785 %and = and i1 %cmp1, %cmp2
789 define i1 @uge_uge(i8 %a, i8 %b) {
790 ; CHECK-LABEL: @uge_uge(
791 ; CHECK-NEXT: [[CMP1:%.*]] = icmp uge i8 [[A:%.*]], [[B:%.*]]
792 ; CHECK-NEXT: ret i1 [[CMP1]]
794 %cmp1 = icmp uge i8 %a, %b
795 %cmp2 = icmp uge i8 %a, %b
796 %and = and i1 %cmp1, %cmp2
800 define i1 @uge_ugt(i8 %a, i8 %b) {
801 ; CHECK-LABEL: @uge_ugt(
802 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ugt i8 [[A:%.*]], [[B:%.*]]
803 ; CHECK-NEXT: ret i1 [[CMP2]]
805 %cmp1 = icmp uge i8 %a, %b
806 %cmp2 = icmp ugt i8 %a, %b
807 %and = and i1 %cmp1, %cmp2
811 define i1 @uge_ule(i8 %a, i8 %b) {
812 ; CHECK-LABEL: @uge_ule(
813 ; CHECK-NEXT: [[CMP1:%.*]] = icmp uge i8 [[A:%.*]], [[B:%.*]]
814 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ule i8 [[A]], [[B]]
815 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
816 ; CHECK-NEXT: ret i1 [[AND]]
818 %cmp1 = icmp uge i8 %a, %b
819 %cmp2 = icmp ule i8 %a, %b
820 %and = and i1 %cmp1, %cmp2
824 define i1 @uge_ult(i8 %a, i8 %b) {
825 ; CHECK-LABEL: @uge_ult(
826 ; CHECK-NEXT: ret i1 false
828 %cmp1 = icmp uge i8 %a, %b
829 %cmp2 = icmp ult i8 %a, %b
830 %and = and i1 %cmp1, %cmp2
836 define i1 @ugt_eq(i8 %a, i8 %b) {
837 ; CHECK-LABEL: @ugt_eq(
838 ; CHECK-NEXT: ret i1 false
840 %cmp1 = icmp ugt i8 %a, %b
841 %cmp2 = icmp eq i8 %a, %b
842 %and = and i1 %cmp1, %cmp2
846 define i1 @ugt_ne(i8 %a, i8 %b) {
847 ; CHECK-LABEL: @ugt_ne(
848 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ugt i8 [[A:%.*]], [[B:%.*]]
849 ; CHECK-NEXT: ret i1 [[CMP1]]
851 %cmp1 = icmp ugt i8 %a, %b
852 %cmp2 = icmp ne i8 %a, %b
853 %and = and i1 %cmp1, %cmp2
857 define i1 @ugt_sge(i8 %a, i8 %b) {
858 ; CHECK-LABEL: @ugt_sge(
859 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ugt i8 [[A:%.*]], [[B:%.*]]
860 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sge i8 [[A]], [[B]]
861 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
862 ; CHECK-NEXT: ret i1 [[AND]]
864 %cmp1 = icmp ugt i8 %a, %b
865 %cmp2 = icmp sge i8 %a, %b
866 %and = and i1 %cmp1, %cmp2
870 define i1 @ugt_sgt(i8 %a, i8 %b) {
871 ; CHECK-LABEL: @ugt_sgt(
872 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ugt i8 [[A:%.*]], [[B:%.*]]
873 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sgt i8 [[A]], [[B]]
874 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
875 ; CHECK-NEXT: ret i1 [[AND]]
877 %cmp1 = icmp ugt i8 %a, %b
878 %cmp2 = icmp sgt i8 %a, %b
879 %and = and i1 %cmp1, %cmp2
883 define i1 @ugt_sle(i8 %a, i8 %b) {
884 ; CHECK-LABEL: @ugt_sle(
885 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ugt i8 [[A:%.*]], [[B:%.*]]
886 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sle i8 [[A]], [[B]]
887 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
888 ; CHECK-NEXT: ret i1 [[AND]]
890 %cmp1 = icmp ugt i8 %a, %b
891 %cmp2 = icmp sle i8 %a, %b
892 %and = and i1 %cmp1, %cmp2
896 define i1 @ugt_slt(i8 %a, i8 %b) {
897 ; CHECK-LABEL: @ugt_slt(
898 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ugt i8 [[A:%.*]], [[B:%.*]]
899 ; CHECK-NEXT: [[CMP2:%.*]] = icmp slt i8 [[A]], [[B]]
900 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
901 ; CHECK-NEXT: ret i1 [[AND]]
903 %cmp1 = icmp ugt i8 %a, %b
904 %cmp2 = icmp slt i8 %a, %b
905 %and = and i1 %cmp1, %cmp2
909 define i1 @ugt_uge(i8 %a, i8 %b) {
910 ; CHECK-LABEL: @ugt_uge(
911 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ugt i8 [[A:%.*]], [[B:%.*]]
912 ; CHECK-NEXT: ret i1 [[CMP1]]
914 %cmp1 = icmp ugt i8 %a, %b
915 %cmp2 = icmp uge i8 %a, %b
916 %and = and i1 %cmp1, %cmp2
920 define i1 @ugt_ugt(i8 %a, i8 %b) {
921 ; CHECK-LABEL: @ugt_ugt(
922 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ugt i8 [[A:%.*]], [[B:%.*]]
923 ; CHECK-NEXT: ret i1 [[CMP1]]
925 %cmp1 = icmp ugt i8 %a, %b
926 %cmp2 = icmp ugt i8 %a, %b
927 %and = and i1 %cmp1, %cmp2
931 define i1 @ugt_ule(i8 %a, i8 %b) {
932 ; CHECK-LABEL: @ugt_ule(
933 ; CHECK-NEXT: ret i1 false
935 %cmp1 = icmp ugt i8 %a, %b
936 %cmp2 = icmp ule i8 %a, %b
937 %and = and i1 %cmp1, %cmp2
941 define i1 @ugt_ult(i8 %a, i8 %b) {
942 ; CHECK-LABEL: @ugt_ult(
943 ; CHECK-NEXT: ret i1 false
945 %cmp1 = icmp ugt i8 %a, %b
946 %cmp2 = icmp ult i8 %a, %b
947 %and = and i1 %cmp1, %cmp2
953 define i1 @ule_eq(i8 %a, i8 %b) {
954 ; CHECK-LABEL: @ule_eq(
955 ; CHECK-NEXT: [[CMP2:%.*]] = icmp eq i8 [[A:%.*]], [[B:%.*]]
956 ; CHECK-NEXT: ret i1 [[CMP2]]
958 %cmp1 = icmp ule i8 %a, %b
959 %cmp2 = icmp eq i8 %a, %b
960 %and = and i1 %cmp1, %cmp2
964 define i1 @ule_ne(i8 %a, i8 %b) {
965 ; CHECK-LABEL: @ule_ne(
966 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ule i8 [[A:%.*]], [[B:%.*]]
967 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ne i8 [[A]], [[B]]
968 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
969 ; CHECK-NEXT: ret i1 [[AND]]
971 %cmp1 = icmp ule i8 %a, %b
972 %cmp2 = icmp ne i8 %a, %b
973 %and = and i1 %cmp1, %cmp2
977 define i1 @ule_sge(i8 %a, i8 %b) {
978 ; CHECK-LABEL: @ule_sge(
979 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ule i8 [[A:%.*]], [[B:%.*]]
980 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sge i8 [[A]], [[B]]
981 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
982 ; CHECK-NEXT: ret i1 [[AND]]
984 %cmp1 = icmp ule i8 %a, %b
985 %cmp2 = icmp sge i8 %a, %b
986 %and = and i1 %cmp1, %cmp2
990 define i1 @ule_sgt(i8 %a, i8 %b) {
991 ; CHECK-LABEL: @ule_sgt(
992 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ule i8 [[A:%.*]], [[B:%.*]]
993 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sgt i8 [[A]], [[B]]
994 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
995 ; CHECK-NEXT: ret i1 [[AND]]
997 %cmp1 = icmp ule i8 %a, %b
998 %cmp2 = icmp sgt i8 %a, %b
999 %and = and i1 %cmp1, %cmp2
1003 define i1 @ule_sle(i8 %a, i8 %b) {
1004 ; CHECK-LABEL: @ule_sle(
1005 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ule i8 [[A:%.*]], [[B:%.*]]
1006 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sle i8 [[A]], [[B]]
1007 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
1008 ; CHECK-NEXT: ret i1 [[AND]]
1010 %cmp1 = icmp ule i8 %a, %b
1011 %cmp2 = icmp sle i8 %a, %b
1012 %and = and i1 %cmp1, %cmp2
1016 define i1 @ule_slt(i8 %a, i8 %b) {
1017 ; CHECK-LABEL: @ule_slt(
1018 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ule i8 [[A:%.*]], [[B:%.*]]
1019 ; CHECK-NEXT: [[CMP2:%.*]] = icmp slt i8 [[A]], [[B]]
1020 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
1021 ; CHECK-NEXT: ret i1 [[AND]]
1023 %cmp1 = icmp ule i8 %a, %b
1024 %cmp2 = icmp slt i8 %a, %b
1025 %and = and i1 %cmp1, %cmp2
1029 define i1 @ule_uge(i8 %a, i8 %b) {
1030 ; CHECK-LABEL: @ule_uge(
1031 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ule i8 [[A:%.*]], [[B:%.*]]
1032 ; CHECK-NEXT: [[CMP2:%.*]] = icmp uge i8 [[A]], [[B]]
1033 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
1034 ; CHECK-NEXT: ret i1 [[AND]]
1036 %cmp1 = icmp ule i8 %a, %b
1037 %cmp2 = icmp uge i8 %a, %b
1038 %and = and i1 %cmp1, %cmp2
1042 define i1 @ule_ugt(i8 %a, i8 %b) {
1043 ; CHECK-LABEL: @ule_ugt(
1044 ; CHECK-NEXT: ret i1 false
1046 %cmp1 = icmp ule i8 %a, %b
1047 %cmp2 = icmp ugt i8 %a, %b
1048 %and = and i1 %cmp1, %cmp2
1052 define i1 @ule_ule(i8 %a, i8 %b) {
1053 ; CHECK-LABEL: @ule_ule(
1054 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ule i8 [[A:%.*]], [[B:%.*]]
1055 ; CHECK-NEXT: ret i1 [[CMP1]]
1057 %cmp1 = icmp ule i8 %a, %b
1058 %cmp2 = icmp ule i8 %a, %b
1059 %and = and i1 %cmp1, %cmp2
1063 define i1 @ule_ult(i8 %a, i8 %b) {
1064 ; CHECK-LABEL: @ule_ult(
1065 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ult i8 [[A:%.*]], [[B:%.*]]
1066 ; CHECK-NEXT: ret i1 [[CMP2]]
1068 %cmp1 = icmp ule i8 %a, %b
1069 %cmp2 = icmp ult i8 %a, %b
1070 %and = and i1 %cmp1, %cmp2
1076 define i1 @ult_eq(i8 %a, i8 %b) {
1077 ; CHECK-LABEL: @ult_eq(
1078 ; CHECK-NEXT: ret i1 false
1080 %cmp1 = icmp ult i8 %a, %b
1081 %cmp2 = icmp eq i8 %a, %b
1082 %and = and i1 %cmp1, %cmp2
1086 define i1 @ult_ne(i8 %a, i8 %b) {
1087 ; CHECK-LABEL: @ult_ne(
1088 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ult i8 [[A:%.*]], [[B:%.*]]
1089 ; CHECK-NEXT: ret i1 [[CMP1]]
1091 %cmp1 = icmp ult i8 %a, %b
1092 %cmp2 = icmp ne i8 %a, %b
1093 %and = and i1 %cmp1, %cmp2
1097 define i1 @ult_sge(i8 %a, i8 %b) {
1098 ; CHECK-LABEL: @ult_sge(
1099 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ult i8 [[A:%.*]], [[B:%.*]]
1100 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sge i8 [[A]], [[B]]
1101 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
1102 ; CHECK-NEXT: ret i1 [[AND]]
1104 %cmp1 = icmp ult i8 %a, %b
1105 %cmp2 = icmp sge i8 %a, %b
1106 %and = and i1 %cmp1, %cmp2
1110 define i1 @ult_sgt(i8 %a, i8 %b) {
1111 ; CHECK-LABEL: @ult_sgt(
1112 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ult i8 [[A:%.*]], [[B:%.*]]
1113 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sgt i8 [[A]], [[B]]
1114 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
1115 ; CHECK-NEXT: ret i1 [[AND]]
1117 %cmp1 = icmp ult i8 %a, %b
1118 %cmp2 = icmp sgt i8 %a, %b
1119 %and = and i1 %cmp1, %cmp2
1123 define i1 @ult_sle(i8 %a, i8 %b) {
1124 ; CHECK-LABEL: @ult_sle(
1125 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ult i8 [[A:%.*]], [[B:%.*]]
1126 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sle i8 [[A]], [[B]]
1127 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
1128 ; CHECK-NEXT: ret i1 [[AND]]
1130 %cmp1 = icmp ult i8 %a, %b
1131 %cmp2 = icmp sle i8 %a, %b
1132 %and = and i1 %cmp1, %cmp2
1136 define i1 @ult_slt(i8 %a, i8 %b) {
1137 ; CHECK-LABEL: @ult_slt(
1138 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ult i8 [[A:%.*]], [[B:%.*]]
1139 ; CHECK-NEXT: [[CMP2:%.*]] = icmp slt i8 [[A]], [[B]]
1140 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[CMP1]], [[CMP2]]
1141 ; CHECK-NEXT: ret i1 [[AND]]
1143 %cmp1 = icmp ult i8 %a, %b
1144 %cmp2 = icmp slt i8 %a, %b
1145 %and = and i1 %cmp1, %cmp2
1149 define i1 @ult_uge(i8 %a, i8 %b) {
1150 ; CHECK-LABEL: @ult_uge(
1151 ; CHECK-NEXT: ret i1 false
1153 %cmp1 = icmp ult i8 %a, %b
1154 %cmp2 = icmp uge i8 %a, %b
1155 %and = and i1 %cmp1, %cmp2
1159 define i1 @ult_ugt(i8 %a, i8 %b) {
1160 ; CHECK-LABEL: @ult_ugt(
1161 ; CHECK-NEXT: ret i1 false
1163 %cmp1 = icmp ult i8 %a, %b
1164 %cmp2 = icmp ugt i8 %a, %b
1165 %and = and i1 %cmp1, %cmp2
1169 define i1 @ult_ule(i8 %a, i8 %b) {
1170 ; CHECK-LABEL: @ult_ule(
1171 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ult i8 [[A:%.*]], [[B:%.*]]
1172 ; CHECK-NEXT: ret i1 [[CMP1]]
1174 %cmp1 = icmp ult i8 %a, %b
1175 %cmp2 = icmp ule i8 %a, %b
1176 %and = and i1 %cmp1, %cmp2
1180 define i1 @ult_ult(i8 %a, i8 %b) {
1181 ; CHECK-LABEL: @ult_ult(
1182 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ult i8 [[A:%.*]], [[B:%.*]]
1183 ; CHECK-NEXT: ret i1 [[CMP1]]
1185 %cmp1 = icmp ult i8 %a, %b
1186 %cmp2 = icmp ult i8 %a, %b
1187 %and = and i1 %cmp1, %cmp2
1191 ; Check a couple of vector variants to make sure those work too.
1193 define <2 x i1> @ult_uge_vec(<2 x i8> %a, <2 x i8> %b) {
1194 ; CHECK-LABEL: @ult_uge_vec(
1195 ; CHECK-NEXT: ret <2 x i1> zeroinitializer
1197 %cmp1 = icmp ult <2 x i8> %a, %b
1198 %cmp2 = icmp uge <2 x i8> %a, %b
1199 %and = and <2 x i1> %cmp1, %cmp2
1203 define <2 x i1> @ult_ule_vec(<2 x i8> %a, <2 x i8> %b) {
1204 ; CHECK-LABEL: @ult_ule_vec(
1205 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ult <2 x i8> [[A:%.*]], [[B:%.*]]
1206 ; CHECK-NEXT: ret <2 x i1> [[CMP1]]
1208 %cmp1 = icmp ult <2 x i8> %a, %b
1209 %cmp2 = icmp ule <2 x i8> %a, %b
1210 %and = and <2 x i1> %cmp1, %cmp2
1214 define i1 @ult_uge_swap(i8 %a, i8 %b) {
1215 ; CHECK-LABEL: @ult_uge_swap(
1216 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ult i8 [[A:%.*]], [[B:%.*]]
1217 ; CHECK-NEXT: ret i1 [[CMP1]]
1219 %cmp1 = icmp ult i8 %a, %b
1220 %cmp2 = icmp uge i8 %b, %a
1221 %and = and i1 %cmp1, %cmp2
1225 define i1 @ult_ult_swap(i8 %a, i8 %b) {
1226 ; CHECK-LABEL: @ult_ult_swap(
1227 ; CHECK-NEXT: ret i1 false
1229 %cmp1 = icmp ult i8 %a, %b
1230 %cmp2 = icmp ult i8 %b, %a
1231 %and = and i1 %cmp1, %cmp2