• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt < %s -instsimplify -S | FileCheck %s
2
3; Cycle through all pairs of predicates to test
4; simplification of range-intersection or range-union.
5
6; eq
7; x == 13 && x == 17
8
9define i1 @and_eq_eq(i8 %x) {
10; CHECK-LABEL: @and_eq_eq(
11; CHECK-NEXT:    ret i1 false
12;
13  %a = icmp eq i8 %x, 13
14  %b = icmp eq i8 %x, 17
15  %c = and i1 %a, %b
16  ret i1 %c
17}
18
19; x == 13 && x != 17
20
21define i1 @and_eq_ne(i8 %x) {
22; CHECK-LABEL: @and_eq_ne(
23; CHECK-NEXT:    [[A:%.*]] = icmp eq i8 %x, 13
24; CHECK-NEXT:    ret i1 [[A]]
25;
26  %a = icmp eq i8 %x, 13
27  %b = icmp ne i8 %x, 17
28  %c = and i1 %a, %b
29  ret i1 %c
30}
31
32; x == 13 && x >=s 17
33
34define i1 @and_eq_sge(i8 %x) {
35; CHECK-LABEL: @and_eq_sge(
36; CHECK-NEXT:    ret i1 false
37;
38  %a = icmp eq i8 %x, 13
39  %b = icmp sge i8 %x, 17
40  %c = and i1 %a, %b
41  ret i1 %c
42}
43
44; x == 13 && x >s 17
45
46define i1 @and_eq_sgt(i8 %x) {
47; CHECK-LABEL: @and_eq_sgt(
48; CHECK-NEXT:    ret i1 false
49;
50  %a = icmp eq i8 %x, 13
51  %b = icmp sgt i8 %x, 17
52  %c = and i1 %a, %b
53  ret i1 %c
54}
55
56; x == 13 && x <=s 17
57
58define i1 @and_eq_sle(i8 %x) {
59; CHECK-LABEL: @and_eq_sle(
60; CHECK-NEXT:    [[A:%.*]] = icmp eq i8 %x, 13
61; CHECK-NEXT:    ret i1 [[A]]
62;
63  %a = icmp eq i8 %x, 13
64  %b = icmp sle i8 %x, 17
65  %c = and i1 %a, %b
66  ret i1 %c
67}
68
69; x == 13 && x <s 17
70
71define i1 @and_eq_slt(i8 %x) {
72; CHECK-LABEL: @and_eq_slt(
73; CHECK-NEXT:    [[A:%.*]] = icmp eq i8 %x, 13
74; CHECK-NEXT:    ret i1 [[A]]
75;
76  %a = icmp eq i8 %x, 13
77  %b = icmp slt i8 %x, 17
78  %c = and i1 %a, %b
79  ret i1 %c
80}
81
82; x == 13 && x >=u 17
83
84define i1 @and_eq_uge(i8 %x) {
85; CHECK-LABEL: @and_eq_uge(
86; CHECK-NEXT:    ret i1 false
87;
88  %a = icmp eq i8 %x, 13
89  %b = icmp uge i8 %x, 17
90  %c = and i1 %a, %b
91  ret i1 %c
92}
93
94; x == 13 && x >u 17
95
96define i1 @and_eq_ugt(i8 %x) {
97; CHECK-LABEL: @and_eq_ugt(
98; CHECK-NEXT:    ret i1 false
99;
100  %a = icmp eq i8 %x, 13
101  %b = icmp ugt i8 %x, 17
102  %c = and i1 %a, %b
103  ret i1 %c
104}
105
106; x == 13 && x <=u 17
107
108define i1 @and_eq_ule(i8 %x) {
109; CHECK-LABEL: @and_eq_ule(
110; CHECK-NEXT:    [[A:%.*]] = icmp eq i8 %x, 13
111; CHECK-NEXT:    ret i1 [[A]]
112;
113  %a = icmp eq i8 %x, 13
114  %b = icmp ule i8 %x, 17
115  %c = and i1 %a, %b
116  ret i1 %c
117}
118
119; x == 13 && x <u 17
120
121define i1 @and_eq_ult(i8 %x) {
122; CHECK-LABEL: @and_eq_ult(
123; CHECK-NEXT:    [[A:%.*]] = icmp eq i8 %x, 13
124; CHECK-NEXT:    ret i1 [[A]]
125;
126  %a = icmp eq i8 %x, 13
127  %b = icmp ult i8 %x, 17
128  %c = and i1 %a, %b
129  ret i1 %c
130}
131
132; ne
133; x != 13 && x == 17
134
135define i1 @and_ne_eq(i8 %x) {
136; CHECK-LABEL: @and_ne_eq(
137; CHECK-NEXT:    [[B:%.*]] = icmp eq i8 %x, 17
138; CHECK-NEXT:    ret i1 [[B]]
139;
140  %a = icmp ne i8 %x, 13
141  %b = icmp eq i8 %x, 17
142  %c = and i1 %a, %b
143  ret i1 %c
144}
145
146; x != 13 && x != 17
147
148define i1 @and_ne_ne(i8 %x) {
149; CHECK-LABEL: @and_ne_ne(
150; CHECK-NEXT:    [[A:%.*]] = icmp ne i8 %x, 13
151; CHECK-NEXT:    [[B:%.*]] = icmp ne i8 %x, 17
152; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
153; CHECK-NEXT:    ret i1 [[C]]
154;
155  %a = icmp ne i8 %x, 13
156  %b = icmp ne i8 %x, 17
157  %c = and i1 %a, %b
158  ret i1 %c
159}
160
161; x != 13 && x >=s 17
162
163define i1 @and_ne_sge(i8 %x) {
164; CHECK-LABEL: @and_ne_sge(
165; CHECK-NEXT:    [[B:%.*]] = icmp sge i8 %x, 17
166; CHECK-NEXT:    ret i1 [[B]]
167;
168  %a = icmp ne i8 %x, 13
169  %b = icmp sge i8 %x, 17
170  %c = and i1 %a, %b
171  ret i1 %c
172}
173
174; x != 13 && x >s 17
175
176define i1 @and_ne_sgt(i8 %x) {
177; CHECK-LABEL: @and_ne_sgt(
178; CHECK-NEXT:    [[B:%.*]] = icmp sgt i8 %x, 17
179; CHECK-NEXT:    ret i1 [[B]]
180;
181  %a = icmp ne i8 %x, 13
182  %b = icmp sgt i8 %x, 17
183  %c = and i1 %a, %b
184  ret i1 %c
185}
186
187; x != 13 && x <=s 17
188
189define i1 @and_ne_sle(i8 %x) {
190; CHECK-LABEL: @and_ne_sle(
191; CHECK-NEXT:    [[A:%.*]] = icmp ne i8 %x, 13
192; CHECK-NEXT:    [[B:%.*]] = icmp sle i8 %x, 17
193; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
194; CHECK-NEXT:    ret i1 [[C]]
195;
196  %a = icmp ne i8 %x, 13
197  %b = icmp sle i8 %x, 17
198  %c = and i1 %a, %b
199  ret i1 %c
200}
201
202; x != 13 && x <s 17
203
204define i1 @and_ne_slt(i8 %x) {
205; CHECK-LABEL: @and_ne_slt(
206; CHECK-NEXT:    [[A:%.*]] = icmp ne i8 %x, 13
207; CHECK-NEXT:    [[B:%.*]] = icmp slt i8 %x, 17
208; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
209; CHECK-NEXT:    ret i1 [[C]]
210;
211  %a = icmp ne i8 %x, 13
212  %b = icmp slt i8 %x, 17
213  %c = and i1 %a, %b
214  ret i1 %c
215}
216
217; x != 13 && x >=u 17
218
219define i1 @and_ne_uge(i8 %x) {
220; CHECK-LABEL: @and_ne_uge(
221; CHECK-NEXT:    [[B:%.*]] = icmp uge i8 %x, 17
222; CHECK-NEXT:    ret i1 [[B]]
223;
224  %a = icmp ne i8 %x, 13
225  %b = icmp uge i8 %x, 17
226  %c = and i1 %a, %b
227  ret i1 %c
228}
229
230; x != 13 && x >u 17
231
232define i1 @and_ne_ugt(i8 %x) {
233; CHECK-LABEL: @and_ne_ugt(
234; CHECK-NEXT:    [[B:%.*]] = icmp ugt i8 %x, 17
235; CHECK-NEXT:    ret i1 [[B]]
236;
237  %a = icmp ne i8 %x, 13
238  %b = icmp ugt i8 %x, 17
239  %c = and i1 %a, %b
240  ret i1 %c
241}
242
243; x != 13 && x <=u 17
244
245define i1 @and_ne_ule(i8 %x) {
246; CHECK-LABEL: @and_ne_ule(
247; CHECK-NEXT:    [[A:%.*]] = icmp ne i8 %x, 13
248; CHECK-NEXT:    [[B:%.*]] = icmp ule i8 %x, 17
249; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
250; CHECK-NEXT:    ret i1 [[C]]
251;
252  %a = icmp ne i8 %x, 13
253  %b = icmp ule i8 %x, 17
254  %c = and i1 %a, %b
255  ret i1 %c
256}
257
258; x != 13 && x <u 17
259
260define i1 @and_ne_ult(i8 %x) {
261; CHECK-LABEL: @and_ne_ult(
262; CHECK-NEXT:    [[A:%.*]] = icmp ne i8 %x, 13
263; CHECK-NEXT:    [[B:%.*]] = icmp ult i8 %x, 17
264; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
265; CHECK-NEXT:    ret i1 [[C]]
266;
267  %a = icmp ne i8 %x, 13
268  %b = icmp ult i8 %x, 17
269  %c = and i1 %a, %b
270  ret i1 %c
271}
272
273; sge
274; x >=s 13 && x == 17
275
276define i1 @and_sge_eq(i8 %x) {
277; CHECK-LABEL: @and_sge_eq(
278; CHECK-NEXT:    [[B:%.*]] = icmp eq i8 %x, 17
279; CHECK-NEXT:    ret i1 [[B]]
280;
281  %a = icmp sge i8 %x, 13
282  %b = icmp eq i8 %x, 17
283  %c = and i1 %a, %b
284  ret i1 %c
285}
286
287; x >=s 13 && x != 17
288
289define i1 @and_sge_ne(i8 %x) {
290; CHECK-LABEL: @and_sge_ne(
291; CHECK-NEXT:    [[A:%.*]] = icmp sge i8 %x, 13
292; CHECK-NEXT:    [[B:%.*]] = icmp ne i8 %x, 17
293; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
294; CHECK-NEXT:    ret i1 [[C]]
295;
296  %a = icmp sge i8 %x, 13
297  %b = icmp ne i8 %x, 17
298  %c = and i1 %a, %b
299  ret i1 %c
300}
301
302; x >=s 13 && x >=s 17
303
304define i1 @and_sge_sge(i8 %x) {
305; CHECK-LABEL: @and_sge_sge(
306; CHECK-NEXT:    [[B:%.*]] = icmp sge i8 %x, 17
307; CHECK-NEXT:    ret i1 [[B]]
308;
309  %a = icmp sge i8 %x, 13
310  %b = icmp sge i8 %x, 17
311  %c = and i1 %a, %b
312  ret i1 %c
313}
314
315; x >=s 13 && x >s 17
316
317define i1 @and_sge_sgt(i8 %x) {
318; CHECK-LABEL: @and_sge_sgt(
319; CHECK-NEXT:    [[B:%.*]] = icmp sgt i8 %x, 17
320; CHECK-NEXT:    ret i1 [[B]]
321;
322  %a = icmp sge i8 %x, 13
323  %b = icmp sgt i8 %x, 17
324  %c = and i1 %a, %b
325  ret i1 %c
326}
327
328; x >=s 13 && x <=s 17
329
330define i1 @and_sge_sle(i8 %x) {
331; CHECK-LABEL: @and_sge_sle(
332; CHECK-NEXT:    [[A:%.*]] = icmp sge i8 %x, 13
333; CHECK-NEXT:    [[B:%.*]] = icmp sle i8 %x, 17
334; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
335; CHECK-NEXT:    ret i1 [[C]]
336;
337  %a = icmp sge i8 %x, 13
338  %b = icmp sle i8 %x, 17
339  %c = and i1 %a, %b
340  ret i1 %c
341}
342
343; x >=s 13 && x <s 17
344
345define i1 @and_sge_slt(i8 %x) {
346; CHECK-LABEL: @and_sge_slt(
347; CHECK-NEXT:    [[A:%.*]] = icmp sge i8 %x, 13
348; CHECK-NEXT:    [[B:%.*]] = icmp slt i8 %x, 17
349; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
350; CHECK-NEXT:    ret i1 [[C]]
351;
352  %a = icmp sge i8 %x, 13
353  %b = icmp slt i8 %x, 17
354  %c = and i1 %a, %b
355  ret i1 %c
356}
357
358; x >=s 13 && x >=u 17
359
360define i1 @and_sge_uge(i8 %x) {
361; CHECK-LABEL: @and_sge_uge(
362; CHECK-NEXT:    [[A:%.*]] = icmp sge i8 %x, 13
363; CHECK-NEXT:    [[B:%.*]] = icmp uge i8 %x, 17
364; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
365; CHECK-NEXT:    ret i1 [[C]]
366;
367  %a = icmp sge i8 %x, 13
368  %b = icmp uge i8 %x, 17
369  %c = and i1 %a, %b
370  ret i1 %c
371}
372
373; x >=s 13 && x >u 17
374
375define i1 @and_sge_ugt(i8 %x) {
376; CHECK-LABEL: @and_sge_ugt(
377; CHECK-NEXT:    [[A:%.*]] = icmp sge i8 %x, 13
378; CHECK-NEXT:    [[B:%.*]] = icmp ugt i8 %x, 17
379; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
380; CHECK-NEXT:    ret i1 [[C]]
381;
382  %a = icmp sge i8 %x, 13
383  %b = icmp ugt i8 %x, 17
384  %c = and i1 %a, %b
385  ret i1 %c
386}
387
388; x >=s 13 && x <=u 17
389
390define i1 @and_sge_ule(i8 %x) {
391; CHECK-LABEL: @and_sge_ule(
392; CHECK-NEXT:    [[A:%.*]] = icmp sge i8 %x, 13
393; CHECK-NEXT:    [[B:%.*]] = icmp ule i8 %x, 17
394; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
395; CHECK-NEXT:    ret i1 [[C]]
396;
397  %a = icmp sge i8 %x, 13
398  %b = icmp ule i8 %x, 17
399  %c = and i1 %a, %b
400  ret i1 %c
401}
402
403; x >=s 13 && x <u 17
404
405define i1 @and_sge_ult(i8 %x) {
406; CHECK-LABEL: @and_sge_ult(
407; CHECK-NEXT:    [[A:%.*]] = icmp sge i8 %x, 13
408; CHECK-NEXT:    [[B:%.*]] = icmp ult i8 %x, 17
409; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
410; CHECK-NEXT:    ret i1 [[C]]
411;
412  %a = icmp sge i8 %x, 13
413  %b = icmp ult i8 %x, 17
414  %c = and i1 %a, %b
415  ret i1 %c
416}
417
418; sgt
419; x >s 13 && x == 17
420
421define i1 @and_sgt_eq(i8 %x) {
422; CHECK-LABEL: @and_sgt_eq(
423; CHECK-NEXT:    [[B:%.*]] = icmp eq i8 %x, 17
424; CHECK-NEXT:    ret i1 [[B]]
425;
426  %a = icmp sgt i8 %x, 13
427  %b = icmp eq i8 %x, 17
428  %c = and i1 %a, %b
429  ret i1 %c
430}
431
432; x >s 13 && x != 17
433
434define i1 @and_sgt_ne(i8 %x) {
435; CHECK-LABEL: @and_sgt_ne(
436; CHECK-NEXT:    [[A:%.*]] = icmp sgt i8 %x, 13
437; CHECK-NEXT:    [[B:%.*]] = icmp ne i8 %x, 17
438; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
439; CHECK-NEXT:    ret i1 [[C]]
440;
441  %a = icmp sgt i8 %x, 13
442  %b = icmp ne i8 %x, 17
443  %c = and i1 %a, %b
444  ret i1 %c
445}
446
447; x >s 13 && x >=s 17
448
449define i1 @and_sgt_sge(i8 %x) {
450; CHECK-LABEL: @and_sgt_sge(
451; CHECK-NEXT:    [[B:%.*]] = icmp sge i8 %x, 17
452; CHECK-NEXT:    ret i1 [[B]]
453;
454  %a = icmp sgt i8 %x, 13
455  %b = icmp sge i8 %x, 17
456  %c = and i1 %a, %b
457  ret i1 %c
458}
459
460; x >s 13 && x >s 17
461
462define i1 @and_sgt_sgt(i8 %x) {
463; CHECK-LABEL: @and_sgt_sgt(
464; CHECK-NEXT:    [[B:%.*]] = icmp sgt i8 %x, 17
465; CHECK-NEXT:    ret i1 [[B]]
466;
467  %a = icmp sgt i8 %x, 13
468  %b = icmp sgt i8 %x, 17
469  %c = and i1 %a, %b
470  ret i1 %c
471}
472
473; x >s 13 && x <=s 17
474
475define i1 @and_sgt_sle(i8 %x) {
476; CHECK-LABEL: @and_sgt_sle(
477; CHECK-NEXT:    [[A:%.*]] = icmp sgt i8 %x, 13
478; CHECK-NEXT:    [[B:%.*]] = icmp sle i8 %x, 17
479; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
480; CHECK-NEXT:    ret i1 [[C]]
481;
482  %a = icmp sgt i8 %x, 13
483  %b = icmp sle i8 %x, 17
484  %c = and i1 %a, %b
485  ret i1 %c
486}
487
488; x >s 13 && x <s 17
489
490define i1 @and_sgt_slt(i8 %x) {
491; CHECK-LABEL: @and_sgt_slt(
492; CHECK-NEXT:    [[A:%.*]] = icmp sgt i8 %x, 13
493; CHECK-NEXT:    [[B:%.*]] = icmp slt i8 %x, 17
494; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
495; CHECK-NEXT:    ret i1 [[C]]
496;
497  %a = icmp sgt i8 %x, 13
498  %b = icmp slt i8 %x, 17
499  %c = and i1 %a, %b
500  ret i1 %c
501}
502
503; x >s 13 && x >=u 17
504
505define i1 @and_sgt_uge(i8 %x) {
506; CHECK-LABEL: @and_sgt_uge(
507; CHECK-NEXT:    [[A:%.*]] = icmp sgt i8 %x, 13
508; CHECK-NEXT:    [[B:%.*]] = icmp uge i8 %x, 17
509; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
510; CHECK-NEXT:    ret i1 [[C]]
511;
512  %a = icmp sgt i8 %x, 13
513  %b = icmp uge i8 %x, 17
514  %c = and i1 %a, %b
515  ret i1 %c
516}
517
518; x >s 13 && x >u 17
519
520define i1 @and_sgt_ugt(i8 %x) {
521; CHECK-LABEL: @and_sgt_ugt(
522; CHECK-NEXT:    [[A:%.*]] = icmp sgt i8 %x, 13
523; CHECK-NEXT:    [[B:%.*]] = icmp ugt i8 %x, 17
524; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
525; CHECK-NEXT:    ret i1 [[C]]
526;
527  %a = icmp sgt i8 %x, 13
528  %b = icmp ugt i8 %x, 17
529  %c = and i1 %a, %b
530  ret i1 %c
531}
532
533; x >s 13 && x <=u 17
534
535define i1 @and_sgt_ule(i8 %x) {
536; CHECK-LABEL: @and_sgt_ule(
537; CHECK-NEXT:    [[A:%.*]] = icmp sgt i8 %x, 13
538; CHECK-NEXT:    [[B:%.*]] = icmp ule i8 %x, 17
539; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
540; CHECK-NEXT:    ret i1 [[C]]
541;
542  %a = icmp sgt i8 %x, 13
543  %b = icmp ule i8 %x, 17
544  %c = and i1 %a, %b
545  ret i1 %c
546}
547
548; x >s 13 && x <u 17
549
550define i1 @and_sgt_ult(i8 %x) {
551; CHECK-LABEL: @and_sgt_ult(
552; CHECK-NEXT:    [[A:%.*]] = icmp sgt i8 %x, 13
553; CHECK-NEXT:    [[B:%.*]] = icmp ult i8 %x, 17
554; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
555; CHECK-NEXT:    ret i1 [[C]]
556;
557  %a = icmp sgt i8 %x, 13
558  %b = icmp ult i8 %x, 17
559  %c = and i1 %a, %b
560  ret i1 %c
561}
562
563; sle
564; x <=s 13 && x == 17
565
566define i1 @and_sle_eq(i8 %x) {
567; CHECK-LABEL: @and_sle_eq(
568; CHECK-NEXT:    ret i1 false
569;
570  %a = icmp sle i8 %x, 13
571  %b = icmp eq i8 %x, 17
572  %c = and i1 %a, %b
573  ret i1 %c
574}
575
576; x <=s 13 && x != 17
577
578define i1 @and_sle_ne(i8 %x) {
579; CHECK-LABEL: @and_sle_ne(
580; CHECK-NEXT:    [[A:%.*]] = icmp sle i8 %x, 13
581; CHECK-NEXT:    ret i1 [[A]]
582;
583  %a = icmp sle i8 %x, 13
584  %b = icmp ne i8 %x, 17
585  %c = and i1 %a, %b
586  ret i1 %c
587}
588
589; x <=s 13 && x >=s 17
590
591define i1 @and_sle_sge(i8 %x) {
592; CHECK-LABEL: @and_sle_sge(
593; CHECK-NEXT:    ret i1 false
594;
595  %a = icmp sle i8 %x, 13
596  %b = icmp sge i8 %x, 17
597  %c = and i1 %a, %b
598  ret i1 %c
599}
600
601; x <=s 13 && x >s 17
602
603define i1 @and_sle_sgt(i8 %x) {
604; CHECK-LABEL: @and_sle_sgt(
605; CHECK-NEXT:    ret i1 false
606;
607  %a = icmp sle i8 %x, 13
608  %b = icmp sgt i8 %x, 17
609  %c = and i1 %a, %b
610  ret i1 %c
611}
612
613; x <=s 13 && x <=s 17
614
615define i1 @and_sle_sle(i8 %x) {
616; CHECK-LABEL: @and_sle_sle(
617; CHECK-NEXT:    [[A:%.*]] = icmp sle i8 %x, 13
618; CHECK-NEXT:    ret i1 [[A]]
619;
620  %a = icmp sle i8 %x, 13
621  %b = icmp sle i8 %x, 17
622  %c = and i1 %a, %b
623  ret i1 %c
624}
625
626; x <=s 13 && x <s 17
627
628define i1 @and_sle_slt(i8 %x) {
629; CHECK-LABEL: @and_sle_slt(
630; CHECK-NEXT:    [[A:%.*]] = icmp sle i8 %x, 13
631; CHECK-NEXT:    ret i1 [[A]]
632;
633  %a = icmp sle i8 %x, 13
634  %b = icmp slt i8 %x, 17
635  %c = and i1 %a, %b
636  ret i1 %c
637}
638
639; x <=s 13 && x >=u 17
640
641define i1 @and_sle_uge(i8 %x) {
642; CHECK-LABEL: @and_sle_uge(
643; CHECK-NEXT:    [[A:%.*]] = icmp sle i8 %x, 13
644; CHECK-NEXT:    [[B:%.*]] = icmp uge i8 %x, 17
645; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
646; CHECK-NEXT:    ret i1 [[C]]
647;
648  %a = icmp sle i8 %x, 13
649  %b = icmp uge i8 %x, 17
650  %c = and i1 %a, %b
651  ret i1 %c
652}
653
654; x <=s 13 && x >u 17
655
656define i1 @and_sle_ugt(i8 %x) {
657; CHECK-LABEL: @and_sle_ugt(
658; CHECK-NEXT:    [[A:%.*]] = icmp sle i8 %x, 13
659; CHECK-NEXT:    [[B:%.*]] = icmp ugt i8 %x, 17
660; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
661; CHECK-NEXT:    ret i1 [[C]]
662;
663  %a = icmp sle i8 %x, 13
664  %b = icmp ugt i8 %x, 17
665  %c = and i1 %a, %b
666  ret i1 %c
667}
668
669; x <=s 13 && x <=u 17
670
671define i1 @and_sle_ule(i8 %x) {
672; CHECK-LABEL: @and_sle_ule(
673; CHECK-NEXT:    [[A:%.*]] = icmp sle i8 %x, 13
674; CHECK-NEXT:    [[B:%.*]] = icmp ule i8 %x, 17
675; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
676; CHECK-NEXT:    ret i1 [[C]]
677;
678  %a = icmp sle i8 %x, 13
679  %b = icmp ule i8 %x, 17
680  %c = and i1 %a, %b
681  ret i1 %c
682}
683
684; x <=s 13 && x <u 17
685
686define i1 @and_sle_ult(i8 %x) {
687; CHECK-LABEL: @and_sle_ult(
688; CHECK-NEXT:    [[A:%.*]] = icmp sle i8 %x, 13
689; CHECK-NEXT:    [[B:%.*]] = icmp ult i8 %x, 17
690; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
691; CHECK-NEXT:    ret i1 [[C]]
692;
693  %a = icmp sle i8 %x, 13
694  %b = icmp ult i8 %x, 17
695  %c = and i1 %a, %b
696  ret i1 %c
697}
698
699; slt
700; x <s 13 && x == 17
701
702define i1 @and_slt_eq(i8 %x) {
703; CHECK-LABEL: @and_slt_eq(
704; CHECK-NEXT:    ret i1 false
705;
706  %a = icmp slt i8 %x, 13
707  %b = icmp eq i8 %x, 17
708  %c = and i1 %a, %b
709  ret i1 %c
710}
711
712; x <s 13 && x != 17
713
714define i1 @and_slt_ne(i8 %x) {
715; CHECK-LABEL: @and_slt_ne(
716; CHECK-NEXT:    [[A:%.*]] = icmp slt i8 %x, 13
717; CHECK-NEXT:    ret i1 [[A]]
718;
719  %a = icmp slt i8 %x, 13
720  %b = icmp ne i8 %x, 17
721  %c = and i1 %a, %b
722  ret i1 %c
723}
724
725; x <s 13 && x >=s 17
726
727define i1 @and_slt_sge(i8 %x) {
728; CHECK-LABEL: @and_slt_sge(
729; CHECK-NEXT:    ret i1 false
730;
731  %a = icmp slt i8 %x, 13
732  %b = icmp sge i8 %x, 17
733  %c = and i1 %a, %b
734  ret i1 %c
735}
736
737; x <s 13 && x >s 17
738
739define i1 @and_slt_sgt(i8 %x) {
740; CHECK-LABEL: @and_slt_sgt(
741; CHECK-NEXT:    ret i1 false
742;
743  %a = icmp slt i8 %x, 13
744  %b = icmp sgt i8 %x, 17
745  %c = and i1 %a, %b
746  ret i1 %c
747}
748
749; x <s 13 && x <=s 17
750
751define i1 @and_slt_sle(i8 %x) {
752; CHECK-LABEL: @and_slt_sle(
753; CHECK-NEXT:    [[A:%.*]] = icmp slt i8 %x, 13
754; CHECK-NEXT:    ret i1 [[A]]
755;
756  %a = icmp slt i8 %x, 13
757  %b = icmp sle i8 %x, 17
758  %c = and i1 %a, %b
759  ret i1 %c
760}
761
762; x <s 13 && x <s 17
763
764define i1 @and_slt_slt(i8 %x) {
765; CHECK-LABEL: @and_slt_slt(
766; CHECK-NEXT:    [[A:%.*]] = icmp slt i8 %x, 13
767; CHECK-NEXT:    ret i1 [[A]]
768;
769  %a = icmp slt i8 %x, 13
770  %b = icmp slt i8 %x, 17
771  %c = and i1 %a, %b
772  ret i1 %c
773}
774
775; x <s 13 && x >=u 17
776
777define i1 @and_slt_uge(i8 %x) {
778; CHECK-LABEL: @and_slt_uge(
779; CHECK-NEXT:    [[A:%.*]] = icmp slt i8 %x, 13
780; CHECK-NEXT:    [[B:%.*]] = icmp uge i8 %x, 17
781; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
782; CHECK-NEXT:    ret i1 [[C]]
783;
784  %a = icmp slt i8 %x, 13
785  %b = icmp uge i8 %x, 17
786  %c = and i1 %a, %b
787  ret i1 %c
788}
789
790; x <s 13 && x >u 17
791
792define i1 @and_slt_ugt(i8 %x) {
793; CHECK-LABEL: @and_slt_ugt(
794; CHECK-NEXT:    [[A:%.*]] = icmp slt i8 %x, 13
795; CHECK-NEXT:    [[B:%.*]] = icmp ugt i8 %x, 17
796; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
797; CHECK-NEXT:    ret i1 [[C]]
798;
799  %a = icmp slt i8 %x, 13
800  %b = icmp ugt i8 %x, 17
801  %c = and i1 %a, %b
802  ret i1 %c
803}
804
805; x <s 13 && x <=u 17
806
807define i1 @and_slt_ule(i8 %x) {
808; CHECK-LABEL: @and_slt_ule(
809; CHECK-NEXT:    [[A:%.*]] = icmp slt i8 %x, 13
810; CHECK-NEXT:    [[B:%.*]] = icmp ule i8 %x, 17
811; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
812; CHECK-NEXT:    ret i1 [[C]]
813;
814  %a = icmp slt i8 %x, 13
815  %b = icmp ule i8 %x, 17
816  %c = and i1 %a, %b
817  ret i1 %c
818}
819
820; x <s 13 && x <u 17
821
822define i1 @and_slt_ult(i8 %x) {
823; CHECK-LABEL: @and_slt_ult(
824; CHECK-NEXT:    [[A:%.*]] = icmp slt i8 %x, 13
825; CHECK-NEXT:    [[B:%.*]] = icmp ult i8 %x, 17
826; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
827; CHECK-NEXT:    ret i1 [[C]]
828;
829  %a = icmp slt i8 %x, 13
830  %b = icmp ult i8 %x, 17
831  %c = and i1 %a, %b
832  ret i1 %c
833}
834
835; uge
836; x >=u 13 && x == 17
837
838define i1 @and_uge_eq(i8 %x) {
839; CHECK-LABEL: @and_uge_eq(
840; CHECK-NEXT:    [[B:%.*]] = icmp eq i8 %x, 17
841; CHECK-NEXT:    ret i1 [[B]]
842;
843  %a = icmp uge i8 %x, 13
844  %b = icmp eq i8 %x, 17
845  %c = and i1 %a, %b
846  ret i1 %c
847}
848
849; x >=u 13 && x != 17
850
851define i1 @and_uge_ne(i8 %x) {
852; CHECK-LABEL: @and_uge_ne(
853; CHECK-NEXT:    [[A:%.*]] = icmp uge i8 %x, 13
854; CHECK-NEXT:    [[B:%.*]] = icmp ne i8 %x, 17
855; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
856; CHECK-NEXT:    ret i1 [[C]]
857;
858  %a = icmp uge i8 %x, 13
859  %b = icmp ne i8 %x, 17
860  %c = and i1 %a, %b
861  ret i1 %c
862}
863
864; x >=u 13 && x >=s 17
865
866define i1 @and_uge_sge(i8 %x) {
867; CHECK-LABEL: @and_uge_sge(
868; CHECK-NEXT:    [[B:%.*]] = icmp sge i8 %x, 17
869; CHECK-NEXT:    ret i1 [[B]]
870;
871  %a = icmp uge i8 %x, 13
872  %b = icmp sge i8 %x, 17
873  %c = and i1 %a, %b
874  ret i1 %c
875}
876
877; x >=u 13 && x >s 17
878
879define i1 @and_uge_sgt(i8 %x) {
880; CHECK-LABEL: @and_uge_sgt(
881; CHECK-NEXT:    [[B:%.*]] = icmp sgt i8 %x, 17
882; CHECK-NEXT:    ret i1 [[B]]
883;
884  %a = icmp uge i8 %x, 13
885  %b = icmp sgt i8 %x, 17
886  %c = and i1 %a, %b
887  ret i1 %c
888}
889
890; x >=u 13 && x <=s 17
891
892define i1 @and_uge_sle(i8 %x) {
893; CHECK-LABEL: @and_uge_sle(
894; CHECK-NEXT:    [[A:%.*]] = icmp uge i8 %x, 13
895; CHECK-NEXT:    [[B:%.*]] = icmp sle i8 %x, 17
896; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
897; CHECK-NEXT:    ret i1 [[C]]
898;
899  %a = icmp uge i8 %x, 13
900  %b = icmp sle i8 %x, 17
901  %c = and i1 %a, %b
902  ret i1 %c
903}
904
905; x >=u 13 && x <s 17
906
907define i1 @and_uge_slt(i8 %x) {
908; CHECK-LABEL: @and_uge_slt(
909; CHECK-NEXT:    [[A:%.*]] = icmp uge i8 %x, 13
910; CHECK-NEXT:    [[B:%.*]] = icmp slt i8 %x, 17
911; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
912; CHECK-NEXT:    ret i1 [[C]]
913;
914  %a = icmp uge i8 %x, 13
915  %b = icmp slt i8 %x, 17
916  %c = and i1 %a, %b
917  ret i1 %c
918}
919
920; x >=u 13 && x >=u 17
921
922define i1 @and_uge_uge(i8 %x) {
923; CHECK-LABEL: @and_uge_uge(
924; CHECK-NEXT:    [[B:%.*]] = icmp uge i8 %x, 17
925; CHECK-NEXT:    ret i1 [[B]]
926;
927  %a = icmp uge i8 %x, 13
928  %b = icmp uge i8 %x, 17
929  %c = and i1 %a, %b
930  ret i1 %c
931}
932
933; x >=u 13 && x >u 17
934
935define i1 @and_uge_ugt(i8 %x) {
936; CHECK-LABEL: @and_uge_ugt(
937; CHECK-NEXT:    [[B:%.*]] = icmp ugt i8 %x, 17
938; CHECK-NEXT:    ret i1 [[B]]
939;
940  %a = icmp uge i8 %x, 13
941  %b = icmp ugt i8 %x, 17
942  %c = and i1 %a, %b
943  ret i1 %c
944}
945
946; x >=u 13 && x <=u 17
947
948define i1 @and_uge_ule(i8 %x) {
949; CHECK-LABEL: @and_uge_ule(
950; CHECK-NEXT:    [[A:%.*]] = icmp uge i8 %x, 13
951; CHECK-NEXT:    [[B:%.*]] = icmp ule i8 %x, 17
952; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
953; CHECK-NEXT:    ret i1 [[C]]
954;
955  %a = icmp uge i8 %x, 13
956  %b = icmp ule i8 %x, 17
957  %c = and i1 %a, %b
958  ret i1 %c
959}
960
961; x >=u 13 && x <u 17
962
963define i1 @and_uge_ult(i8 %x) {
964; CHECK-LABEL: @and_uge_ult(
965; CHECK-NEXT:    [[A:%.*]] = icmp uge i8 %x, 13
966; CHECK-NEXT:    [[B:%.*]] = icmp ult i8 %x, 17
967; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
968; CHECK-NEXT:    ret i1 [[C]]
969;
970  %a = icmp uge i8 %x, 13
971  %b = icmp ult i8 %x, 17
972  %c = and i1 %a, %b
973  ret i1 %c
974}
975
976; ugt
977; x >u 13 && x == 17
978
979define i1 @and_ugt_eq(i8 %x) {
980; CHECK-LABEL: @and_ugt_eq(
981; CHECK-NEXT:    [[B:%.*]] = icmp eq i8 %x, 17
982; CHECK-NEXT:    ret i1 [[B]]
983;
984  %a = icmp ugt i8 %x, 13
985  %b = icmp eq i8 %x, 17
986  %c = and i1 %a, %b
987  ret i1 %c
988}
989
990; x >u 13 && x != 17
991
992define i1 @and_ugt_ne(i8 %x) {
993; CHECK-LABEL: @and_ugt_ne(
994; CHECK-NEXT:    [[A:%.*]] = icmp ugt i8 %x, 13
995; CHECK-NEXT:    [[B:%.*]] = icmp ne i8 %x, 17
996; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
997; CHECK-NEXT:    ret i1 [[C]]
998;
999  %a = icmp ugt i8 %x, 13
1000  %b = icmp ne i8 %x, 17
1001  %c = and i1 %a, %b
1002  ret i1 %c
1003}
1004
1005; x >u 13 && x >=s 17
1006
1007define i1 @and_ugt_sge(i8 %x) {
1008; CHECK-LABEL: @and_ugt_sge(
1009; CHECK-NEXT:    [[B:%.*]] = icmp sge i8 %x, 17
1010; CHECK-NEXT:    ret i1 [[B]]
1011;
1012  %a = icmp ugt i8 %x, 13
1013  %b = icmp sge i8 %x, 17
1014  %c = and i1 %a, %b
1015  ret i1 %c
1016}
1017
1018; x >u 13 && x >s 17
1019
1020define i1 @and_ugt_sgt(i8 %x) {
1021; CHECK-LABEL: @and_ugt_sgt(
1022; CHECK-NEXT:    [[B:%.*]] = icmp sgt i8 %x, 17
1023; CHECK-NEXT:    ret i1 [[B]]
1024;
1025  %a = icmp ugt i8 %x, 13
1026  %b = icmp sgt i8 %x, 17
1027  %c = and i1 %a, %b
1028  ret i1 %c
1029}
1030
1031; x >u 13 && x <=s 17
1032
1033define i1 @and_ugt_sle(i8 %x) {
1034; CHECK-LABEL: @and_ugt_sle(
1035; CHECK-NEXT:    [[A:%.*]] = icmp ugt i8 %x, 13
1036; CHECK-NEXT:    [[B:%.*]] = icmp sle i8 %x, 17
1037; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
1038; CHECK-NEXT:    ret i1 [[C]]
1039;
1040  %a = icmp ugt i8 %x, 13
1041  %b = icmp sle i8 %x, 17
1042  %c = and i1 %a, %b
1043  ret i1 %c
1044}
1045
1046; x >u 13 && x <s 17
1047
1048define i1 @and_ugt_slt(i8 %x) {
1049; CHECK-LABEL: @and_ugt_slt(
1050; CHECK-NEXT:    [[A:%.*]] = icmp ugt i8 %x, 13
1051; CHECK-NEXT:    [[B:%.*]] = icmp slt i8 %x, 17
1052; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
1053; CHECK-NEXT:    ret i1 [[C]]
1054;
1055  %a = icmp ugt i8 %x, 13
1056  %b = icmp slt i8 %x, 17
1057  %c = and i1 %a, %b
1058  ret i1 %c
1059}
1060
1061; x >u 13 && x >=u 17
1062
1063define i1 @and_ugt_uge(i8 %x) {
1064; CHECK-LABEL: @and_ugt_uge(
1065; CHECK-NEXT:    [[B:%.*]] = icmp uge i8 %x, 17
1066; CHECK-NEXT:    ret i1 [[B]]
1067;
1068  %a = icmp ugt i8 %x, 13
1069  %b = icmp uge i8 %x, 17
1070  %c = and i1 %a, %b
1071  ret i1 %c
1072}
1073
1074; x >u 13 && x >u 17
1075
1076define i1 @and_ugt_ugt(i8 %x) {
1077; CHECK-LABEL: @and_ugt_ugt(
1078; CHECK-NEXT:    [[B:%.*]] = icmp ugt i8 %x, 17
1079; CHECK-NEXT:    ret i1 [[B]]
1080;
1081  %a = icmp ugt i8 %x, 13
1082  %b = icmp ugt i8 %x, 17
1083  %c = and i1 %a, %b
1084  ret i1 %c
1085}
1086
1087; x >u 13 && x <=u 17
1088
1089define i1 @and_ugt_ule(i8 %x) {
1090; CHECK-LABEL: @and_ugt_ule(
1091; CHECK-NEXT:    [[A:%.*]] = icmp ugt i8 %x, 13
1092; CHECK-NEXT:    [[B:%.*]] = icmp ule i8 %x, 17
1093; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
1094; CHECK-NEXT:    ret i1 [[C]]
1095;
1096  %a = icmp ugt i8 %x, 13
1097  %b = icmp ule i8 %x, 17
1098  %c = and i1 %a, %b
1099  ret i1 %c
1100}
1101
1102; x >u 13 && x <u 17
1103
1104define i1 @and_ugt_ult(i8 %x) {
1105; CHECK-LABEL: @and_ugt_ult(
1106; CHECK-NEXT:    [[A:%.*]] = icmp ugt i8 %x, 13
1107; CHECK-NEXT:    [[B:%.*]] = icmp ult i8 %x, 17
1108; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
1109; CHECK-NEXT:    ret i1 [[C]]
1110;
1111  %a = icmp ugt i8 %x, 13
1112  %b = icmp ult i8 %x, 17
1113  %c = and i1 %a, %b
1114  ret i1 %c
1115}
1116
1117; ule
1118; x <=u 13 && x == 17
1119
1120define i1 @and_ule_eq(i8 %x) {
1121; CHECK-LABEL: @and_ule_eq(
1122; CHECK-NEXT:    ret i1 false
1123;
1124  %a = icmp ule i8 %x, 13
1125  %b = icmp eq i8 %x, 17
1126  %c = and i1 %a, %b
1127  ret i1 %c
1128}
1129
1130; x <=u 13 && x != 17
1131
1132define i1 @and_ule_ne(i8 %x) {
1133; CHECK-LABEL: @and_ule_ne(
1134; CHECK-NEXT:    [[A:%.*]] = icmp ule i8 %x, 13
1135; CHECK-NEXT:    ret i1 [[A]]
1136;
1137  %a = icmp ule i8 %x, 13
1138  %b = icmp ne i8 %x, 17
1139  %c = and i1 %a, %b
1140  ret i1 %c
1141}
1142
1143; x <=u 13 && x >=s 17
1144
1145define i1 @and_ule_sge(i8 %x) {
1146; CHECK-LABEL: @and_ule_sge(
1147; CHECK-NEXT:    ret i1 false
1148;
1149  %a = icmp ule i8 %x, 13
1150  %b = icmp sge i8 %x, 17
1151  %c = and i1 %a, %b
1152  ret i1 %c
1153}
1154
1155; x <=u 13 && x >s 17
1156
1157define i1 @and_ule_sgt(i8 %x) {
1158; CHECK-LABEL: @and_ule_sgt(
1159; CHECK-NEXT:    ret i1 false
1160;
1161  %a = icmp ule i8 %x, 13
1162  %b = icmp sgt i8 %x, 17
1163  %c = and i1 %a, %b
1164  ret i1 %c
1165}
1166
1167; x <=u 13 && x <=s 17
1168
1169define i1 @and_ule_sle(i8 %x) {
1170; CHECK-LABEL: @and_ule_sle(
1171; CHECK-NEXT:    [[A:%.*]] = icmp ule i8 %x, 13
1172; CHECK-NEXT:    ret i1 [[A]]
1173;
1174  %a = icmp ule i8 %x, 13
1175  %b = icmp sle i8 %x, 17
1176  %c = and i1 %a, %b
1177  ret i1 %c
1178}
1179
1180; x <=u 13 && x <s 17
1181
1182define i1 @and_ule_slt(i8 %x) {
1183; CHECK-LABEL: @and_ule_slt(
1184; CHECK-NEXT:    [[A:%.*]] = icmp ule i8 %x, 13
1185; CHECK-NEXT:    ret i1 [[A]]
1186;
1187  %a = icmp ule i8 %x, 13
1188  %b = icmp slt i8 %x, 17
1189  %c = and i1 %a, %b
1190  ret i1 %c
1191}
1192
1193; x <=u 13 && x >=u 17
1194
1195define i1 @and_ule_uge(i8 %x) {
1196; CHECK-LABEL: @and_ule_uge(
1197; CHECK-NEXT:    ret i1 false
1198;
1199  %a = icmp ule i8 %x, 13
1200  %b = icmp uge i8 %x, 17
1201  %c = and i1 %a, %b
1202  ret i1 %c
1203}
1204
1205; x <=u 13 && x >u 17
1206
1207define i1 @and_ule_ugt(i8 %x) {
1208; CHECK-LABEL: @and_ule_ugt(
1209; CHECK-NEXT:    ret i1 false
1210;
1211  %a = icmp ule i8 %x, 13
1212  %b = icmp ugt i8 %x, 17
1213  %c = and i1 %a, %b
1214  ret i1 %c
1215}
1216
1217; x <=u 13 && x <=u 17
1218
1219define i1 @and_ule_ule(i8 %x) {
1220; CHECK-LABEL: @and_ule_ule(
1221; CHECK-NEXT:    [[A:%.*]] = icmp ule i8 %x, 13
1222; CHECK-NEXT:    ret i1 [[A]]
1223;
1224  %a = icmp ule i8 %x, 13
1225  %b = icmp ule i8 %x, 17
1226  %c = and i1 %a, %b
1227  ret i1 %c
1228}
1229
1230; x <=u 13 && x <u 17
1231
1232define i1 @and_ule_ult(i8 %x) {
1233; CHECK-LABEL: @and_ule_ult(
1234; CHECK-NEXT:    [[A:%.*]] = icmp ule i8 %x, 13
1235; CHECK-NEXT:    ret i1 [[A]]
1236;
1237  %a = icmp ule i8 %x, 13
1238  %b = icmp ult i8 %x, 17
1239  %c = and i1 %a, %b
1240  ret i1 %c
1241}
1242
1243; ult
1244; x <u 13 && x == 17
1245
1246define i1 @and_ult_eq(i8 %x) {
1247; CHECK-LABEL: @and_ult_eq(
1248; CHECK-NEXT:    ret i1 false
1249;
1250  %a = icmp ult i8 %x, 13
1251  %b = icmp eq i8 %x, 17
1252  %c = and i1 %a, %b
1253  ret i1 %c
1254}
1255
1256; x <u 13 && x != 17
1257
1258define i1 @and_ult_ne(i8 %x) {
1259; CHECK-LABEL: @and_ult_ne(
1260; CHECK-NEXT:    [[A:%.*]] = icmp ult i8 %x, 13
1261; CHECK-NEXT:    ret i1 [[A]]
1262;
1263  %a = icmp ult i8 %x, 13
1264  %b = icmp ne i8 %x, 17
1265  %c = and i1 %a, %b
1266  ret i1 %c
1267}
1268
1269; x <u 13 && x >=s 17
1270
1271define i1 @and_ult_sge(i8 %x) {
1272; CHECK-LABEL: @and_ult_sge(
1273; CHECK-NEXT:    ret i1 false
1274;
1275  %a = icmp ult i8 %x, 13
1276  %b = icmp sge i8 %x, 17
1277  %c = and i1 %a, %b
1278  ret i1 %c
1279}
1280
1281; x <u 13 && x >s 17
1282
1283define i1 @and_ult_sgt(i8 %x) {
1284; CHECK-LABEL: @and_ult_sgt(
1285; CHECK-NEXT:    ret i1 false
1286;
1287  %a = icmp ult i8 %x, 13
1288  %b = icmp sgt i8 %x, 17
1289  %c = and i1 %a, %b
1290  ret i1 %c
1291}
1292
1293; x <u 13 && x <=s 17
1294
1295define i1 @and_ult_sle(i8 %x) {
1296; CHECK-LABEL: @and_ult_sle(
1297; CHECK-NEXT:    [[A:%.*]] = icmp ult i8 %x, 13
1298; CHECK-NEXT:    ret i1 [[A]]
1299;
1300  %a = icmp ult i8 %x, 13
1301  %b = icmp sle i8 %x, 17
1302  %c = and i1 %a, %b
1303  ret i1 %c
1304}
1305
1306; x <u 13 && x <s 17
1307
1308define i1 @and_ult_slt(i8 %x) {
1309; CHECK-LABEL: @and_ult_slt(
1310; CHECK-NEXT:    [[A:%.*]] = icmp ult i8 %x, 13
1311; CHECK-NEXT:    ret i1 [[A]]
1312;
1313  %a = icmp ult i8 %x, 13
1314  %b = icmp slt i8 %x, 17
1315  %c = and i1 %a, %b
1316  ret i1 %c
1317}
1318
1319; x <u 13 && x >=u 17
1320
1321define i1 @and_ult_uge(i8 %x) {
1322; CHECK-LABEL: @and_ult_uge(
1323; CHECK-NEXT:    ret i1 false
1324;
1325  %a = icmp ult i8 %x, 13
1326  %b = icmp uge i8 %x, 17
1327  %c = and i1 %a, %b
1328  ret i1 %c
1329}
1330
1331; x <u 13 && x >u 17
1332
1333define i1 @and_ult_ugt(i8 %x) {
1334; CHECK-LABEL: @and_ult_ugt(
1335; CHECK-NEXT:    ret i1 false
1336;
1337  %a = icmp ult i8 %x, 13
1338  %b = icmp ugt i8 %x, 17
1339  %c = and i1 %a, %b
1340  ret i1 %c
1341}
1342
1343; x <u 13 && x <=u 17
1344
1345define i1 @and_ult_ule(i8 %x) {
1346; CHECK-LABEL: @and_ult_ule(
1347; CHECK-NEXT:    [[A:%.*]] = icmp ult i8 %x, 13
1348; CHECK-NEXT:    ret i1 [[A]]
1349;
1350  %a = icmp ult i8 %x, 13
1351  %b = icmp ule i8 %x, 17
1352  %c = and i1 %a, %b
1353  ret i1 %c
1354}
1355
1356; x <u 13 && x <u 17
1357
1358define i1 @and_ult_ult(i8 %x) {
1359; CHECK-LABEL: @and_ult_ult(
1360; CHECK-NEXT:    [[A:%.*]] = icmp ult i8 %x, 13
1361; CHECK-NEXT:    ret i1 [[A]]
1362;
1363  %a = icmp ult i8 %x, 13
1364  %b = icmp ult i8 %x, 17
1365  %c = and i1 %a, %b
1366  ret i1 %c
1367}
1368
1369; eq
1370; x == 23 && x == 17
1371
1372define i1 @and_eq_eq_swap(i8 %x) {
1373; CHECK-LABEL: @and_eq_eq_swap(
1374; CHECK-NEXT:    ret i1 false
1375;
1376  %a = icmp eq i8 %x, 23
1377  %b = icmp eq i8 %x, 17
1378  %c = and i1 %a, %b
1379  ret i1 %c
1380}
1381
1382; x == 23 && x != 17
1383
1384define i1 @and_eq_ne_swap(i8 %x) {
1385; CHECK-LABEL: @and_eq_ne_swap(
1386; CHECK-NEXT:    [[A:%.*]] = icmp eq i8 %x, 23
1387; CHECK-NEXT:    ret i1 [[A]]
1388;
1389  %a = icmp eq i8 %x, 23
1390  %b = icmp ne i8 %x, 17
1391  %c = and i1 %a, %b
1392  ret i1 %c
1393}
1394
1395; x == 23 && x >=s 17
1396
1397define i1 @and_eq_sge_swap(i8 %x) {
1398; CHECK-LABEL: @and_eq_sge_swap(
1399; CHECK-NEXT:    [[A:%.*]] = icmp eq i8 %x, 23
1400; CHECK-NEXT:    ret i1 [[A]]
1401;
1402  %a = icmp eq i8 %x, 23
1403  %b = icmp sge i8 %x, 17
1404  %c = and i1 %a, %b
1405  ret i1 %c
1406}
1407
1408; x == 23 && x >s 17
1409
1410define i1 @and_eq_sgt_swap(i8 %x) {
1411; CHECK-LABEL: @and_eq_sgt_swap(
1412; CHECK-NEXT:    [[A:%.*]] = icmp eq i8 %x, 23
1413; CHECK-NEXT:    ret i1 [[A]]
1414;
1415  %a = icmp eq i8 %x, 23
1416  %b = icmp sgt i8 %x, 17
1417  %c = and i1 %a, %b
1418  ret i1 %c
1419}
1420
1421; x == 23 && x <=s 17
1422
1423define i1 @and_eq_sle_swap(i8 %x) {
1424; CHECK-LABEL: @and_eq_sle_swap(
1425; CHECK-NEXT:    ret i1 false
1426;
1427  %a = icmp eq i8 %x, 23
1428  %b = icmp sle i8 %x, 17
1429  %c = and i1 %a, %b
1430  ret i1 %c
1431}
1432
1433; x == 23 && x <s 17
1434
1435define i1 @and_eq_slt_swap(i8 %x) {
1436; CHECK-LABEL: @and_eq_slt_swap(
1437; CHECK-NEXT:    ret i1 false
1438;
1439  %a = icmp eq i8 %x, 23
1440  %b = icmp slt i8 %x, 17
1441  %c = and i1 %a, %b
1442  ret i1 %c
1443}
1444
1445; x == 23 && x >=u 17
1446
1447define i1 @and_eq_uge_swap(i8 %x) {
1448; CHECK-LABEL: @and_eq_uge_swap(
1449; CHECK-NEXT:    [[A:%.*]] = icmp eq i8 %x, 23
1450; CHECK-NEXT:    ret i1 [[A]]
1451;
1452  %a = icmp eq i8 %x, 23
1453  %b = icmp uge i8 %x, 17
1454  %c = and i1 %a, %b
1455  ret i1 %c
1456}
1457
1458; x == 23 && x >u 17
1459
1460define i1 @and_eq_ugt_swap(i8 %x) {
1461; CHECK-LABEL: @and_eq_ugt_swap(
1462; CHECK-NEXT:    [[A:%.*]] = icmp eq i8 %x, 23
1463; CHECK-NEXT:    ret i1 [[A]]
1464;
1465  %a = icmp eq i8 %x, 23
1466  %b = icmp ugt i8 %x, 17
1467  %c = and i1 %a, %b
1468  ret i1 %c
1469}
1470
1471; x == 23 && x <=u 17
1472
1473define i1 @and_eq_ule_swap(i8 %x) {
1474; CHECK-LABEL: @and_eq_ule_swap(
1475; CHECK-NEXT:    ret i1 false
1476;
1477  %a = icmp eq i8 %x, 23
1478  %b = icmp ule i8 %x, 17
1479  %c = and i1 %a, %b
1480  ret i1 %c
1481}
1482
1483; x == 23 && x <u 17
1484
1485define i1 @and_eq_ult_swap(i8 %x) {
1486; CHECK-LABEL: @and_eq_ult_swap(
1487; CHECK-NEXT:    ret i1 false
1488;
1489  %a = icmp eq i8 %x, 23
1490  %b = icmp ult i8 %x, 17
1491  %c = and i1 %a, %b
1492  ret i1 %c
1493}
1494
1495; ne
1496; x != 23 && x == 17
1497
1498define i1 @and_ne_eq_swap(i8 %x) {
1499; CHECK-LABEL: @and_ne_eq_swap(
1500; CHECK-NEXT:    [[B:%.*]] = icmp eq i8 %x, 17
1501; CHECK-NEXT:    ret i1 [[B]]
1502;
1503  %a = icmp ne i8 %x, 23
1504  %b = icmp eq i8 %x, 17
1505  %c = and i1 %a, %b
1506  ret i1 %c
1507}
1508
1509; x != 23 && x != 17
1510
1511define i1 @and_ne_ne_swap(i8 %x) {
1512; CHECK-LABEL: @and_ne_ne_swap(
1513; CHECK-NEXT:    [[A:%.*]] = icmp ne i8 %x, 23
1514; CHECK-NEXT:    [[B:%.*]] = icmp ne i8 %x, 17
1515; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
1516; CHECK-NEXT:    ret i1 [[C]]
1517;
1518  %a = icmp ne i8 %x, 23
1519  %b = icmp ne i8 %x, 17
1520  %c = and i1 %a, %b
1521  ret i1 %c
1522}
1523
1524; x != 23 && x >=s 17
1525
1526define i1 @and_ne_sge_swap(i8 %x) {
1527; CHECK-LABEL: @and_ne_sge_swap(
1528; CHECK-NEXT:    [[A:%.*]] = icmp ne i8 %x, 23
1529; CHECK-NEXT:    [[B:%.*]] = icmp sge i8 %x, 17
1530; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
1531; CHECK-NEXT:    ret i1 [[C]]
1532;
1533  %a = icmp ne i8 %x, 23
1534  %b = icmp sge i8 %x, 17
1535  %c = and i1 %a, %b
1536  ret i1 %c
1537}
1538
1539; x != 23 && x >s 17
1540
1541define i1 @and_ne_sgt_swap(i8 %x) {
1542; CHECK-LABEL: @and_ne_sgt_swap(
1543; CHECK-NEXT:    [[A:%.*]] = icmp ne i8 %x, 23
1544; CHECK-NEXT:    [[B:%.*]] = icmp sgt i8 %x, 17
1545; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
1546; CHECK-NEXT:    ret i1 [[C]]
1547;
1548  %a = icmp ne i8 %x, 23
1549  %b = icmp sgt i8 %x, 17
1550  %c = and i1 %a, %b
1551  ret i1 %c
1552}
1553
1554; x != 23 && x <=s 17
1555
1556define i1 @and_ne_sle_swap(i8 %x) {
1557; CHECK-LABEL: @and_ne_sle_swap(
1558; CHECK-NEXT:    [[B:%.*]] = icmp sle i8 %x, 17
1559; CHECK-NEXT:    ret i1 [[B]]
1560;
1561  %a = icmp ne i8 %x, 23
1562  %b = icmp sle i8 %x, 17
1563  %c = and i1 %a, %b
1564  ret i1 %c
1565}
1566
1567; x != 23 && x <s 17
1568
1569define i1 @and_ne_slt_swap(i8 %x) {
1570; CHECK-LABEL: @and_ne_slt_swap(
1571; CHECK-NEXT:    [[B:%.*]] = icmp slt i8 %x, 17
1572; CHECK-NEXT:    ret i1 [[B]]
1573;
1574  %a = icmp ne i8 %x, 23
1575  %b = icmp slt i8 %x, 17
1576  %c = and i1 %a, %b
1577  ret i1 %c
1578}
1579
1580; x != 23 && x >=u 17
1581
1582define i1 @and_ne_uge_swap(i8 %x) {
1583; CHECK-LABEL: @and_ne_uge_swap(
1584; CHECK-NEXT:    [[A:%.*]] = icmp ne i8 %x, 23
1585; CHECK-NEXT:    [[B:%.*]] = icmp uge i8 %x, 17
1586; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
1587; CHECK-NEXT:    ret i1 [[C]]
1588;
1589  %a = icmp ne i8 %x, 23
1590  %b = icmp uge i8 %x, 17
1591  %c = and i1 %a, %b
1592  ret i1 %c
1593}
1594
1595; x != 23 && x >u 17
1596
1597define i1 @and_ne_ugt_swap(i8 %x) {
1598; CHECK-LABEL: @and_ne_ugt_swap(
1599; CHECK-NEXT:    [[A:%.*]] = icmp ne i8 %x, 23
1600; CHECK-NEXT:    [[B:%.*]] = icmp ugt i8 %x, 17
1601; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
1602; CHECK-NEXT:    ret i1 [[C]]
1603;
1604  %a = icmp ne i8 %x, 23
1605  %b = icmp ugt i8 %x, 17
1606  %c = and i1 %a, %b
1607  ret i1 %c
1608}
1609
1610; x != 23 && x <=u 17
1611
1612define i1 @and_ne_ule_swap(i8 %x) {
1613; CHECK-LABEL: @and_ne_ule_swap(
1614; CHECK-NEXT:    [[B:%.*]] = icmp ule i8 %x, 17
1615; CHECK-NEXT:    ret i1 [[B]]
1616;
1617  %a = icmp ne i8 %x, 23
1618  %b = icmp ule i8 %x, 17
1619  %c = and i1 %a, %b
1620  ret i1 %c
1621}
1622
1623; x != 23 && x <u 17
1624
1625define i1 @and_ne_ult_swap(i8 %x) {
1626; CHECK-LABEL: @and_ne_ult_swap(
1627; CHECK-NEXT:    [[B:%.*]] = icmp ult i8 %x, 17
1628; CHECK-NEXT:    ret i1 [[B]]
1629;
1630  %a = icmp ne i8 %x, 23
1631  %b = icmp ult i8 %x, 17
1632  %c = and i1 %a, %b
1633  ret i1 %c
1634}
1635
1636; sge
1637; x >=s 23 && x == 17
1638
1639define i1 @and_sge_eq_swap(i8 %x) {
1640; CHECK-LABEL: @and_sge_eq_swap(
1641; CHECK-NEXT:    ret i1 false
1642;
1643  %a = icmp sge i8 %x, 23
1644  %b = icmp eq i8 %x, 17
1645  %c = and i1 %a, %b
1646  ret i1 %c
1647}
1648
1649; x >=s 23 && x != 17
1650
1651define i1 @and_sge_ne_swap(i8 %x) {
1652; CHECK-LABEL: @and_sge_ne_swap(
1653; CHECK-NEXT:    [[A:%.*]] = icmp sge i8 %x, 23
1654; CHECK-NEXT:    ret i1 [[A]]
1655;
1656  %a = icmp sge i8 %x, 23
1657  %b = icmp ne i8 %x, 17
1658  %c = and i1 %a, %b
1659  ret i1 %c
1660}
1661
1662; x >=s 23 && x >=s 17
1663
1664define i1 @and_sge_sge_swap(i8 %x) {
1665; CHECK-LABEL: @and_sge_sge_swap(
1666; CHECK-NEXT:    [[A:%.*]] = icmp sge i8 %x, 23
1667; CHECK-NEXT:    ret i1 [[A]]
1668;
1669  %a = icmp sge i8 %x, 23
1670  %b = icmp sge i8 %x, 17
1671  %c = and i1 %a, %b
1672  ret i1 %c
1673}
1674
1675; x >=s 23 && x >s 17
1676
1677define i1 @and_sge_sgt_swap(i8 %x) {
1678; CHECK-LABEL: @and_sge_sgt_swap(
1679; CHECK-NEXT:    [[A:%.*]] = icmp sge i8 %x, 23
1680; CHECK-NEXT:    ret i1 [[A]]
1681;
1682  %a = icmp sge i8 %x, 23
1683  %b = icmp sgt i8 %x, 17
1684  %c = and i1 %a, %b
1685  ret i1 %c
1686}
1687
1688; x >=s 23 && x <=s 17
1689
1690define i1 @and_sge_sle_swap(i8 %x) {
1691; CHECK-LABEL: @and_sge_sle_swap(
1692; CHECK-NEXT:    ret i1 false
1693;
1694  %a = icmp sge i8 %x, 23
1695  %b = icmp sle i8 %x, 17
1696  %c = and i1 %a, %b
1697  ret i1 %c
1698}
1699
1700; x >=s 23 && x <s 17
1701
1702define i1 @and_sge_slt_swap(i8 %x) {
1703; CHECK-LABEL: @and_sge_slt_swap(
1704; CHECK-NEXT:    ret i1 false
1705;
1706  %a = icmp sge i8 %x, 23
1707  %b = icmp slt i8 %x, 17
1708  %c = and i1 %a, %b
1709  ret i1 %c
1710}
1711
1712; x >=s 23 && x >=u 17
1713
1714define i1 @and_sge_uge_swap(i8 %x) {
1715; CHECK-LABEL: @and_sge_uge_swap(
1716; CHECK-NEXT:    [[A:%.*]] = icmp sge i8 %x, 23
1717; CHECK-NEXT:    ret i1 [[A]]
1718;
1719  %a = icmp sge i8 %x, 23
1720  %b = icmp uge i8 %x, 17
1721  %c = and i1 %a, %b
1722  ret i1 %c
1723}
1724
1725; x >=s 23 && x >u 17
1726
1727define i1 @and_sge_ugt_swap(i8 %x) {
1728; CHECK-LABEL: @and_sge_ugt_swap(
1729; CHECK-NEXT:    [[A:%.*]] = icmp sge i8 %x, 23
1730; CHECK-NEXT:    ret i1 [[A]]
1731;
1732  %a = icmp sge i8 %x, 23
1733  %b = icmp ugt i8 %x, 17
1734  %c = and i1 %a, %b
1735  ret i1 %c
1736}
1737
1738; x >=s 23 && x <=u 17
1739
1740define i1 @and_sge_ule_swap(i8 %x) {
1741; CHECK-LABEL: @and_sge_ule_swap(
1742; CHECK-NEXT:    ret i1 false
1743;
1744  %a = icmp sge i8 %x, 23
1745  %b = icmp ule i8 %x, 17
1746  %c = and i1 %a, %b
1747  ret i1 %c
1748}
1749
1750; x >=s 23 && x <u 17
1751
1752define i1 @and_sge_ult_swap(i8 %x) {
1753; CHECK-LABEL: @and_sge_ult_swap(
1754; CHECK-NEXT:    ret i1 false
1755;
1756  %a = icmp sge i8 %x, 23
1757  %b = icmp ult i8 %x, 17
1758  %c = and i1 %a, %b
1759  ret i1 %c
1760}
1761
1762; sgt
1763; x >s 23 && x == 17
1764
1765define i1 @and_sgt_eq_swap(i8 %x) {
1766; CHECK-LABEL: @and_sgt_eq_swap(
1767; CHECK-NEXT:    ret i1 false
1768;
1769  %a = icmp sgt i8 %x, 23
1770  %b = icmp eq i8 %x, 17
1771  %c = and i1 %a, %b
1772  ret i1 %c
1773}
1774
1775; x >s 23 && x != 17
1776
1777define i1 @and_sgt_ne_swap(i8 %x) {
1778; CHECK-LABEL: @and_sgt_ne_swap(
1779; CHECK-NEXT:    [[A:%.*]] = icmp sgt i8 %x, 23
1780; CHECK-NEXT:    ret i1 [[A]]
1781;
1782  %a = icmp sgt i8 %x, 23
1783  %b = icmp ne i8 %x, 17
1784  %c = and i1 %a, %b
1785  ret i1 %c
1786}
1787
1788; x >s 23 && x >=s 17
1789
1790define i1 @and_sgt_sge_swap(i8 %x) {
1791; CHECK-LABEL: @and_sgt_sge_swap(
1792; CHECK-NEXT:    [[A:%.*]] = icmp sgt i8 %x, 23
1793; CHECK-NEXT:    ret i1 [[A]]
1794;
1795  %a = icmp sgt i8 %x, 23
1796  %b = icmp sge i8 %x, 17
1797  %c = and i1 %a, %b
1798  ret i1 %c
1799}
1800
1801; x >s 23 && x >s 17
1802
1803define i1 @and_sgt_sgt_swap(i8 %x) {
1804; CHECK-LABEL: @and_sgt_sgt_swap(
1805; CHECK-NEXT:    [[A:%.*]] = icmp sgt i8 %x, 23
1806; CHECK-NEXT:    ret i1 [[A]]
1807;
1808  %a = icmp sgt i8 %x, 23
1809  %b = icmp sgt i8 %x, 17
1810  %c = and i1 %a, %b
1811  ret i1 %c
1812}
1813
1814; x >s 23 && x <=s 17
1815
1816define i1 @and_sgt_sle_swap(i8 %x) {
1817; CHECK-LABEL: @and_sgt_sle_swap(
1818; CHECK-NEXT:    ret i1 false
1819;
1820  %a = icmp sgt i8 %x, 23
1821  %b = icmp sle i8 %x, 17
1822  %c = and i1 %a, %b
1823  ret i1 %c
1824}
1825
1826; x >s 23 && x <s 17
1827
1828define i1 @and_sgt_slt_swap(i8 %x) {
1829; CHECK-LABEL: @and_sgt_slt_swap(
1830; CHECK-NEXT:    ret i1 false
1831;
1832  %a = icmp sgt i8 %x, 23
1833  %b = icmp slt i8 %x, 17
1834  %c = and i1 %a, %b
1835  ret i1 %c
1836}
1837
1838; x >s 23 && x >=u 17
1839
1840define i1 @and_sgt_uge_swap(i8 %x) {
1841; CHECK-LABEL: @and_sgt_uge_swap(
1842; CHECK-NEXT:    [[A:%.*]] = icmp sgt i8 %x, 23
1843; CHECK-NEXT:    ret i1 [[A]]
1844;
1845  %a = icmp sgt i8 %x, 23
1846  %b = icmp uge i8 %x, 17
1847  %c = and i1 %a, %b
1848  ret i1 %c
1849}
1850
1851; x >s 23 && x >u 17
1852
1853define i1 @and_sgt_ugt_swap(i8 %x) {
1854; CHECK-LABEL: @and_sgt_ugt_swap(
1855; CHECK-NEXT:    [[A:%.*]] = icmp sgt i8 %x, 23
1856; CHECK-NEXT:    ret i1 [[A]]
1857;
1858  %a = icmp sgt i8 %x, 23
1859  %b = icmp ugt i8 %x, 17
1860  %c = and i1 %a, %b
1861  ret i1 %c
1862}
1863
1864; x >s 23 && x <=u 17
1865
1866define i1 @and_sgt_ule_swap(i8 %x) {
1867; CHECK-LABEL: @and_sgt_ule_swap(
1868; CHECK-NEXT:    ret i1 false
1869;
1870  %a = icmp sgt i8 %x, 23
1871  %b = icmp ule i8 %x, 17
1872  %c = and i1 %a, %b
1873  ret i1 %c
1874}
1875
1876; x >s 23 && x <u 17
1877
1878define i1 @and_sgt_ult_swap(i8 %x) {
1879; CHECK-LABEL: @and_sgt_ult_swap(
1880; CHECK-NEXT:    ret i1 false
1881;
1882  %a = icmp sgt i8 %x, 23
1883  %b = icmp ult i8 %x, 17
1884  %c = and i1 %a, %b
1885  ret i1 %c
1886}
1887
1888; sle
1889; x <=s 23 && x == 17
1890
1891define i1 @and_sle_eq_swap(i8 %x) {
1892; CHECK-LABEL: @and_sle_eq_swap(
1893; CHECK-NEXT:    [[B:%.*]] = icmp eq i8 %x, 17
1894; CHECK-NEXT:    ret i1 [[B]]
1895;
1896  %a = icmp sle i8 %x, 23
1897  %b = icmp eq i8 %x, 17
1898  %c = and i1 %a, %b
1899  ret i1 %c
1900}
1901
1902; x <=s 23 && x != 17
1903
1904define i1 @and_sle_ne_swap(i8 %x) {
1905; CHECK-LABEL: @and_sle_ne_swap(
1906; CHECK-NEXT:    [[A:%.*]] = icmp sle i8 %x, 23
1907; CHECK-NEXT:    [[B:%.*]] = icmp ne i8 %x, 17
1908; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
1909; CHECK-NEXT:    ret i1 [[C]]
1910;
1911  %a = icmp sle i8 %x, 23
1912  %b = icmp ne i8 %x, 17
1913  %c = and i1 %a, %b
1914  ret i1 %c
1915}
1916
1917; x <=s 23 && x >=s 17
1918
1919define i1 @and_sle_sge_swap(i8 %x) {
1920; CHECK-LABEL: @and_sle_sge_swap(
1921; CHECK-NEXT:    [[A:%.*]] = icmp sle i8 %x, 23
1922; CHECK-NEXT:    [[B:%.*]] = icmp sge i8 %x, 17
1923; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
1924; CHECK-NEXT:    ret i1 [[C]]
1925;
1926  %a = icmp sle i8 %x, 23
1927  %b = icmp sge i8 %x, 17
1928  %c = and i1 %a, %b
1929  ret i1 %c
1930}
1931
1932; x <=s 23 && x >s 17
1933
1934define i1 @and_sle_sgt_swap(i8 %x) {
1935; CHECK-LABEL: @and_sle_sgt_swap(
1936; CHECK-NEXT:    [[A:%.*]] = icmp sle i8 %x, 23
1937; CHECK-NEXT:    [[B:%.*]] = icmp sgt i8 %x, 17
1938; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
1939; CHECK-NEXT:    ret i1 [[C]]
1940;
1941  %a = icmp sle i8 %x, 23
1942  %b = icmp sgt i8 %x, 17
1943  %c = and i1 %a, %b
1944  ret i1 %c
1945}
1946
1947; x <=s 23 && x <=s 17
1948
1949define i1 @and_sle_sle_swap(i8 %x) {
1950; CHECK-LABEL: @and_sle_sle_swap(
1951; CHECK-NEXT:    [[B:%.*]] = icmp sle i8 %x, 17
1952; CHECK-NEXT:    ret i1 [[B]]
1953;
1954  %a = icmp sle i8 %x, 23
1955  %b = icmp sle i8 %x, 17
1956  %c = and i1 %a, %b
1957  ret i1 %c
1958}
1959
1960; x <=s 23 && x <s 17
1961
1962define i1 @and_sle_slt_swap(i8 %x) {
1963; CHECK-LABEL: @and_sle_slt_swap(
1964; CHECK-NEXT:    [[B:%.*]] = icmp slt i8 %x, 17
1965; CHECK-NEXT:    ret i1 [[B]]
1966;
1967  %a = icmp sle i8 %x, 23
1968  %b = icmp slt i8 %x, 17
1969  %c = and i1 %a, %b
1970  ret i1 %c
1971}
1972
1973; x <=s 23 && x >=u 17
1974
1975define i1 @and_sle_uge_swap(i8 %x) {
1976; CHECK-LABEL: @and_sle_uge_swap(
1977; CHECK-NEXT:    [[A:%.*]] = icmp sle i8 %x, 23
1978; CHECK-NEXT:    [[B:%.*]] = icmp uge i8 %x, 17
1979; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
1980; CHECK-NEXT:    ret i1 [[C]]
1981;
1982  %a = icmp sle i8 %x, 23
1983  %b = icmp uge i8 %x, 17
1984  %c = and i1 %a, %b
1985  ret i1 %c
1986}
1987
1988; x <=s 23 && x >u 17
1989
1990define i1 @and_sle_ugt_swap(i8 %x) {
1991; CHECK-LABEL: @and_sle_ugt_swap(
1992; CHECK-NEXT:    [[A:%.*]] = icmp sle i8 %x, 23
1993; CHECK-NEXT:    [[B:%.*]] = icmp ugt i8 %x, 17
1994; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
1995; CHECK-NEXT:    ret i1 [[C]]
1996;
1997  %a = icmp sle i8 %x, 23
1998  %b = icmp ugt i8 %x, 17
1999  %c = and i1 %a, %b
2000  ret i1 %c
2001}
2002
2003; x <=s 23 && x <=u 17
2004
2005define i1 @and_sle_ule_swap(i8 %x) {
2006; CHECK-LABEL: @and_sle_ule_swap(
2007; CHECK-NEXT:    [[B:%.*]] = icmp ule i8 %x, 17
2008; CHECK-NEXT:    ret i1 [[B]]
2009;
2010  %a = icmp sle i8 %x, 23
2011  %b = icmp ule i8 %x, 17
2012  %c = and i1 %a, %b
2013  ret i1 %c
2014}
2015
2016; x <=s 23 && x <u 17
2017
2018define i1 @and_sle_ult_swap(i8 %x) {
2019; CHECK-LABEL: @and_sle_ult_swap(
2020; CHECK-NEXT:    [[B:%.*]] = icmp ult i8 %x, 17
2021; CHECK-NEXT:    ret i1 [[B]]
2022;
2023  %a = icmp sle i8 %x, 23
2024  %b = icmp ult i8 %x, 17
2025  %c = and i1 %a, %b
2026  ret i1 %c
2027}
2028
2029; slt
2030; x <s 23 && x == 17
2031
2032define i1 @and_slt_eq_swap(i8 %x) {
2033; CHECK-LABEL: @and_slt_eq_swap(
2034; CHECK-NEXT:    [[B:%.*]] = icmp eq i8 %x, 17
2035; CHECK-NEXT:    ret i1 [[B]]
2036;
2037  %a = icmp slt i8 %x, 23
2038  %b = icmp eq i8 %x, 17
2039  %c = and i1 %a, %b
2040  ret i1 %c
2041}
2042
2043; x <s 23 && x != 17
2044
2045define i1 @and_slt_ne_swap(i8 %x) {
2046; CHECK-LABEL: @and_slt_ne_swap(
2047; CHECK-NEXT:    [[A:%.*]] = icmp slt i8 %x, 23
2048; CHECK-NEXT:    [[B:%.*]] = icmp ne i8 %x, 17
2049; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
2050; CHECK-NEXT:    ret i1 [[C]]
2051;
2052  %a = icmp slt i8 %x, 23
2053  %b = icmp ne i8 %x, 17
2054  %c = and i1 %a, %b
2055  ret i1 %c
2056}
2057
2058; x <s 23 && x >=s 17
2059
2060define i1 @and_slt_sge_swap(i8 %x) {
2061; CHECK-LABEL: @and_slt_sge_swap(
2062; CHECK-NEXT:    [[A:%.*]] = icmp slt i8 %x, 23
2063; CHECK-NEXT:    [[B:%.*]] = icmp sge i8 %x, 17
2064; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
2065; CHECK-NEXT:    ret i1 [[C]]
2066;
2067  %a = icmp slt i8 %x, 23
2068  %b = icmp sge i8 %x, 17
2069  %c = and i1 %a, %b
2070  ret i1 %c
2071}
2072
2073; x <s 23 && x >s 17
2074
2075define i1 @and_slt_sgt_swap(i8 %x) {
2076; CHECK-LABEL: @and_slt_sgt_swap(
2077; CHECK-NEXT:    [[A:%.*]] = icmp slt i8 %x, 23
2078; CHECK-NEXT:    [[B:%.*]] = icmp sgt i8 %x, 17
2079; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
2080; CHECK-NEXT:    ret i1 [[C]]
2081;
2082  %a = icmp slt i8 %x, 23
2083  %b = icmp sgt i8 %x, 17
2084  %c = and i1 %a, %b
2085  ret i1 %c
2086}
2087
2088; x <s 23 && x <=s 17
2089
2090define i1 @and_slt_sle_swap(i8 %x) {
2091; CHECK-LABEL: @and_slt_sle_swap(
2092; CHECK-NEXT:    [[B:%.*]] = icmp sle i8 %x, 17
2093; CHECK-NEXT:    ret i1 [[B]]
2094;
2095  %a = icmp slt i8 %x, 23
2096  %b = icmp sle i8 %x, 17
2097  %c = and i1 %a, %b
2098  ret i1 %c
2099}
2100
2101; x <s 23 && x <s 17
2102
2103define i1 @and_slt_slt_swap(i8 %x) {
2104; CHECK-LABEL: @and_slt_slt_swap(
2105; CHECK-NEXT:    [[B:%.*]] = icmp slt i8 %x, 17
2106; CHECK-NEXT:    ret i1 [[B]]
2107;
2108  %a = icmp slt i8 %x, 23
2109  %b = icmp slt i8 %x, 17
2110  %c = and i1 %a, %b
2111  ret i1 %c
2112}
2113
2114; x <s 23 && x >=u 17
2115
2116define i1 @and_slt_uge_swap(i8 %x) {
2117; CHECK-LABEL: @and_slt_uge_swap(
2118; CHECK-NEXT:    [[A:%.*]] = icmp slt i8 %x, 23
2119; CHECK-NEXT:    [[B:%.*]] = icmp uge i8 %x, 17
2120; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
2121; CHECK-NEXT:    ret i1 [[C]]
2122;
2123  %a = icmp slt i8 %x, 23
2124  %b = icmp uge i8 %x, 17
2125  %c = and i1 %a, %b
2126  ret i1 %c
2127}
2128
2129; x <s 23 && x >u 17
2130
2131define i1 @and_slt_ugt_swap(i8 %x) {
2132; CHECK-LABEL: @and_slt_ugt_swap(
2133; CHECK-NEXT:    [[A:%.*]] = icmp slt i8 %x, 23
2134; CHECK-NEXT:    [[B:%.*]] = icmp ugt i8 %x, 17
2135; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
2136; CHECK-NEXT:    ret i1 [[C]]
2137;
2138  %a = icmp slt i8 %x, 23
2139  %b = icmp ugt i8 %x, 17
2140  %c = and i1 %a, %b
2141  ret i1 %c
2142}
2143
2144; x <s 23 && x <=u 17
2145
2146define i1 @and_slt_ule_swap(i8 %x) {
2147; CHECK-LABEL: @and_slt_ule_swap(
2148; CHECK-NEXT:    [[B:%.*]] = icmp ule i8 %x, 17
2149; CHECK-NEXT:    ret i1 [[B]]
2150;
2151  %a = icmp slt i8 %x, 23
2152  %b = icmp ule i8 %x, 17
2153  %c = and i1 %a, %b
2154  ret i1 %c
2155}
2156
2157; x <s 23 && x <u 17
2158
2159define i1 @and_slt_ult_swap(i8 %x) {
2160; CHECK-LABEL: @and_slt_ult_swap(
2161; CHECK-NEXT:    [[B:%.*]] = icmp ult i8 %x, 17
2162; CHECK-NEXT:    ret i1 [[B]]
2163;
2164  %a = icmp slt i8 %x, 23
2165  %b = icmp ult i8 %x, 17
2166  %c = and i1 %a, %b
2167  ret i1 %c
2168}
2169
2170; uge
2171; x >=u 23 && x == 17
2172
2173define i1 @and_uge_eq_swap(i8 %x) {
2174; CHECK-LABEL: @and_uge_eq_swap(
2175; CHECK-NEXT:    ret i1 false
2176;
2177  %a = icmp uge i8 %x, 23
2178  %b = icmp eq i8 %x, 17
2179  %c = and i1 %a, %b
2180  ret i1 %c
2181}
2182
2183; x >=u 23 && x != 17
2184
2185define i1 @and_uge_ne_swap(i8 %x) {
2186; CHECK-LABEL: @and_uge_ne_swap(
2187; CHECK-NEXT:    [[A:%.*]] = icmp uge i8 %x, 23
2188; CHECK-NEXT:    ret i1 [[A]]
2189;
2190  %a = icmp uge i8 %x, 23
2191  %b = icmp ne i8 %x, 17
2192  %c = and i1 %a, %b
2193  ret i1 %c
2194}
2195
2196; x >=u 23 && x >=s 17
2197
2198define i1 @and_uge_sge_swap(i8 %x) {
2199; CHECK-LABEL: @and_uge_sge_swap(
2200; CHECK-NEXT:    [[A:%.*]] = icmp uge i8 %x, 23
2201; CHECK-NEXT:    [[B:%.*]] = icmp sge i8 %x, 17
2202; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
2203; CHECK-NEXT:    ret i1 [[C]]
2204;
2205  %a = icmp uge i8 %x, 23
2206  %b = icmp sge i8 %x, 17
2207  %c = and i1 %a, %b
2208  ret i1 %c
2209}
2210
2211; x >=u 23 && x >s 17
2212
2213define i1 @and_uge_sgt_swap(i8 %x) {
2214; CHECK-LABEL: @and_uge_sgt_swap(
2215; CHECK-NEXT:    [[A:%.*]] = icmp uge i8 %x, 23
2216; CHECK-NEXT:    [[B:%.*]] = icmp sgt i8 %x, 17
2217; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
2218; CHECK-NEXT:    ret i1 [[C]]
2219;
2220  %a = icmp uge i8 %x, 23
2221  %b = icmp sgt i8 %x, 17
2222  %c = and i1 %a, %b
2223  ret i1 %c
2224}
2225
2226; x >=u 23 && x <=s 17
2227
2228define i1 @and_uge_sle_swap(i8 %x) {
2229; CHECK-LABEL: @and_uge_sle_swap(
2230; CHECK-NEXT:    [[A:%.*]] = icmp uge i8 %x, 23
2231; CHECK-NEXT:    [[B:%.*]] = icmp sle i8 %x, 17
2232; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
2233; CHECK-NEXT:    ret i1 [[C]]
2234;
2235  %a = icmp uge i8 %x, 23
2236  %b = icmp sle i8 %x, 17
2237  %c = and i1 %a, %b
2238  ret i1 %c
2239}
2240
2241; x >=u 23 && x <s 17
2242
2243define i1 @and_uge_slt_swap(i8 %x) {
2244; CHECK-LABEL: @and_uge_slt_swap(
2245; CHECK-NEXT:    [[A:%.*]] = icmp uge i8 %x, 23
2246; CHECK-NEXT:    [[B:%.*]] = icmp slt i8 %x, 17
2247; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
2248; CHECK-NEXT:    ret i1 [[C]]
2249;
2250  %a = icmp uge i8 %x, 23
2251  %b = icmp slt i8 %x, 17
2252  %c = and i1 %a, %b
2253  ret i1 %c
2254}
2255
2256; x >=u 23 && x >=u 17
2257
2258define i1 @and_uge_uge_swap(i8 %x) {
2259; CHECK-LABEL: @and_uge_uge_swap(
2260; CHECK-NEXT:    [[A:%.*]] = icmp uge i8 %x, 23
2261; CHECK-NEXT:    ret i1 [[A]]
2262;
2263  %a = icmp uge i8 %x, 23
2264  %b = icmp uge i8 %x, 17
2265  %c = and i1 %a, %b
2266  ret i1 %c
2267}
2268
2269; x >=u 23 && x >u 17
2270
2271define i1 @and_uge_ugt_swap(i8 %x) {
2272; CHECK-LABEL: @and_uge_ugt_swap(
2273; CHECK-NEXT:    [[A:%.*]] = icmp uge i8 %x, 23
2274; CHECK-NEXT:    ret i1 [[A]]
2275;
2276  %a = icmp uge i8 %x, 23
2277  %b = icmp ugt i8 %x, 17
2278  %c = and i1 %a, %b
2279  ret i1 %c
2280}
2281
2282; x >=u 23 && x <=u 17
2283
2284define i1 @and_uge_ule_swap(i8 %x) {
2285; CHECK-LABEL: @and_uge_ule_swap(
2286; CHECK-NEXT:    ret i1 false
2287;
2288  %a = icmp uge i8 %x, 23
2289  %b = icmp ule i8 %x, 17
2290  %c = and i1 %a, %b
2291  ret i1 %c
2292}
2293
2294; x >=u 23 && x <u 17
2295
2296define i1 @and_uge_ult_swap(i8 %x) {
2297; CHECK-LABEL: @and_uge_ult_swap(
2298; CHECK-NEXT:    ret i1 false
2299;
2300  %a = icmp uge i8 %x, 23
2301  %b = icmp ult i8 %x, 17
2302  %c = and i1 %a, %b
2303  ret i1 %c
2304}
2305
2306; ugt
2307; x >u 23 && x == 17
2308
2309define i1 @and_ugt_eq_swap(i8 %x) {
2310; CHECK-LABEL: @and_ugt_eq_swap(
2311; CHECK-NEXT:    ret i1 false
2312;
2313  %a = icmp ugt i8 %x, 23
2314  %b = icmp eq i8 %x, 17
2315  %c = and i1 %a, %b
2316  ret i1 %c
2317}
2318
2319; x >u 23 && x != 17
2320
2321define i1 @and_ugt_ne_swap(i8 %x) {
2322; CHECK-LABEL: @and_ugt_ne_swap(
2323; CHECK-NEXT:    [[A:%.*]] = icmp ugt i8 %x, 23
2324; CHECK-NEXT:    ret i1 [[A]]
2325;
2326  %a = icmp ugt i8 %x, 23
2327  %b = icmp ne i8 %x, 17
2328  %c = and i1 %a, %b
2329  ret i1 %c
2330}
2331
2332; x >u 23 && x >=s 17
2333
2334define i1 @and_ugt_sge_swap(i8 %x) {
2335; CHECK-LABEL: @and_ugt_sge_swap(
2336; CHECK-NEXT:    [[A:%.*]] = icmp ugt i8 %x, 23
2337; CHECK-NEXT:    [[B:%.*]] = icmp sge i8 %x, 17
2338; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
2339; CHECK-NEXT:    ret i1 [[C]]
2340;
2341  %a = icmp ugt i8 %x, 23
2342  %b = icmp sge i8 %x, 17
2343  %c = and i1 %a, %b
2344  ret i1 %c
2345}
2346
2347; x >u 23 && x >s 17
2348
2349define i1 @and_ugt_sgt_swap(i8 %x) {
2350; CHECK-LABEL: @and_ugt_sgt_swap(
2351; CHECK-NEXT:    [[A:%.*]] = icmp ugt i8 %x, 23
2352; CHECK-NEXT:    [[B:%.*]] = icmp sgt i8 %x, 17
2353; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
2354; CHECK-NEXT:    ret i1 [[C]]
2355;
2356  %a = icmp ugt i8 %x, 23
2357  %b = icmp sgt i8 %x, 17
2358  %c = and i1 %a, %b
2359  ret i1 %c
2360}
2361
2362; x >u 23 && x <=s 17
2363
2364define i1 @and_ugt_sle_swap(i8 %x) {
2365; CHECK-LABEL: @and_ugt_sle_swap(
2366; CHECK-NEXT:    [[A:%.*]] = icmp ugt i8 %x, 23
2367; CHECK-NEXT:    [[B:%.*]] = icmp sle i8 %x, 17
2368; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
2369; CHECK-NEXT:    ret i1 [[C]]
2370;
2371  %a = icmp ugt i8 %x, 23
2372  %b = icmp sle i8 %x, 17
2373  %c = and i1 %a, %b
2374  ret i1 %c
2375}
2376
2377; x >u 23 && x <s 17
2378
2379define i1 @and_ugt_slt_swap(i8 %x) {
2380; CHECK-LABEL: @and_ugt_slt_swap(
2381; CHECK-NEXT:    [[A:%.*]] = icmp ugt i8 %x, 23
2382; CHECK-NEXT:    [[B:%.*]] = icmp slt i8 %x, 17
2383; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
2384; CHECK-NEXT:    ret i1 [[C]]
2385;
2386  %a = icmp ugt i8 %x, 23
2387  %b = icmp slt i8 %x, 17
2388  %c = and i1 %a, %b
2389  ret i1 %c
2390}
2391
2392; x >u 23 && x >=u 17
2393
2394define i1 @and_ugt_uge_swap(i8 %x) {
2395; CHECK-LABEL: @and_ugt_uge_swap(
2396; CHECK-NEXT:    [[A:%.*]] = icmp ugt i8 %x, 23
2397; CHECK-NEXT:    ret i1 [[A]]
2398;
2399  %a = icmp ugt i8 %x, 23
2400  %b = icmp uge i8 %x, 17
2401  %c = and i1 %a, %b
2402  ret i1 %c
2403}
2404
2405; x >u 23 && x >u 17
2406
2407define i1 @and_ugt_ugt_swap(i8 %x) {
2408; CHECK-LABEL: @and_ugt_ugt_swap(
2409; CHECK-NEXT:    [[A:%.*]] = icmp ugt i8 %x, 23
2410; CHECK-NEXT:    ret i1 [[A]]
2411;
2412  %a = icmp ugt i8 %x, 23
2413  %b = icmp ugt i8 %x, 17
2414  %c = and i1 %a, %b
2415  ret i1 %c
2416}
2417
2418; x >u 23 && x <=u 17
2419
2420define i1 @and_ugt_ule_swap(i8 %x) {
2421; CHECK-LABEL: @and_ugt_ule_swap(
2422; CHECK-NEXT:    ret i1 false
2423;
2424  %a = icmp ugt i8 %x, 23
2425  %b = icmp ule i8 %x, 17
2426  %c = and i1 %a, %b
2427  ret i1 %c
2428}
2429
2430; x >u 23 && x <u 17
2431
2432define i1 @and_ugt_ult_swap(i8 %x) {
2433; CHECK-LABEL: @and_ugt_ult_swap(
2434; CHECK-NEXT:    ret i1 false
2435;
2436  %a = icmp ugt i8 %x, 23
2437  %b = icmp ult i8 %x, 17
2438  %c = and i1 %a, %b
2439  ret i1 %c
2440}
2441
2442; ule
2443; x <=u 23 && x == 17
2444
2445define i1 @and_ule_eq_swap(i8 %x) {
2446; CHECK-LABEL: @and_ule_eq_swap(
2447; CHECK-NEXT:    [[B:%.*]] = icmp eq i8 %x, 17
2448; CHECK-NEXT:    ret i1 [[B]]
2449;
2450  %a = icmp ule i8 %x, 23
2451  %b = icmp eq i8 %x, 17
2452  %c = and i1 %a, %b
2453  ret i1 %c
2454}
2455
2456; x <=u 23 && x != 17
2457
2458define i1 @and_ule_ne_swap(i8 %x) {
2459; CHECK-LABEL: @and_ule_ne_swap(
2460; CHECK-NEXT:    [[A:%.*]] = icmp ule i8 %x, 23
2461; CHECK-NEXT:    [[B:%.*]] = icmp ne i8 %x, 17
2462; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
2463; CHECK-NEXT:    ret i1 [[C]]
2464;
2465  %a = icmp ule i8 %x, 23
2466  %b = icmp ne i8 %x, 17
2467  %c = and i1 %a, %b
2468  ret i1 %c
2469}
2470
2471; x <=u 23 && x >=s 17
2472
2473define i1 @and_ule_sge_swap(i8 %x) {
2474; CHECK-LABEL: @and_ule_sge_swap(
2475; CHECK-NEXT:    [[A:%.*]] = icmp ule i8 %x, 23
2476; CHECK-NEXT:    [[B:%.*]] = icmp sge i8 %x, 17
2477; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
2478; CHECK-NEXT:    ret i1 [[C]]
2479;
2480  %a = icmp ule i8 %x, 23
2481  %b = icmp sge i8 %x, 17
2482  %c = and i1 %a, %b
2483  ret i1 %c
2484}
2485
2486; x <=u 23 && x >s 17
2487
2488define i1 @and_ule_sgt_swap(i8 %x) {
2489; CHECK-LABEL: @and_ule_sgt_swap(
2490; CHECK-NEXT:    [[A:%.*]] = icmp ule i8 %x, 23
2491; CHECK-NEXT:    [[B:%.*]] = icmp sgt i8 %x, 17
2492; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
2493; CHECK-NEXT:    ret i1 [[C]]
2494;
2495  %a = icmp ule i8 %x, 23
2496  %b = icmp sgt i8 %x, 17
2497  %c = and i1 %a, %b
2498  ret i1 %c
2499}
2500
2501; x <=u 23 && x <=s 17
2502
2503define i1 @and_ule_sle_swap(i8 %x) {
2504; CHECK-LABEL: @and_ule_sle_swap(
2505; CHECK-NEXT:    [[A:%.*]] = icmp ule i8 %x, 23
2506; CHECK-NEXT:    [[B:%.*]] = icmp sle i8 %x, 17
2507; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
2508; CHECK-NEXT:    ret i1 [[C]]
2509;
2510  %a = icmp ule i8 %x, 23
2511  %b = icmp sle i8 %x, 17
2512  %c = and i1 %a, %b
2513  ret i1 %c
2514}
2515
2516; x <=u 23 && x <s 17
2517
2518define i1 @and_ule_slt_swap(i8 %x) {
2519; CHECK-LABEL: @and_ule_slt_swap(
2520; CHECK-NEXT:    [[A:%.*]] = icmp ule i8 %x, 23
2521; CHECK-NEXT:    [[B:%.*]] = icmp slt i8 %x, 17
2522; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
2523; CHECK-NEXT:    ret i1 [[C]]
2524;
2525  %a = icmp ule i8 %x, 23
2526  %b = icmp slt i8 %x, 17
2527  %c = and i1 %a, %b
2528  ret i1 %c
2529}
2530
2531; x <=u 23 && x >=u 17
2532
2533define i1 @and_ule_uge_swap(i8 %x) {
2534; CHECK-LABEL: @and_ule_uge_swap(
2535; CHECK-NEXT:    [[A:%.*]] = icmp ule i8 %x, 23
2536; CHECK-NEXT:    [[B:%.*]] = icmp uge i8 %x, 17
2537; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
2538; CHECK-NEXT:    ret i1 [[C]]
2539;
2540  %a = icmp ule i8 %x, 23
2541  %b = icmp uge i8 %x, 17
2542  %c = and i1 %a, %b
2543  ret i1 %c
2544}
2545
2546; x <=u 23 && x >u 17
2547
2548define i1 @and_ule_ugt_swap(i8 %x) {
2549; CHECK-LABEL: @and_ule_ugt_swap(
2550; CHECK-NEXT:    [[A:%.*]] = icmp ule i8 %x, 23
2551; CHECK-NEXT:    [[B:%.*]] = icmp ugt i8 %x, 17
2552; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
2553; CHECK-NEXT:    ret i1 [[C]]
2554;
2555  %a = icmp ule i8 %x, 23
2556  %b = icmp ugt i8 %x, 17
2557  %c = and i1 %a, %b
2558  ret i1 %c
2559}
2560
2561; x <=u 23 && x <=u 17
2562
2563define i1 @and_ule_ule_swap(i8 %x) {
2564; CHECK-LABEL: @and_ule_ule_swap(
2565; CHECK-NEXT:    [[B:%.*]] = icmp ule i8 %x, 17
2566; CHECK-NEXT:    ret i1 [[B]]
2567;
2568  %a = icmp ule i8 %x, 23
2569  %b = icmp ule i8 %x, 17
2570  %c = and i1 %a, %b
2571  ret i1 %c
2572}
2573
2574; x <=u 23 && x <u 17
2575
2576define i1 @and_ule_ult_swap(i8 %x) {
2577; CHECK-LABEL: @and_ule_ult_swap(
2578; CHECK-NEXT:    [[B:%.*]] = icmp ult i8 %x, 17
2579; CHECK-NEXT:    ret i1 [[B]]
2580;
2581  %a = icmp ule i8 %x, 23
2582  %b = icmp ult i8 %x, 17
2583  %c = and i1 %a, %b
2584  ret i1 %c
2585}
2586
2587; ult
2588; x <u 23 && x == 17
2589
2590define i1 @and_ult_eq_swap(i8 %x) {
2591; CHECK-LABEL: @and_ult_eq_swap(
2592; CHECK-NEXT:    [[B:%.*]] = icmp eq i8 %x, 17
2593; CHECK-NEXT:    ret i1 [[B]]
2594;
2595  %a = icmp ult i8 %x, 23
2596  %b = icmp eq i8 %x, 17
2597  %c = and i1 %a, %b
2598  ret i1 %c
2599}
2600
2601; x <u 23 && x != 17
2602
2603define i1 @and_ult_ne_swap(i8 %x) {
2604; CHECK-LABEL: @and_ult_ne_swap(
2605; CHECK-NEXT:    [[A:%.*]] = icmp ult i8 %x, 23
2606; CHECK-NEXT:    [[B:%.*]] = icmp ne i8 %x, 17
2607; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
2608; CHECK-NEXT:    ret i1 [[C]]
2609;
2610  %a = icmp ult i8 %x, 23
2611  %b = icmp ne i8 %x, 17
2612  %c = and i1 %a, %b
2613  ret i1 %c
2614}
2615
2616; x <u 23 && x >=s 17
2617
2618define i1 @and_ult_sge_swap(i8 %x) {
2619; CHECK-LABEL: @and_ult_sge_swap(
2620; CHECK-NEXT:    [[A:%.*]] = icmp ult i8 %x, 23
2621; CHECK-NEXT:    [[B:%.*]] = icmp sge i8 %x, 17
2622; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
2623; CHECK-NEXT:    ret i1 [[C]]
2624;
2625  %a = icmp ult i8 %x, 23
2626  %b = icmp sge i8 %x, 17
2627  %c = and i1 %a, %b
2628  ret i1 %c
2629}
2630
2631; x <u 23 && x >s 17
2632
2633define i1 @and_ult_sgt_swap(i8 %x) {
2634; CHECK-LABEL: @and_ult_sgt_swap(
2635; CHECK-NEXT:    [[A:%.*]] = icmp ult i8 %x, 23
2636; CHECK-NEXT:    [[B:%.*]] = icmp sgt i8 %x, 17
2637; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
2638; CHECK-NEXT:    ret i1 [[C]]
2639;
2640  %a = icmp ult i8 %x, 23
2641  %b = icmp sgt i8 %x, 17
2642  %c = and i1 %a, %b
2643  ret i1 %c
2644}
2645
2646; x <u 23 && x <=s 17
2647
2648define i1 @and_ult_sle_swap(i8 %x) {
2649; CHECK-LABEL: @and_ult_sle_swap(
2650; CHECK-NEXT:    [[A:%.*]] = icmp ult i8 %x, 23
2651; CHECK-NEXT:    [[B:%.*]] = icmp sle i8 %x, 17
2652; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
2653; CHECK-NEXT:    ret i1 [[C]]
2654;
2655  %a = icmp ult i8 %x, 23
2656  %b = icmp sle i8 %x, 17
2657  %c = and i1 %a, %b
2658  ret i1 %c
2659}
2660
2661; x <u 23 && x <s 17
2662
2663define i1 @and_ult_slt_swap(i8 %x) {
2664; CHECK-LABEL: @and_ult_slt_swap(
2665; CHECK-NEXT:    [[A:%.*]] = icmp ult i8 %x, 23
2666; CHECK-NEXT:    [[B:%.*]] = icmp slt i8 %x, 17
2667; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
2668; CHECK-NEXT:    ret i1 [[C]]
2669;
2670  %a = icmp ult i8 %x, 23
2671  %b = icmp slt i8 %x, 17
2672  %c = and i1 %a, %b
2673  ret i1 %c
2674}
2675
2676; x <u 23 && x >=u 17
2677
2678define i1 @and_ult_uge_swap(i8 %x) {
2679; CHECK-LABEL: @and_ult_uge_swap(
2680; CHECK-NEXT:    [[A:%.*]] = icmp ult i8 %x, 23
2681; CHECK-NEXT:    [[B:%.*]] = icmp uge i8 %x, 17
2682; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
2683; CHECK-NEXT:    ret i1 [[C]]
2684;
2685  %a = icmp ult i8 %x, 23
2686  %b = icmp uge i8 %x, 17
2687  %c = and i1 %a, %b
2688  ret i1 %c
2689}
2690
2691; x <u 23 && x >u 17
2692
2693define i1 @and_ult_ugt_swap(i8 %x) {
2694; CHECK-LABEL: @and_ult_ugt_swap(
2695; CHECK-NEXT:    [[A:%.*]] = icmp ult i8 %x, 23
2696; CHECK-NEXT:    [[B:%.*]] = icmp ugt i8 %x, 17
2697; CHECK-NEXT:    [[C:%.*]] = and i1 [[A]], [[B]]
2698; CHECK-NEXT:    ret i1 [[C]]
2699;
2700  %a = icmp ult i8 %x, 23
2701  %b = icmp ugt i8 %x, 17
2702  %c = and i1 %a, %b
2703  ret i1 %c
2704}
2705
2706; x <u 23 && x <=u 17
2707
2708define i1 @and_ult_ule_swap(i8 %x) {
2709; CHECK-LABEL: @and_ult_ule_swap(
2710; CHECK-NEXT:    [[B:%.*]] = icmp ule i8 %x, 17
2711; CHECK-NEXT:    ret i1 [[B]]
2712;
2713  %a = icmp ult i8 %x, 23
2714  %b = icmp ule i8 %x, 17
2715  %c = and i1 %a, %b
2716  ret i1 %c
2717}
2718
2719; x <u 23 && x <u 17
2720
2721define i1 @and_ult_ult_swap(i8 %x) {
2722; CHECK-LABEL: @and_ult_ult_swap(
2723; CHECK-NEXT:    [[B:%.*]] = icmp ult i8 %x, 17
2724; CHECK-NEXT:    ret i1 [[B]]
2725;
2726  %a = icmp ult i8 %x, 23
2727  %b = icmp ult i8 %x, 17
2728  %c = and i1 %a, %b
2729  ret i1 %c
2730}
2731
2732; eq
2733; x == 13 || x == 17
2734
2735define i1 @or_eq_eq(i8 %x) {
2736; CHECK-LABEL: @or_eq_eq(
2737; CHECK-NEXT:    [[A:%.*]] = icmp eq i8 %x, 13
2738; CHECK-NEXT:    [[B:%.*]] = icmp eq i8 %x, 17
2739; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
2740; CHECK-NEXT:    ret i1 [[C]]
2741;
2742  %a = icmp eq i8 %x, 13
2743  %b = icmp eq i8 %x, 17
2744  %c = or i1 %a, %b
2745  ret i1 %c
2746}
2747
2748; x == 13 || x != 17
2749
2750define i1 @or_eq_ne(i8 %x) {
2751; CHECK-LABEL: @or_eq_ne(
2752; CHECK-NEXT:    [[B:%.*]] = icmp ne i8 %x, 17
2753; CHECK-NEXT:    ret i1 [[B]]
2754;
2755  %a = icmp eq i8 %x, 13
2756  %b = icmp ne i8 %x, 17
2757  %c = or i1 %a, %b
2758  ret i1 %c
2759}
2760
2761; x == 13 || x >=s 17
2762
2763define i1 @or_eq_sge(i8 %x) {
2764; CHECK-LABEL: @or_eq_sge(
2765; CHECK-NEXT:    [[A:%.*]] = icmp eq i8 %x, 13
2766; CHECK-NEXT:    [[B:%.*]] = icmp sge i8 %x, 17
2767; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
2768; CHECK-NEXT:    ret i1 [[C]]
2769;
2770  %a = icmp eq i8 %x, 13
2771  %b = icmp sge i8 %x, 17
2772  %c = or i1 %a, %b
2773  ret i1 %c
2774}
2775
2776; x == 13 || x >s 17
2777
2778define i1 @or_eq_sgt(i8 %x) {
2779; CHECK-LABEL: @or_eq_sgt(
2780; CHECK-NEXT:    [[A:%.*]] = icmp eq i8 %x, 13
2781; CHECK-NEXT:    [[B:%.*]] = icmp sgt i8 %x, 17
2782; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
2783; CHECK-NEXT:    ret i1 [[C]]
2784;
2785  %a = icmp eq i8 %x, 13
2786  %b = icmp sgt i8 %x, 17
2787  %c = or i1 %a, %b
2788  ret i1 %c
2789}
2790
2791; x == 13 || x <=s 17
2792
2793define i1 @or_eq_sle(i8 %x) {
2794; CHECK-LABEL: @or_eq_sle(
2795; CHECK-NEXT:    [[B:%.*]] = icmp sle i8 %x, 17
2796; CHECK-NEXT:    ret i1 [[B]]
2797;
2798  %a = icmp eq i8 %x, 13
2799  %b = icmp sle i8 %x, 17
2800  %c = or i1 %a, %b
2801  ret i1 %c
2802}
2803
2804; x == 13 || x <s 17
2805
2806define i1 @or_eq_slt(i8 %x) {
2807; CHECK-LABEL: @or_eq_slt(
2808; CHECK-NEXT:    [[B:%.*]] = icmp slt i8 %x, 17
2809; CHECK-NEXT:    ret i1 [[B]]
2810;
2811  %a = icmp eq i8 %x, 13
2812  %b = icmp slt i8 %x, 17
2813  %c = or i1 %a, %b
2814  ret i1 %c
2815}
2816
2817; x == 13 || x >=u 17
2818
2819define i1 @or_eq_uge(i8 %x) {
2820; CHECK-LABEL: @or_eq_uge(
2821; CHECK-NEXT:    [[A:%.*]] = icmp eq i8 %x, 13
2822; CHECK-NEXT:    [[B:%.*]] = icmp uge i8 %x, 17
2823; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
2824; CHECK-NEXT:    ret i1 [[C]]
2825;
2826  %a = icmp eq i8 %x, 13
2827  %b = icmp uge i8 %x, 17
2828  %c = or i1 %a, %b
2829  ret i1 %c
2830}
2831
2832; x == 13 || x >u 17
2833
2834define i1 @or_eq_ugt(i8 %x) {
2835; CHECK-LABEL: @or_eq_ugt(
2836; CHECK-NEXT:    [[A:%.*]] = icmp eq i8 %x, 13
2837; CHECK-NEXT:    [[B:%.*]] = icmp ugt i8 %x, 17
2838; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
2839; CHECK-NEXT:    ret i1 [[C]]
2840;
2841  %a = icmp eq i8 %x, 13
2842  %b = icmp ugt i8 %x, 17
2843  %c = or i1 %a, %b
2844  ret i1 %c
2845}
2846
2847; x == 13 || x <=u 17
2848
2849define i1 @or_eq_ule(i8 %x) {
2850; CHECK-LABEL: @or_eq_ule(
2851; CHECK-NEXT:    [[B:%.*]] = icmp ule i8 %x, 17
2852; CHECK-NEXT:    ret i1 [[B]]
2853;
2854  %a = icmp eq i8 %x, 13
2855  %b = icmp ule i8 %x, 17
2856  %c = or i1 %a, %b
2857  ret i1 %c
2858}
2859
2860; x == 13 || x <u 17
2861
2862define i1 @or_eq_ult(i8 %x) {
2863; CHECK-LABEL: @or_eq_ult(
2864; CHECK-NEXT:    [[B:%.*]] = icmp ult i8 %x, 17
2865; CHECK-NEXT:    ret i1 [[B]]
2866;
2867  %a = icmp eq i8 %x, 13
2868  %b = icmp ult i8 %x, 17
2869  %c = or i1 %a, %b
2870  ret i1 %c
2871}
2872
2873; ne
2874; x != 13 || x == 17
2875
2876define i1 @or_ne_eq(i8 %x) {
2877; CHECK-LABEL: @or_ne_eq(
2878; CHECK-NEXT:    [[A:%.*]] = icmp ne i8 %x, 13
2879; CHECK-NEXT:    ret i1 [[A]]
2880;
2881  %a = icmp ne i8 %x, 13
2882  %b = icmp eq i8 %x, 17
2883  %c = or i1 %a, %b
2884  ret i1 %c
2885}
2886
2887; x != 13 || x != 17
2888
2889define i1 @or_ne_ne(i8 %x) {
2890; CHECK-LABEL: @or_ne_ne(
2891; CHECK-NEXT:    ret i1 true
2892;
2893  %a = icmp ne i8 %x, 13
2894  %b = icmp ne i8 %x, 17
2895  %c = or i1 %a, %b
2896  ret i1 %c
2897}
2898
2899; x != 13 || x >=s 17
2900
2901define i1 @or_ne_sge(i8 %x) {
2902; CHECK-LABEL: @or_ne_sge(
2903; CHECK-NEXT:    [[A:%.*]] = icmp ne i8 %x, 13
2904; CHECK-NEXT:    ret i1 [[A]]
2905;
2906  %a = icmp ne i8 %x, 13
2907  %b = icmp sge i8 %x, 17
2908  %c = or i1 %a, %b
2909  ret i1 %c
2910}
2911
2912; x != 13 || x >s 17
2913
2914define i1 @or_ne_sgt(i8 %x) {
2915; CHECK-LABEL: @or_ne_sgt(
2916; CHECK-NEXT:    [[A:%.*]] = icmp ne i8 %x, 13
2917; CHECK-NEXT:    ret i1 [[A]]
2918;
2919  %a = icmp ne i8 %x, 13
2920  %b = icmp sgt i8 %x, 17
2921  %c = or i1 %a, %b
2922  ret i1 %c
2923}
2924
2925; x != 13 || x <=s 17
2926
2927define i1 @or_ne_sle(i8 %x) {
2928; CHECK-LABEL: @or_ne_sle(
2929; CHECK-NEXT:    ret i1 true
2930;
2931  %a = icmp ne i8 %x, 13
2932  %b = icmp sle i8 %x, 17
2933  %c = or i1 %a, %b
2934  ret i1 %c
2935}
2936
2937; x != 13 || x <s 17
2938
2939define i1 @or_ne_slt(i8 %x) {
2940; CHECK-LABEL: @or_ne_slt(
2941; CHECK-NEXT:    ret i1 true
2942;
2943  %a = icmp ne i8 %x, 13
2944  %b = icmp slt i8 %x, 17
2945  %c = or i1 %a, %b
2946  ret i1 %c
2947}
2948
2949; x != 13 || x >=u 17
2950
2951define i1 @or_ne_uge(i8 %x) {
2952; CHECK-LABEL: @or_ne_uge(
2953; CHECK-NEXT:    [[A:%.*]] = icmp ne i8 %x, 13
2954; CHECK-NEXT:    ret i1 [[A]]
2955;
2956  %a = icmp ne i8 %x, 13
2957  %b = icmp uge i8 %x, 17
2958  %c = or i1 %a, %b
2959  ret i1 %c
2960}
2961
2962; x != 13 || x >u 17
2963
2964define i1 @or_ne_ugt(i8 %x) {
2965; CHECK-LABEL: @or_ne_ugt(
2966; CHECK-NEXT:    [[A:%.*]] = icmp ne i8 %x, 13
2967; CHECK-NEXT:    ret i1 [[A]]
2968;
2969  %a = icmp ne i8 %x, 13
2970  %b = icmp ugt i8 %x, 17
2971  %c = or i1 %a, %b
2972  ret i1 %c
2973}
2974
2975; x != 13 || x <=u 17
2976
2977define i1 @or_ne_ule(i8 %x) {
2978; CHECK-LABEL: @or_ne_ule(
2979; CHECK-NEXT:    ret i1 true
2980;
2981  %a = icmp ne i8 %x, 13
2982  %b = icmp ule i8 %x, 17
2983  %c = or i1 %a, %b
2984  ret i1 %c
2985}
2986
2987; x != 13 || x <u 17
2988
2989define i1 @or_ne_ult(i8 %x) {
2990; CHECK-LABEL: @or_ne_ult(
2991; CHECK-NEXT:    ret i1 true
2992;
2993  %a = icmp ne i8 %x, 13
2994  %b = icmp ult i8 %x, 17
2995  %c = or i1 %a, %b
2996  ret i1 %c
2997}
2998
2999; sge
3000; x >=s 13 || x == 17
3001
3002define i1 @or_sge_eq(i8 %x) {
3003; CHECK-LABEL: @or_sge_eq(
3004; CHECK-NEXT:    [[A:%.*]] = icmp sge i8 %x, 13
3005; CHECK-NEXT:    ret i1 [[A]]
3006;
3007  %a = icmp sge i8 %x, 13
3008  %b = icmp eq i8 %x, 17
3009  %c = or i1 %a, %b
3010  ret i1 %c
3011}
3012
3013; x >=s 13 || x != 17
3014
3015define i1 @or_sge_ne(i8 %x) {
3016; CHECK-LABEL: @or_sge_ne(
3017; CHECK-NEXT:    ret i1 true
3018;
3019  %a = icmp sge i8 %x, 13
3020  %b = icmp ne i8 %x, 17
3021  %c = or i1 %a, %b
3022  ret i1 %c
3023}
3024
3025; x >=s 13 || x >=s 17
3026
3027define i1 @or_sge_sge(i8 %x) {
3028; CHECK-LABEL: @or_sge_sge(
3029; CHECK-NEXT:    [[A:%.*]] = icmp sge i8 %x, 13
3030; CHECK-NEXT:    ret i1 [[A]]
3031;
3032  %a = icmp sge i8 %x, 13
3033  %b = icmp sge i8 %x, 17
3034  %c = or i1 %a, %b
3035  ret i1 %c
3036}
3037
3038; x >=s 13 || x >s 17
3039
3040define i1 @or_sge_sgt(i8 %x) {
3041; CHECK-LABEL: @or_sge_sgt(
3042; CHECK-NEXT:    [[A:%.*]] = icmp sge i8 %x, 13
3043; CHECK-NEXT:    ret i1 [[A]]
3044;
3045  %a = icmp sge i8 %x, 13
3046  %b = icmp sgt i8 %x, 17
3047  %c = or i1 %a, %b
3048  ret i1 %c
3049}
3050
3051; x >=s 13 || x <=s 17
3052
3053define i1 @or_sge_sle(i8 %x) {
3054; CHECK-LABEL: @or_sge_sle(
3055; CHECK-NEXT:    ret i1 true
3056;
3057  %a = icmp sge i8 %x, 13
3058  %b = icmp sle i8 %x, 17
3059  %c = or i1 %a, %b
3060  ret i1 %c
3061}
3062
3063; x >=s 13 || x <s 17
3064
3065define i1 @or_sge_slt(i8 %x) {
3066; CHECK-LABEL: @or_sge_slt(
3067; CHECK-NEXT:    ret i1 true
3068;
3069  %a = icmp sge i8 %x, 13
3070  %b = icmp slt i8 %x, 17
3071  %c = or i1 %a, %b
3072  ret i1 %c
3073}
3074
3075; x >=s 13 || x >=u 17
3076
3077define i1 @or_sge_uge(i8 %x) {
3078; CHECK-LABEL: @or_sge_uge(
3079; CHECK-NEXT:    [[A:%.*]] = icmp sge i8 %x, 13
3080; CHECK-NEXT:    [[B:%.*]] = icmp uge i8 %x, 17
3081; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
3082; CHECK-NEXT:    ret i1 [[C]]
3083;
3084  %a = icmp sge i8 %x, 13
3085  %b = icmp uge i8 %x, 17
3086  %c = or i1 %a, %b
3087  ret i1 %c
3088}
3089
3090; x >=s 13 || x >u 17
3091
3092define i1 @or_sge_ugt(i8 %x) {
3093; CHECK-LABEL: @or_sge_ugt(
3094; CHECK-NEXT:    [[A:%.*]] = icmp sge i8 %x, 13
3095; CHECK-NEXT:    [[B:%.*]] = icmp ugt i8 %x, 17
3096; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
3097; CHECK-NEXT:    ret i1 [[C]]
3098;
3099  %a = icmp sge i8 %x, 13
3100  %b = icmp ugt i8 %x, 17
3101  %c = or i1 %a, %b
3102  ret i1 %c
3103}
3104
3105; x >=s 13 || x <=u 17
3106
3107define i1 @or_sge_ule(i8 %x) {
3108; CHECK-LABEL: @or_sge_ule(
3109; CHECK-NEXT:    [[A:%.*]] = icmp sge i8 %x, 13
3110; CHECK-NEXT:    [[B:%.*]] = icmp ule i8 %x, 17
3111; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
3112; CHECK-NEXT:    ret i1 [[C]]
3113;
3114  %a = icmp sge i8 %x, 13
3115  %b = icmp ule i8 %x, 17
3116  %c = or i1 %a, %b
3117  ret i1 %c
3118}
3119
3120; x >=s 13 || x <u 17
3121
3122define i1 @or_sge_ult(i8 %x) {
3123; CHECK-LABEL: @or_sge_ult(
3124; CHECK-NEXT:    [[A:%.*]] = icmp sge i8 %x, 13
3125; CHECK-NEXT:    [[B:%.*]] = icmp ult i8 %x, 17
3126; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
3127; CHECK-NEXT:    ret i1 [[C]]
3128;
3129  %a = icmp sge i8 %x, 13
3130  %b = icmp ult i8 %x, 17
3131  %c = or i1 %a, %b
3132  ret i1 %c
3133}
3134
3135; sgt
3136; x >s 13 || x == 17
3137
3138define i1 @or_sgt_eq(i8 %x) {
3139; CHECK-LABEL: @or_sgt_eq(
3140; CHECK-NEXT:    [[A:%.*]] = icmp sgt i8 %x, 13
3141; CHECK-NEXT:    ret i1 [[A]]
3142;
3143  %a = icmp sgt i8 %x, 13
3144  %b = icmp eq i8 %x, 17
3145  %c = or i1 %a, %b
3146  ret i1 %c
3147}
3148
3149; x >s 13 || x != 17
3150
3151define i1 @or_sgt_ne(i8 %x) {
3152; CHECK-LABEL: @or_sgt_ne(
3153; CHECK-NEXT:    ret i1 true
3154;
3155  %a = icmp sgt i8 %x, 13
3156  %b = icmp ne i8 %x, 17
3157  %c = or i1 %a, %b
3158  ret i1 %c
3159}
3160
3161; x >s 13 || x >=s 17
3162
3163define i1 @or_sgt_sge(i8 %x) {
3164; CHECK-LABEL: @or_sgt_sge(
3165; CHECK-NEXT:    [[A:%.*]] = icmp sgt i8 %x, 13
3166; CHECK-NEXT:    ret i1 [[A]]
3167;
3168  %a = icmp sgt i8 %x, 13
3169  %b = icmp sge i8 %x, 17
3170  %c = or i1 %a, %b
3171  ret i1 %c
3172}
3173
3174; x >s 13 || x >s 17
3175
3176define i1 @or_sgt_sgt(i8 %x) {
3177; CHECK-LABEL: @or_sgt_sgt(
3178; CHECK-NEXT:    [[A:%.*]] = icmp sgt i8 %x, 13
3179; CHECK-NEXT:    ret i1 [[A]]
3180;
3181  %a = icmp sgt i8 %x, 13
3182  %b = icmp sgt i8 %x, 17
3183  %c = or i1 %a, %b
3184  ret i1 %c
3185}
3186
3187; x >s 13 || x <=s 17
3188
3189define i1 @or_sgt_sle(i8 %x) {
3190; CHECK-LABEL: @or_sgt_sle(
3191; CHECK-NEXT:    ret i1 true
3192;
3193  %a = icmp sgt i8 %x, 13
3194  %b = icmp sle i8 %x, 17
3195  %c = or i1 %a, %b
3196  ret i1 %c
3197}
3198
3199; x >s 13 || x <s 17
3200
3201define i1 @or_sgt_slt(i8 %x) {
3202; CHECK-LABEL: @or_sgt_slt(
3203; CHECK-NEXT:    ret i1 true
3204;
3205  %a = icmp sgt i8 %x, 13
3206  %b = icmp slt i8 %x, 17
3207  %c = or i1 %a, %b
3208  ret i1 %c
3209}
3210
3211; x >s 13 || x >=u 17
3212
3213define i1 @or_sgt_uge(i8 %x) {
3214; CHECK-LABEL: @or_sgt_uge(
3215; CHECK-NEXT:    [[A:%.*]] = icmp sgt i8 %x, 13
3216; CHECK-NEXT:    [[B:%.*]] = icmp uge i8 %x, 17
3217; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
3218; CHECK-NEXT:    ret i1 [[C]]
3219;
3220  %a = icmp sgt i8 %x, 13
3221  %b = icmp uge i8 %x, 17
3222  %c = or i1 %a, %b
3223  ret i1 %c
3224}
3225
3226; x >s 13 || x >u 17
3227
3228define i1 @or_sgt_ugt(i8 %x) {
3229; CHECK-LABEL: @or_sgt_ugt(
3230; CHECK-NEXT:    [[A:%.*]] = icmp sgt i8 %x, 13
3231; CHECK-NEXT:    [[B:%.*]] = icmp ugt i8 %x, 17
3232; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
3233; CHECK-NEXT:    ret i1 [[C]]
3234;
3235  %a = icmp sgt i8 %x, 13
3236  %b = icmp ugt i8 %x, 17
3237  %c = or i1 %a, %b
3238  ret i1 %c
3239}
3240
3241; x >s 13 || x <=u 17
3242
3243define i1 @or_sgt_ule(i8 %x) {
3244; CHECK-LABEL: @or_sgt_ule(
3245; CHECK-NEXT:    [[A:%.*]] = icmp sgt i8 %x, 13
3246; CHECK-NEXT:    [[B:%.*]] = icmp ule i8 %x, 17
3247; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
3248; CHECK-NEXT:    ret i1 [[C]]
3249;
3250  %a = icmp sgt i8 %x, 13
3251  %b = icmp ule i8 %x, 17
3252  %c = or i1 %a, %b
3253  ret i1 %c
3254}
3255
3256; x >s 13 || x <u 17
3257
3258define i1 @or_sgt_ult(i8 %x) {
3259; CHECK-LABEL: @or_sgt_ult(
3260; CHECK-NEXT:    [[A:%.*]] = icmp sgt i8 %x, 13
3261; CHECK-NEXT:    [[B:%.*]] = icmp ult i8 %x, 17
3262; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
3263; CHECK-NEXT:    ret i1 [[C]]
3264;
3265  %a = icmp sgt i8 %x, 13
3266  %b = icmp ult i8 %x, 17
3267  %c = or i1 %a, %b
3268  ret i1 %c
3269}
3270
3271; sle
3272; x <=s 13 || x == 17
3273
3274define i1 @or_sle_eq(i8 %x) {
3275; CHECK-LABEL: @or_sle_eq(
3276; CHECK-NEXT:    [[A:%.*]] = icmp sle i8 %x, 13
3277; CHECK-NEXT:    [[B:%.*]] = icmp eq i8 %x, 17
3278; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
3279; CHECK-NEXT:    ret i1 [[C]]
3280;
3281  %a = icmp sle i8 %x, 13
3282  %b = icmp eq i8 %x, 17
3283  %c = or i1 %a, %b
3284  ret i1 %c
3285}
3286
3287; x <=s 13 || x != 17
3288
3289define i1 @or_sle_ne(i8 %x) {
3290; CHECK-LABEL: @or_sle_ne(
3291; CHECK-NEXT:    [[B:%.*]] = icmp ne i8 %x, 17
3292; CHECK-NEXT:    ret i1 [[B]]
3293;
3294  %a = icmp sle i8 %x, 13
3295  %b = icmp ne i8 %x, 17
3296  %c = or i1 %a, %b
3297  ret i1 %c
3298}
3299
3300; x <=s 13 || x >=s 17
3301
3302define i1 @or_sle_sge(i8 %x) {
3303; CHECK-LABEL: @or_sle_sge(
3304; CHECK-NEXT:    [[A:%.*]] = icmp sle i8 %x, 13
3305; CHECK-NEXT:    [[B:%.*]] = icmp sge i8 %x, 17
3306; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
3307; CHECK-NEXT:    ret i1 [[C]]
3308;
3309  %a = icmp sle i8 %x, 13
3310  %b = icmp sge i8 %x, 17
3311  %c = or i1 %a, %b
3312  ret i1 %c
3313}
3314
3315; x <=s 13 || x >s 17
3316
3317define i1 @or_sle_sgt(i8 %x) {
3318; CHECK-LABEL: @or_sle_sgt(
3319; CHECK-NEXT:    [[A:%.*]] = icmp sle i8 %x, 13
3320; CHECK-NEXT:    [[B:%.*]] = icmp sgt i8 %x, 17
3321; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
3322; CHECK-NEXT:    ret i1 [[C]]
3323;
3324  %a = icmp sle i8 %x, 13
3325  %b = icmp sgt i8 %x, 17
3326  %c = or i1 %a, %b
3327  ret i1 %c
3328}
3329
3330; x <=s 13 || x <=s 17
3331
3332define i1 @or_sle_sle(i8 %x) {
3333; CHECK-LABEL: @or_sle_sle(
3334; CHECK-NEXT:    [[B:%.*]] = icmp sle i8 %x, 17
3335; CHECK-NEXT:    ret i1 [[B]]
3336;
3337  %a = icmp sle i8 %x, 13
3338  %b = icmp sle i8 %x, 17
3339  %c = or i1 %a, %b
3340  ret i1 %c
3341}
3342
3343; x <=s 13 || x <s 17
3344
3345define i1 @or_sle_slt(i8 %x) {
3346; CHECK-LABEL: @or_sle_slt(
3347; CHECK-NEXT:    [[B:%.*]] = icmp slt i8 %x, 17
3348; CHECK-NEXT:    ret i1 [[B]]
3349;
3350  %a = icmp sle i8 %x, 13
3351  %b = icmp slt i8 %x, 17
3352  %c = or i1 %a, %b
3353  ret i1 %c
3354}
3355
3356; x <=s 13 || x >=u 17
3357
3358define i1 @or_sle_uge(i8 %x) {
3359; CHECK-LABEL: @or_sle_uge(
3360; CHECK-NEXT:    [[A:%.*]] = icmp sle i8 %x, 13
3361; CHECK-NEXT:    [[B:%.*]] = icmp uge i8 %x, 17
3362; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
3363; CHECK-NEXT:    ret i1 [[C]]
3364;
3365  %a = icmp sle i8 %x, 13
3366  %b = icmp uge i8 %x, 17
3367  %c = or i1 %a, %b
3368  ret i1 %c
3369}
3370
3371; x <=s 13 || x >u 17
3372
3373define i1 @or_sle_ugt(i8 %x) {
3374; CHECK-LABEL: @or_sle_ugt(
3375; CHECK-NEXT:    [[A:%.*]] = icmp sle i8 %x, 13
3376; CHECK-NEXT:    [[B:%.*]] = icmp ugt i8 %x, 17
3377; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
3378; CHECK-NEXT:    ret i1 [[C]]
3379;
3380  %a = icmp sle i8 %x, 13
3381  %b = icmp ugt i8 %x, 17
3382  %c = or i1 %a, %b
3383  ret i1 %c
3384}
3385
3386; x <=s 13 || x <=u 17
3387
3388define i1 @or_sle_ule(i8 %x) {
3389; CHECK-LABEL: @or_sle_ule(
3390; CHECK-NEXT:    [[A:%.*]] = icmp sle i8 %x, 13
3391; CHECK-NEXT:    [[B:%.*]] = icmp ule i8 %x, 17
3392; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
3393; CHECK-NEXT:    ret i1 [[C]]
3394;
3395  %a = icmp sle i8 %x, 13
3396  %b = icmp ule i8 %x, 17
3397  %c = or i1 %a, %b
3398  ret i1 %c
3399}
3400
3401; x <=s 13 || x <u 17
3402
3403define i1 @or_sle_ult(i8 %x) {
3404; CHECK-LABEL: @or_sle_ult(
3405; CHECK-NEXT:    [[A:%.*]] = icmp sle i8 %x, 13
3406; CHECK-NEXT:    [[B:%.*]] = icmp ult i8 %x, 17
3407; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
3408; CHECK-NEXT:    ret i1 [[C]]
3409;
3410  %a = icmp sle i8 %x, 13
3411  %b = icmp ult i8 %x, 17
3412  %c = or i1 %a, %b
3413  ret i1 %c
3414}
3415
3416; slt
3417; x <s 13 || x == 17
3418
3419define i1 @or_slt_eq(i8 %x) {
3420; CHECK-LABEL: @or_slt_eq(
3421; CHECK-NEXT:    [[A:%.*]] = icmp slt i8 %x, 13
3422; CHECK-NEXT:    [[B:%.*]] = icmp eq i8 %x, 17
3423; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
3424; CHECK-NEXT:    ret i1 [[C]]
3425;
3426  %a = icmp slt i8 %x, 13
3427  %b = icmp eq i8 %x, 17
3428  %c = or i1 %a, %b
3429  ret i1 %c
3430}
3431
3432; x <s 13 || x != 17
3433
3434define i1 @or_slt_ne(i8 %x) {
3435; CHECK-LABEL: @or_slt_ne(
3436; CHECK-NEXT:    [[B:%.*]] = icmp ne i8 %x, 17
3437; CHECK-NEXT:    ret i1 [[B]]
3438;
3439  %a = icmp slt i8 %x, 13
3440  %b = icmp ne i8 %x, 17
3441  %c = or i1 %a, %b
3442  ret i1 %c
3443}
3444
3445; x <s 13 || x >=s 17
3446
3447define i1 @or_slt_sge(i8 %x) {
3448; CHECK-LABEL: @or_slt_sge(
3449; CHECK-NEXT:    [[A:%.*]] = icmp slt i8 %x, 13
3450; CHECK-NEXT:    [[B:%.*]] = icmp sge i8 %x, 17
3451; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
3452; CHECK-NEXT:    ret i1 [[C]]
3453;
3454  %a = icmp slt i8 %x, 13
3455  %b = icmp sge i8 %x, 17
3456  %c = or i1 %a, %b
3457  ret i1 %c
3458}
3459
3460; x <s 13 || x >s 17
3461
3462define i1 @or_slt_sgt(i8 %x) {
3463; CHECK-LABEL: @or_slt_sgt(
3464; CHECK-NEXT:    [[A:%.*]] = icmp slt i8 %x, 13
3465; CHECK-NEXT:    [[B:%.*]] = icmp sgt i8 %x, 17
3466; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
3467; CHECK-NEXT:    ret i1 [[C]]
3468;
3469  %a = icmp slt i8 %x, 13
3470  %b = icmp sgt i8 %x, 17
3471  %c = or i1 %a, %b
3472  ret i1 %c
3473}
3474
3475; x <s 13 || x <=s 17
3476
3477define i1 @or_slt_sle(i8 %x) {
3478; CHECK-LABEL: @or_slt_sle(
3479; CHECK-NEXT:    [[B:%.*]] = icmp sle i8 %x, 17
3480; CHECK-NEXT:    ret i1 [[B]]
3481;
3482  %a = icmp slt i8 %x, 13
3483  %b = icmp sle i8 %x, 17
3484  %c = or i1 %a, %b
3485  ret i1 %c
3486}
3487
3488; x <s 13 || x <s 17
3489
3490define i1 @or_slt_slt(i8 %x) {
3491; CHECK-LABEL: @or_slt_slt(
3492; CHECK-NEXT:    [[B:%.*]] = icmp slt i8 %x, 17
3493; CHECK-NEXT:    ret i1 [[B]]
3494;
3495  %a = icmp slt i8 %x, 13
3496  %b = icmp slt i8 %x, 17
3497  %c = or i1 %a, %b
3498  ret i1 %c
3499}
3500
3501; x <s 13 || x >=u 17
3502
3503define i1 @or_slt_uge(i8 %x) {
3504; CHECK-LABEL: @or_slt_uge(
3505; CHECK-NEXT:    [[A:%.*]] = icmp slt i8 %x, 13
3506; CHECK-NEXT:    [[B:%.*]] = icmp uge i8 %x, 17
3507; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
3508; CHECK-NEXT:    ret i1 [[C]]
3509;
3510  %a = icmp slt i8 %x, 13
3511  %b = icmp uge i8 %x, 17
3512  %c = or i1 %a, %b
3513  ret i1 %c
3514}
3515
3516; x <s 13 || x >u 17
3517
3518define i1 @or_slt_ugt(i8 %x) {
3519; CHECK-LABEL: @or_slt_ugt(
3520; CHECK-NEXT:    [[A:%.*]] = icmp slt i8 %x, 13
3521; CHECK-NEXT:    [[B:%.*]] = icmp ugt i8 %x, 17
3522; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
3523; CHECK-NEXT:    ret i1 [[C]]
3524;
3525  %a = icmp slt i8 %x, 13
3526  %b = icmp ugt i8 %x, 17
3527  %c = or i1 %a, %b
3528  ret i1 %c
3529}
3530
3531; x <s 13 || x <=u 17
3532
3533define i1 @or_slt_ule(i8 %x) {
3534; CHECK-LABEL: @or_slt_ule(
3535; CHECK-NEXT:    [[A:%.*]] = icmp slt i8 %x, 13
3536; CHECK-NEXT:    [[B:%.*]] = icmp ule i8 %x, 17
3537; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
3538; CHECK-NEXT:    ret i1 [[C]]
3539;
3540  %a = icmp slt i8 %x, 13
3541  %b = icmp ule i8 %x, 17
3542  %c = or i1 %a, %b
3543  ret i1 %c
3544}
3545
3546; x <s 13 || x <u 17
3547
3548define i1 @or_slt_ult(i8 %x) {
3549; CHECK-LABEL: @or_slt_ult(
3550; CHECK-NEXT:    [[A:%.*]] = icmp slt i8 %x, 13
3551; CHECK-NEXT:    [[B:%.*]] = icmp ult i8 %x, 17
3552; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
3553; CHECK-NEXT:    ret i1 [[C]]
3554;
3555  %a = icmp slt i8 %x, 13
3556  %b = icmp ult i8 %x, 17
3557  %c = or i1 %a, %b
3558  ret i1 %c
3559}
3560
3561; uge
3562; x >=u 13 || x == 17
3563
3564define i1 @or_uge_eq(i8 %x) {
3565; CHECK-LABEL: @or_uge_eq(
3566; CHECK-NEXT:    [[A:%.*]] = icmp uge i8 %x, 13
3567; CHECK-NEXT:    ret i1 [[A]]
3568;
3569  %a = icmp uge i8 %x, 13
3570  %b = icmp eq i8 %x, 17
3571  %c = or i1 %a, %b
3572  ret i1 %c
3573}
3574
3575; x >=u 13 || x != 17
3576
3577define i1 @or_uge_ne(i8 %x) {
3578; CHECK-LABEL: @or_uge_ne(
3579; CHECK-NEXT:    ret i1 true
3580;
3581  %a = icmp uge i8 %x, 13
3582  %b = icmp ne i8 %x, 17
3583  %c = or i1 %a, %b
3584  ret i1 %c
3585}
3586
3587; x >=u 13 || x >=s 17
3588
3589define i1 @or_uge_sge(i8 %x) {
3590; CHECK-LABEL: @or_uge_sge(
3591; CHECK-NEXT:    [[A:%.*]] = icmp uge i8 %x, 13
3592; CHECK-NEXT:    ret i1 [[A]]
3593;
3594  %a = icmp uge i8 %x, 13
3595  %b = icmp sge i8 %x, 17
3596  %c = or i1 %a, %b
3597  ret i1 %c
3598}
3599
3600; x >=u 13 || x >s 17
3601
3602define i1 @or_uge_sgt(i8 %x) {
3603; CHECK-LABEL: @or_uge_sgt(
3604; CHECK-NEXT:    [[A:%.*]] = icmp uge i8 %x, 13
3605; CHECK-NEXT:    ret i1 [[A]]
3606;
3607  %a = icmp uge i8 %x, 13
3608  %b = icmp sgt i8 %x, 17
3609  %c = or i1 %a, %b
3610  ret i1 %c
3611}
3612
3613; x >=u 13 || x <=s 17
3614
3615define i1 @or_uge_sle(i8 %x) {
3616; CHECK-LABEL: @or_uge_sle(
3617; CHECK-NEXT:    ret i1 true
3618;
3619  %a = icmp uge i8 %x, 13
3620  %b = icmp sle i8 %x, 17
3621  %c = or i1 %a, %b
3622  ret i1 %c
3623}
3624
3625; x >=u 13 || x <s 17
3626
3627define i1 @or_uge_slt(i8 %x) {
3628; CHECK-LABEL: @or_uge_slt(
3629; CHECK-NEXT:    ret i1 true
3630;
3631  %a = icmp uge i8 %x, 13
3632  %b = icmp slt i8 %x, 17
3633  %c = or i1 %a, %b
3634  ret i1 %c
3635}
3636
3637; x >=u 13 || x >=u 17
3638
3639define i1 @or_uge_uge(i8 %x) {
3640; CHECK-LABEL: @or_uge_uge(
3641; CHECK-NEXT:    [[A:%.*]] = icmp uge i8 %x, 13
3642; CHECK-NEXT:    ret i1 [[A]]
3643;
3644  %a = icmp uge i8 %x, 13
3645  %b = icmp uge i8 %x, 17
3646  %c = or i1 %a, %b
3647  ret i1 %c
3648}
3649
3650; x >=u 13 || x >u 17
3651
3652define i1 @or_uge_ugt(i8 %x) {
3653; CHECK-LABEL: @or_uge_ugt(
3654; CHECK-NEXT:    [[A:%.*]] = icmp uge i8 %x, 13
3655; CHECK-NEXT:    ret i1 [[A]]
3656;
3657  %a = icmp uge i8 %x, 13
3658  %b = icmp ugt i8 %x, 17
3659  %c = or i1 %a, %b
3660  ret i1 %c
3661}
3662
3663; x >=u 13 || x <=u 17
3664
3665define i1 @or_uge_ule(i8 %x) {
3666; CHECK-LABEL: @or_uge_ule(
3667; CHECK-NEXT:    ret i1 true
3668;
3669  %a = icmp uge i8 %x, 13
3670  %b = icmp ule i8 %x, 17
3671  %c = or i1 %a, %b
3672  ret i1 %c
3673}
3674
3675; x >=u 13 || x <u 17
3676
3677define i1 @or_uge_ult(i8 %x) {
3678; CHECK-LABEL: @or_uge_ult(
3679; CHECK-NEXT:    ret i1 true
3680;
3681  %a = icmp uge i8 %x, 13
3682  %b = icmp ult i8 %x, 17
3683  %c = or i1 %a, %b
3684  ret i1 %c
3685}
3686
3687; ugt
3688; x >u 13 || x == 17
3689
3690define i1 @or_ugt_eq(i8 %x) {
3691; CHECK-LABEL: @or_ugt_eq(
3692; CHECK-NEXT:    [[A:%.*]] = icmp ugt i8 %x, 13
3693; CHECK-NEXT:    ret i1 [[A]]
3694;
3695  %a = icmp ugt i8 %x, 13
3696  %b = icmp eq i8 %x, 17
3697  %c = or i1 %a, %b
3698  ret i1 %c
3699}
3700
3701; x >u 13 || x != 17
3702
3703define i1 @or_ugt_ne(i8 %x) {
3704; CHECK-LABEL: @or_ugt_ne(
3705; CHECK-NEXT:    ret i1 true
3706;
3707  %a = icmp ugt i8 %x, 13
3708  %b = icmp ne i8 %x, 17
3709  %c = or i1 %a, %b
3710  ret i1 %c
3711}
3712
3713; x >u 13 || x >=s 17
3714
3715define i1 @or_ugt_sge(i8 %x) {
3716; CHECK-LABEL: @or_ugt_sge(
3717; CHECK-NEXT:    [[A:%.*]] = icmp ugt i8 %x, 13
3718; CHECK-NEXT:    ret i1 [[A]]
3719;
3720  %a = icmp ugt i8 %x, 13
3721  %b = icmp sge i8 %x, 17
3722  %c = or i1 %a, %b
3723  ret i1 %c
3724}
3725
3726; x >u 13 || x >s 17
3727
3728define i1 @or_ugt_sgt(i8 %x) {
3729; CHECK-LABEL: @or_ugt_sgt(
3730; CHECK-NEXT:    [[A:%.*]] = icmp ugt i8 %x, 13
3731; CHECK-NEXT:    ret i1 [[A]]
3732;
3733  %a = icmp ugt i8 %x, 13
3734  %b = icmp sgt i8 %x, 17
3735  %c = or i1 %a, %b
3736  ret i1 %c
3737}
3738
3739; x >u 13 || x <=s 17
3740
3741define i1 @or_ugt_sle(i8 %x) {
3742; CHECK-LABEL: @or_ugt_sle(
3743; CHECK-NEXT:    ret i1 true
3744;
3745  %a = icmp ugt i8 %x, 13
3746  %b = icmp sle i8 %x, 17
3747  %c = or i1 %a, %b
3748  ret i1 %c
3749}
3750
3751; x >u 13 || x <s 17
3752
3753define i1 @or_ugt_slt(i8 %x) {
3754; CHECK-LABEL: @or_ugt_slt(
3755; CHECK-NEXT:    ret i1 true
3756;
3757  %a = icmp ugt i8 %x, 13
3758  %b = icmp slt i8 %x, 17
3759  %c = or i1 %a, %b
3760  ret i1 %c
3761}
3762
3763; x >u 13 || x >=u 17
3764
3765define i1 @or_ugt_uge(i8 %x) {
3766; CHECK-LABEL: @or_ugt_uge(
3767; CHECK-NEXT:    [[A:%.*]] = icmp ugt i8 %x, 13
3768; CHECK-NEXT:    ret i1 [[A]]
3769;
3770  %a = icmp ugt i8 %x, 13
3771  %b = icmp uge i8 %x, 17
3772  %c = or i1 %a, %b
3773  ret i1 %c
3774}
3775
3776; x >u 13 || x >u 17
3777
3778define i1 @or_ugt_ugt(i8 %x) {
3779; CHECK-LABEL: @or_ugt_ugt(
3780; CHECK-NEXT:    [[A:%.*]] = icmp ugt i8 %x, 13
3781; CHECK-NEXT:    ret i1 [[A]]
3782;
3783  %a = icmp ugt i8 %x, 13
3784  %b = icmp ugt i8 %x, 17
3785  %c = or i1 %a, %b
3786  ret i1 %c
3787}
3788
3789; x >u 13 || x <=u 17
3790
3791define i1 @or_ugt_ule(i8 %x) {
3792; CHECK-LABEL: @or_ugt_ule(
3793; CHECK-NEXT:    ret i1 true
3794;
3795  %a = icmp ugt i8 %x, 13
3796  %b = icmp ule i8 %x, 17
3797  %c = or i1 %a, %b
3798  ret i1 %c
3799}
3800
3801; x >u 13 || x <u 17
3802
3803define i1 @or_ugt_ult(i8 %x) {
3804; CHECK-LABEL: @or_ugt_ult(
3805; CHECK-NEXT:    ret i1 true
3806;
3807  %a = icmp ugt i8 %x, 13
3808  %b = icmp ult i8 %x, 17
3809  %c = or i1 %a, %b
3810  ret i1 %c
3811}
3812
3813; ule
3814; x <=u 13 || x == 17
3815
3816define i1 @or_ule_eq(i8 %x) {
3817; CHECK-LABEL: @or_ule_eq(
3818; CHECK-NEXT:    [[A:%.*]] = icmp ule i8 %x, 13
3819; CHECK-NEXT:    [[B:%.*]] = icmp eq i8 %x, 17
3820; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
3821; CHECK-NEXT:    ret i1 [[C]]
3822;
3823  %a = icmp ule i8 %x, 13
3824  %b = icmp eq i8 %x, 17
3825  %c = or i1 %a, %b
3826  ret i1 %c
3827}
3828
3829; x <=u 13 || x != 17
3830
3831define i1 @or_ule_ne(i8 %x) {
3832; CHECK-LABEL: @or_ule_ne(
3833; CHECK-NEXT:    [[B:%.*]] = icmp ne i8 %x, 17
3834; CHECK-NEXT:    ret i1 [[B]]
3835;
3836  %a = icmp ule i8 %x, 13
3837  %b = icmp ne i8 %x, 17
3838  %c = or i1 %a, %b
3839  ret i1 %c
3840}
3841
3842; x <=u 13 || x >=s 17
3843
3844define i1 @or_ule_sge(i8 %x) {
3845; CHECK-LABEL: @or_ule_sge(
3846; CHECK-NEXT:    [[A:%.*]] = icmp ule i8 %x, 13
3847; CHECK-NEXT:    [[B:%.*]] = icmp sge i8 %x, 17
3848; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
3849; CHECK-NEXT:    ret i1 [[C]]
3850;
3851  %a = icmp ule i8 %x, 13
3852  %b = icmp sge i8 %x, 17
3853  %c = or i1 %a, %b
3854  ret i1 %c
3855}
3856
3857; x <=u 13 || x >s 17
3858
3859define i1 @or_ule_sgt(i8 %x) {
3860; CHECK-LABEL: @or_ule_sgt(
3861; CHECK-NEXT:    [[A:%.*]] = icmp ule i8 %x, 13
3862; CHECK-NEXT:    [[B:%.*]] = icmp sgt i8 %x, 17
3863; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
3864; CHECK-NEXT:    ret i1 [[C]]
3865;
3866  %a = icmp ule i8 %x, 13
3867  %b = icmp sgt i8 %x, 17
3868  %c = or i1 %a, %b
3869  ret i1 %c
3870}
3871
3872; x <=u 13 || x <=s 17
3873
3874define i1 @or_ule_sle(i8 %x) {
3875; CHECK-LABEL: @or_ule_sle(
3876; CHECK-NEXT:    [[B:%.*]] = icmp sle i8 %x, 17
3877; CHECK-NEXT:    ret i1 [[B]]
3878;
3879  %a = icmp ule i8 %x, 13
3880  %b = icmp sle i8 %x, 17
3881  %c = or i1 %a, %b
3882  ret i1 %c
3883}
3884
3885; x <=u 13 || x <s 17
3886
3887define i1 @or_ule_slt(i8 %x) {
3888; CHECK-LABEL: @or_ule_slt(
3889; CHECK-NEXT:    [[B:%.*]] = icmp slt i8 %x, 17
3890; CHECK-NEXT:    ret i1 [[B]]
3891;
3892  %a = icmp ule i8 %x, 13
3893  %b = icmp slt i8 %x, 17
3894  %c = or i1 %a, %b
3895  ret i1 %c
3896}
3897
3898; x <=u 13 || x >=u 17
3899
3900define i1 @or_ule_uge(i8 %x) {
3901; CHECK-LABEL: @or_ule_uge(
3902; CHECK-NEXT:    [[A:%.*]] = icmp ule i8 %x, 13
3903; CHECK-NEXT:    [[B:%.*]] = icmp uge i8 %x, 17
3904; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
3905; CHECK-NEXT:    ret i1 [[C]]
3906;
3907  %a = icmp ule i8 %x, 13
3908  %b = icmp uge i8 %x, 17
3909  %c = or i1 %a, %b
3910  ret i1 %c
3911}
3912
3913; x <=u 13 || x >u 17
3914
3915define i1 @or_ule_ugt(i8 %x) {
3916; CHECK-LABEL: @or_ule_ugt(
3917; CHECK-NEXT:    [[A:%.*]] = icmp ule i8 %x, 13
3918; CHECK-NEXT:    [[B:%.*]] = icmp ugt i8 %x, 17
3919; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
3920; CHECK-NEXT:    ret i1 [[C]]
3921;
3922  %a = icmp ule i8 %x, 13
3923  %b = icmp ugt i8 %x, 17
3924  %c = or i1 %a, %b
3925  ret i1 %c
3926}
3927
3928; x <=u 13 || x <=u 17
3929
3930define i1 @or_ule_ule(i8 %x) {
3931; CHECK-LABEL: @or_ule_ule(
3932; CHECK-NEXT:    [[B:%.*]] = icmp ule i8 %x, 17
3933; CHECK-NEXT:    ret i1 [[B]]
3934;
3935  %a = icmp ule i8 %x, 13
3936  %b = icmp ule i8 %x, 17
3937  %c = or i1 %a, %b
3938  ret i1 %c
3939}
3940
3941; x <=u 13 || x <u 17
3942
3943define i1 @or_ule_ult(i8 %x) {
3944; CHECK-LABEL: @or_ule_ult(
3945; CHECK-NEXT:    [[B:%.*]] = icmp ult i8 %x, 17
3946; CHECK-NEXT:    ret i1 [[B]]
3947;
3948  %a = icmp ule i8 %x, 13
3949  %b = icmp ult i8 %x, 17
3950  %c = or i1 %a, %b
3951  ret i1 %c
3952}
3953
3954; ult
3955; x <u 13 || x == 17
3956
3957define i1 @or_ult_eq(i8 %x) {
3958; CHECK-LABEL: @or_ult_eq(
3959; CHECK-NEXT:    [[A:%.*]] = icmp ult i8 %x, 13
3960; CHECK-NEXT:    [[B:%.*]] = icmp eq i8 %x, 17
3961; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
3962; CHECK-NEXT:    ret i1 [[C]]
3963;
3964  %a = icmp ult i8 %x, 13
3965  %b = icmp eq i8 %x, 17
3966  %c = or i1 %a, %b
3967  ret i1 %c
3968}
3969
3970; x <u 13 || x != 17
3971
3972define i1 @or_ult_ne(i8 %x) {
3973; CHECK-LABEL: @or_ult_ne(
3974; CHECK-NEXT:    [[B:%.*]] = icmp ne i8 %x, 17
3975; CHECK-NEXT:    ret i1 [[B]]
3976;
3977  %a = icmp ult i8 %x, 13
3978  %b = icmp ne i8 %x, 17
3979  %c = or i1 %a, %b
3980  ret i1 %c
3981}
3982
3983; x <u 13 || x >=s 17
3984
3985define i1 @or_ult_sge(i8 %x) {
3986; CHECK-LABEL: @or_ult_sge(
3987; CHECK-NEXT:    [[A:%.*]] = icmp ult i8 %x, 13
3988; CHECK-NEXT:    [[B:%.*]] = icmp sge i8 %x, 17
3989; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
3990; CHECK-NEXT:    ret i1 [[C]]
3991;
3992  %a = icmp ult i8 %x, 13
3993  %b = icmp sge i8 %x, 17
3994  %c = or i1 %a, %b
3995  ret i1 %c
3996}
3997
3998; x <u 13 || x >s 17
3999
4000define i1 @or_ult_sgt(i8 %x) {
4001; CHECK-LABEL: @or_ult_sgt(
4002; CHECK-NEXT:    [[A:%.*]] = icmp ult i8 %x, 13
4003; CHECK-NEXT:    [[B:%.*]] = icmp sgt i8 %x, 17
4004; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
4005; CHECK-NEXT:    ret i1 [[C]]
4006;
4007  %a = icmp ult i8 %x, 13
4008  %b = icmp sgt i8 %x, 17
4009  %c = or i1 %a, %b
4010  ret i1 %c
4011}
4012
4013; x <u 13 || x <=s 17
4014
4015define i1 @or_ult_sle(i8 %x) {
4016; CHECK-LABEL: @or_ult_sle(
4017; CHECK-NEXT:    [[B:%.*]] = icmp sle i8 %x, 17
4018; CHECK-NEXT:    ret i1 [[B]]
4019;
4020  %a = icmp ult i8 %x, 13
4021  %b = icmp sle i8 %x, 17
4022  %c = or i1 %a, %b
4023  ret i1 %c
4024}
4025
4026; x <u 13 || x <s 17
4027
4028define i1 @or_ult_slt(i8 %x) {
4029; CHECK-LABEL: @or_ult_slt(
4030; CHECK-NEXT:    [[B:%.*]] = icmp slt i8 %x, 17
4031; CHECK-NEXT:    ret i1 [[B]]
4032;
4033  %a = icmp ult i8 %x, 13
4034  %b = icmp slt i8 %x, 17
4035  %c = or i1 %a, %b
4036  ret i1 %c
4037}
4038
4039; x <u 13 || x >=u 17
4040
4041define i1 @or_ult_uge(i8 %x) {
4042; CHECK-LABEL: @or_ult_uge(
4043; CHECK-NEXT:    [[A:%.*]] = icmp ult i8 %x, 13
4044; CHECK-NEXT:    [[B:%.*]] = icmp uge i8 %x, 17
4045; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
4046; CHECK-NEXT:    ret i1 [[C]]
4047;
4048  %a = icmp ult i8 %x, 13
4049  %b = icmp uge i8 %x, 17
4050  %c = or i1 %a, %b
4051  ret i1 %c
4052}
4053
4054; x <u 13 || x >u 17
4055
4056define i1 @or_ult_ugt(i8 %x) {
4057; CHECK-LABEL: @or_ult_ugt(
4058; CHECK-NEXT:    [[A:%.*]] = icmp ult i8 %x, 13
4059; CHECK-NEXT:    [[B:%.*]] = icmp ugt i8 %x, 17
4060; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
4061; CHECK-NEXT:    ret i1 [[C]]
4062;
4063  %a = icmp ult i8 %x, 13
4064  %b = icmp ugt i8 %x, 17
4065  %c = or i1 %a, %b
4066  ret i1 %c
4067}
4068
4069; x <u 13 || x <=u 17
4070
4071define i1 @or_ult_ule(i8 %x) {
4072; CHECK-LABEL: @or_ult_ule(
4073; CHECK-NEXT:    [[B:%.*]] = icmp ule i8 %x, 17
4074; CHECK-NEXT:    ret i1 [[B]]
4075;
4076  %a = icmp ult i8 %x, 13
4077  %b = icmp ule i8 %x, 17
4078  %c = or i1 %a, %b
4079  ret i1 %c
4080}
4081
4082; x <u 13 || x <u 17
4083
4084define i1 @or_ult_ult(i8 %x) {
4085; CHECK-LABEL: @or_ult_ult(
4086; CHECK-NEXT:    [[B:%.*]] = icmp ult i8 %x, 17
4087; CHECK-NEXT:    ret i1 [[B]]
4088;
4089  %a = icmp ult i8 %x, 13
4090  %b = icmp ult i8 %x, 17
4091  %c = or i1 %a, %b
4092  ret i1 %c
4093}
4094
4095; eq
4096; x == 23 || x == 17
4097
4098define i1 @or_eq_eq_swap(i8 %x) {
4099; CHECK-LABEL: @or_eq_eq_swap(
4100; CHECK-NEXT:    [[A:%.*]] = icmp eq i8 %x, 23
4101; CHECK-NEXT:    [[B:%.*]] = icmp eq i8 %x, 17
4102; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
4103; CHECK-NEXT:    ret i1 [[C]]
4104;
4105  %a = icmp eq i8 %x, 23
4106  %b = icmp eq i8 %x, 17
4107  %c = or i1 %a, %b
4108  ret i1 %c
4109}
4110
4111; x == 23 || x != 17
4112
4113define i1 @or_eq_ne_swap(i8 %x) {
4114; CHECK-LABEL: @or_eq_ne_swap(
4115; CHECK-NEXT:    [[B:%.*]] = icmp ne i8 %x, 17
4116; CHECK-NEXT:    ret i1 [[B]]
4117;
4118  %a = icmp eq i8 %x, 23
4119  %b = icmp ne i8 %x, 17
4120  %c = or i1 %a, %b
4121  ret i1 %c
4122}
4123
4124; x == 23 || x >=s 17
4125
4126define i1 @or_eq_sge_swap(i8 %x) {
4127; CHECK-LABEL: @or_eq_sge_swap(
4128; CHECK-NEXT:    [[B:%.*]] = icmp sge i8 %x, 17
4129; CHECK-NEXT:    ret i1 [[B]]
4130;
4131  %a = icmp eq i8 %x, 23
4132  %b = icmp sge i8 %x, 17
4133  %c = or i1 %a, %b
4134  ret i1 %c
4135}
4136
4137; x == 23 || x >s 17
4138
4139define i1 @or_eq_sgt_swap(i8 %x) {
4140; CHECK-LABEL: @or_eq_sgt_swap(
4141; CHECK-NEXT:    [[B:%.*]] = icmp sgt i8 %x, 17
4142; CHECK-NEXT:    ret i1 [[B]]
4143;
4144  %a = icmp eq i8 %x, 23
4145  %b = icmp sgt i8 %x, 17
4146  %c = or i1 %a, %b
4147  ret i1 %c
4148}
4149
4150; x == 23 || x <=s 17
4151
4152define i1 @or_eq_sle_swap(i8 %x) {
4153; CHECK-LABEL: @or_eq_sle_swap(
4154; CHECK-NEXT:    [[A:%.*]] = icmp eq i8 %x, 23
4155; CHECK-NEXT:    [[B:%.*]] = icmp sle i8 %x, 17
4156; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
4157; CHECK-NEXT:    ret i1 [[C]]
4158;
4159  %a = icmp eq i8 %x, 23
4160  %b = icmp sle i8 %x, 17
4161  %c = or i1 %a, %b
4162  ret i1 %c
4163}
4164
4165; x == 23 || x <s 17
4166
4167define i1 @or_eq_slt_swap(i8 %x) {
4168; CHECK-LABEL: @or_eq_slt_swap(
4169; CHECK-NEXT:    [[A:%.*]] = icmp eq i8 %x, 23
4170; CHECK-NEXT:    [[B:%.*]] = icmp slt i8 %x, 17
4171; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
4172; CHECK-NEXT:    ret i1 [[C]]
4173;
4174  %a = icmp eq i8 %x, 23
4175  %b = icmp slt i8 %x, 17
4176  %c = or i1 %a, %b
4177  ret i1 %c
4178}
4179
4180; x == 23 || x >=u 17
4181
4182define i1 @or_eq_uge_swap(i8 %x) {
4183; CHECK-LABEL: @or_eq_uge_swap(
4184; CHECK-NEXT:    [[B:%.*]] = icmp uge i8 %x, 17
4185; CHECK-NEXT:    ret i1 [[B]]
4186;
4187  %a = icmp eq i8 %x, 23
4188  %b = icmp uge i8 %x, 17
4189  %c = or i1 %a, %b
4190  ret i1 %c
4191}
4192
4193; x == 23 || x >u 17
4194
4195define i1 @or_eq_ugt_swap(i8 %x) {
4196; CHECK-LABEL: @or_eq_ugt_swap(
4197; CHECK-NEXT:    [[B:%.*]] = icmp ugt i8 %x, 17
4198; CHECK-NEXT:    ret i1 [[B]]
4199;
4200  %a = icmp eq i8 %x, 23
4201  %b = icmp ugt i8 %x, 17
4202  %c = or i1 %a, %b
4203  ret i1 %c
4204}
4205
4206; x == 23 || x <=u 17
4207
4208define i1 @or_eq_ule_swap(i8 %x) {
4209; CHECK-LABEL: @or_eq_ule_swap(
4210; CHECK-NEXT:    [[A:%.*]] = icmp eq i8 %x, 23
4211; CHECK-NEXT:    [[B:%.*]] = icmp ule i8 %x, 17
4212; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
4213; CHECK-NEXT:    ret i1 [[C]]
4214;
4215  %a = icmp eq i8 %x, 23
4216  %b = icmp ule i8 %x, 17
4217  %c = or i1 %a, %b
4218  ret i1 %c
4219}
4220
4221; x == 23 || x <u 17
4222
4223define i1 @or_eq_ult_swap(i8 %x) {
4224; CHECK-LABEL: @or_eq_ult_swap(
4225; CHECK-NEXT:    [[A:%.*]] = icmp eq i8 %x, 23
4226; CHECK-NEXT:    [[B:%.*]] = icmp ult i8 %x, 17
4227; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
4228; CHECK-NEXT:    ret i1 [[C]]
4229;
4230  %a = icmp eq i8 %x, 23
4231  %b = icmp ult i8 %x, 17
4232  %c = or i1 %a, %b
4233  ret i1 %c
4234}
4235
4236; ne
4237; x != 23 || x == 17
4238
4239define i1 @or_ne_eq_swap(i8 %x) {
4240; CHECK-LABEL: @or_ne_eq_swap(
4241; CHECK-NEXT:    [[A:%.*]] = icmp ne i8 %x, 23
4242; CHECK-NEXT:    ret i1 [[A]]
4243;
4244  %a = icmp ne i8 %x, 23
4245  %b = icmp eq i8 %x, 17
4246  %c = or i1 %a, %b
4247  ret i1 %c
4248}
4249
4250; x != 23 || x != 17
4251
4252define i1 @or_ne_ne_swap(i8 %x) {
4253; CHECK-LABEL: @or_ne_ne_swap(
4254; CHECK-NEXT:    ret i1 true
4255;
4256  %a = icmp ne i8 %x, 23
4257  %b = icmp ne i8 %x, 17
4258  %c = or i1 %a, %b
4259  ret i1 %c
4260}
4261
4262; x != 23 || x >=s 17
4263
4264define i1 @or_ne_sge_swap(i8 %x) {
4265; CHECK-LABEL: @or_ne_sge_swap(
4266; CHECK-NEXT:    ret i1 true
4267;
4268  %a = icmp ne i8 %x, 23
4269  %b = icmp sge i8 %x, 17
4270  %c = or i1 %a, %b
4271  ret i1 %c
4272}
4273
4274; x != 23 || x >s 17
4275
4276define i1 @or_ne_sgt_swap(i8 %x) {
4277; CHECK-LABEL: @or_ne_sgt_swap(
4278; CHECK-NEXT:    ret i1 true
4279;
4280  %a = icmp ne i8 %x, 23
4281  %b = icmp sgt i8 %x, 17
4282  %c = or i1 %a, %b
4283  ret i1 %c
4284}
4285
4286; x != 23 || x <=s 17
4287
4288define i1 @or_ne_sle_swap(i8 %x) {
4289; CHECK-LABEL: @or_ne_sle_swap(
4290; CHECK-NEXT:    [[A:%.*]] = icmp ne i8 %x, 23
4291; CHECK-NEXT:    ret i1 [[A]]
4292;
4293  %a = icmp ne i8 %x, 23
4294  %b = icmp sle i8 %x, 17
4295  %c = or i1 %a, %b
4296  ret i1 %c
4297}
4298
4299; x != 23 || x <s 17
4300
4301define i1 @or_ne_slt_swap(i8 %x) {
4302; CHECK-LABEL: @or_ne_slt_swap(
4303; CHECK-NEXT:    [[A:%.*]] = icmp ne i8 %x, 23
4304; CHECK-NEXT:    ret i1 [[A]]
4305;
4306  %a = icmp ne i8 %x, 23
4307  %b = icmp slt i8 %x, 17
4308  %c = or i1 %a, %b
4309  ret i1 %c
4310}
4311
4312; x != 23 || x >=u 17
4313
4314define i1 @or_ne_uge_swap(i8 %x) {
4315; CHECK-LABEL: @or_ne_uge_swap(
4316; CHECK-NEXT:    ret i1 true
4317;
4318  %a = icmp ne i8 %x, 23
4319  %b = icmp uge i8 %x, 17
4320  %c = or i1 %a, %b
4321  ret i1 %c
4322}
4323
4324; x != 23 || x >u 17
4325
4326define i1 @or_ne_ugt_swap(i8 %x) {
4327; CHECK-LABEL: @or_ne_ugt_swap(
4328; CHECK-NEXT:    ret i1 true
4329;
4330  %a = icmp ne i8 %x, 23
4331  %b = icmp ugt i8 %x, 17
4332  %c = or i1 %a, %b
4333  ret i1 %c
4334}
4335
4336; x != 23 || x <=u 17
4337
4338define i1 @or_ne_ule_swap(i8 %x) {
4339; CHECK-LABEL: @or_ne_ule_swap(
4340; CHECK-NEXT:    [[A:%.*]] = icmp ne i8 %x, 23
4341; CHECK-NEXT:    ret i1 [[A]]
4342;
4343  %a = icmp ne i8 %x, 23
4344  %b = icmp ule i8 %x, 17
4345  %c = or i1 %a, %b
4346  ret i1 %c
4347}
4348
4349; x != 23 || x <u 17
4350
4351define i1 @or_ne_ult_swap(i8 %x) {
4352; CHECK-LABEL: @or_ne_ult_swap(
4353; CHECK-NEXT:    [[A:%.*]] = icmp ne i8 %x, 23
4354; CHECK-NEXT:    ret i1 [[A]]
4355;
4356  %a = icmp ne i8 %x, 23
4357  %b = icmp ult i8 %x, 17
4358  %c = or i1 %a, %b
4359  ret i1 %c
4360}
4361
4362; sge
4363; x >=s 23 || x == 17
4364
4365define i1 @or_sge_eq_swap(i8 %x) {
4366; CHECK-LABEL: @or_sge_eq_swap(
4367; CHECK-NEXT:    [[A:%.*]] = icmp sge i8 %x, 23
4368; CHECK-NEXT:    [[B:%.*]] = icmp eq i8 %x, 17
4369; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
4370; CHECK-NEXT:    ret i1 [[C]]
4371;
4372  %a = icmp sge i8 %x, 23
4373  %b = icmp eq i8 %x, 17
4374  %c = or i1 %a, %b
4375  ret i1 %c
4376}
4377
4378; x >=s 23 || x != 17
4379
4380define i1 @or_sge_ne_swap(i8 %x) {
4381; CHECK-LABEL: @or_sge_ne_swap(
4382; CHECK-NEXT:    [[B:%.*]] = icmp ne i8 %x, 17
4383; CHECK-NEXT:    ret i1 [[B]]
4384;
4385  %a = icmp sge i8 %x, 23
4386  %b = icmp ne i8 %x, 17
4387  %c = or i1 %a, %b
4388  ret i1 %c
4389}
4390
4391; x >=s 23 || x >=s 17
4392
4393define i1 @or_sge_sge_swap(i8 %x) {
4394; CHECK-LABEL: @or_sge_sge_swap(
4395; CHECK-NEXT:    [[B:%.*]] = icmp sge i8 %x, 17
4396; CHECK-NEXT:    ret i1 [[B]]
4397;
4398  %a = icmp sge i8 %x, 23
4399  %b = icmp sge i8 %x, 17
4400  %c = or i1 %a, %b
4401  ret i1 %c
4402}
4403
4404; x >=s 23 || x >s 17
4405
4406define i1 @or_sge_sgt_swap(i8 %x) {
4407; CHECK-LABEL: @or_sge_sgt_swap(
4408; CHECK-NEXT:    [[B:%.*]] = icmp sgt i8 %x, 17
4409; CHECK-NEXT:    ret i1 [[B]]
4410;
4411  %a = icmp sge i8 %x, 23
4412  %b = icmp sgt i8 %x, 17
4413  %c = or i1 %a, %b
4414  ret i1 %c
4415}
4416
4417; x >=s 23 || x <=s 17
4418
4419define i1 @or_sge_sle_swap(i8 %x) {
4420; CHECK-LABEL: @or_sge_sle_swap(
4421; CHECK-NEXT:    [[A:%.*]] = icmp sge i8 %x, 23
4422; CHECK-NEXT:    [[B:%.*]] = icmp sle i8 %x, 17
4423; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
4424; CHECK-NEXT:    ret i1 [[C]]
4425;
4426  %a = icmp sge i8 %x, 23
4427  %b = icmp sle i8 %x, 17
4428  %c = or i1 %a, %b
4429  ret i1 %c
4430}
4431
4432; x >=s 23 || x <s 17
4433
4434define i1 @or_sge_slt_swap(i8 %x) {
4435; CHECK-LABEL: @or_sge_slt_swap(
4436; CHECK-NEXT:    [[A:%.*]] = icmp sge i8 %x, 23
4437; CHECK-NEXT:    [[B:%.*]] = icmp slt i8 %x, 17
4438; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
4439; CHECK-NEXT:    ret i1 [[C]]
4440;
4441  %a = icmp sge i8 %x, 23
4442  %b = icmp slt i8 %x, 17
4443  %c = or i1 %a, %b
4444  ret i1 %c
4445}
4446
4447; x >=s 23 || x >=u 17
4448
4449define i1 @or_sge_uge_swap(i8 %x) {
4450; CHECK-LABEL: @or_sge_uge_swap(
4451; CHECK-NEXT:    [[B:%.*]] = icmp uge i8 %x, 17
4452; CHECK-NEXT:    ret i1 [[B]]
4453;
4454  %a = icmp sge i8 %x, 23
4455  %b = icmp uge i8 %x, 17
4456  %c = or i1 %a, %b
4457  ret i1 %c
4458}
4459
4460; x >=s 23 || x >u 17
4461
4462define i1 @or_sge_ugt_swap(i8 %x) {
4463; CHECK-LABEL: @or_sge_ugt_swap(
4464; CHECK-NEXT:    [[B:%.*]] = icmp ugt i8 %x, 17
4465; CHECK-NEXT:    ret i1 [[B]]
4466;
4467  %a = icmp sge i8 %x, 23
4468  %b = icmp ugt i8 %x, 17
4469  %c = or i1 %a, %b
4470  ret i1 %c
4471}
4472
4473; x >=s 23 || x <=u 17
4474
4475define i1 @or_sge_ule_swap(i8 %x) {
4476; CHECK-LABEL: @or_sge_ule_swap(
4477; CHECK-NEXT:    [[A:%.*]] = icmp sge i8 %x, 23
4478; CHECK-NEXT:    [[B:%.*]] = icmp ule i8 %x, 17
4479; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
4480; CHECK-NEXT:    ret i1 [[C]]
4481;
4482  %a = icmp sge i8 %x, 23
4483  %b = icmp ule i8 %x, 17
4484  %c = or i1 %a, %b
4485  ret i1 %c
4486}
4487
4488; x >=s 23 || x <u 17
4489
4490define i1 @or_sge_ult_swap(i8 %x) {
4491; CHECK-LABEL: @or_sge_ult_swap(
4492; CHECK-NEXT:    [[A:%.*]] = icmp sge i8 %x, 23
4493; CHECK-NEXT:    [[B:%.*]] = icmp ult i8 %x, 17
4494; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
4495; CHECK-NEXT:    ret i1 [[C]]
4496;
4497  %a = icmp sge i8 %x, 23
4498  %b = icmp ult i8 %x, 17
4499  %c = or i1 %a, %b
4500  ret i1 %c
4501}
4502
4503; sgt
4504; x >s 23 || x == 17
4505
4506define i1 @or_sgt_eq_swap(i8 %x) {
4507; CHECK-LABEL: @or_sgt_eq_swap(
4508; CHECK-NEXT:    [[A:%.*]] = icmp sgt i8 %x, 23
4509; CHECK-NEXT:    [[B:%.*]] = icmp eq i8 %x, 17
4510; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
4511; CHECK-NEXT:    ret i1 [[C]]
4512;
4513  %a = icmp sgt i8 %x, 23
4514  %b = icmp eq i8 %x, 17
4515  %c = or i1 %a, %b
4516  ret i1 %c
4517}
4518
4519; x >s 23 || x != 17
4520
4521define i1 @or_sgt_ne_swap(i8 %x) {
4522; CHECK-LABEL: @or_sgt_ne_swap(
4523; CHECK-NEXT:    [[B:%.*]] = icmp ne i8 %x, 17
4524; CHECK-NEXT:    ret i1 [[B]]
4525;
4526  %a = icmp sgt i8 %x, 23
4527  %b = icmp ne i8 %x, 17
4528  %c = or i1 %a, %b
4529  ret i1 %c
4530}
4531
4532; x >s 23 || x >=s 17
4533
4534define i1 @or_sgt_sge_swap(i8 %x) {
4535; CHECK-LABEL: @or_sgt_sge_swap(
4536; CHECK-NEXT:    [[B:%.*]] = icmp sge i8 %x, 17
4537; CHECK-NEXT:    ret i1 [[B]]
4538;
4539  %a = icmp sgt i8 %x, 23
4540  %b = icmp sge i8 %x, 17
4541  %c = or i1 %a, %b
4542  ret i1 %c
4543}
4544
4545; x >s 23 || x >s 17
4546
4547define i1 @or_sgt_sgt_swap(i8 %x) {
4548; CHECK-LABEL: @or_sgt_sgt_swap(
4549; CHECK-NEXT:    [[B:%.*]] = icmp sgt i8 %x, 17
4550; CHECK-NEXT:    ret i1 [[B]]
4551;
4552  %a = icmp sgt i8 %x, 23
4553  %b = icmp sgt i8 %x, 17
4554  %c = or i1 %a, %b
4555  ret i1 %c
4556}
4557
4558; x >s 23 || x <=s 17
4559
4560define i1 @or_sgt_sle_swap(i8 %x) {
4561; CHECK-LABEL: @or_sgt_sle_swap(
4562; CHECK-NEXT:    [[A:%.*]] = icmp sgt i8 %x, 23
4563; CHECK-NEXT:    [[B:%.*]] = icmp sle i8 %x, 17
4564; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
4565; CHECK-NEXT:    ret i1 [[C]]
4566;
4567  %a = icmp sgt i8 %x, 23
4568  %b = icmp sle i8 %x, 17
4569  %c = or i1 %a, %b
4570  ret i1 %c
4571}
4572
4573; x >s 23 || x <s 17
4574
4575define i1 @or_sgt_slt_swap(i8 %x) {
4576; CHECK-LABEL: @or_sgt_slt_swap(
4577; CHECK-NEXT:    [[A:%.*]] = icmp sgt i8 %x, 23
4578; CHECK-NEXT:    [[B:%.*]] = icmp slt i8 %x, 17
4579; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
4580; CHECK-NEXT:    ret i1 [[C]]
4581;
4582  %a = icmp sgt i8 %x, 23
4583  %b = icmp slt i8 %x, 17
4584  %c = or i1 %a, %b
4585  ret i1 %c
4586}
4587
4588; x >s 23 || x >=u 17
4589
4590define i1 @or_sgt_uge_swap(i8 %x) {
4591; CHECK-LABEL: @or_sgt_uge_swap(
4592; CHECK-NEXT:    [[B:%.*]] = icmp uge i8 %x, 17
4593; CHECK-NEXT:    ret i1 [[B]]
4594;
4595  %a = icmp sgt i8 %x, 23
4596  %b = icmp uge i8 %x, 17
4597  %c = or i1 %a, %b
4598  ret i1 %c
4599}
4600
4601; x >s 23 || x >u 17
4602
4603define i1 @or_sgt_ugt_swap(i8 %x) {
4604; CHECK-LABEL: @or_sgt_ugt_swap(
4605; CHECK-NEXT:    [[B:%.*]] = icmp ugt i8 %x, 17
4606; CHECK-NEXT:    ret i1 [[B]]
4607;
4608  %a = icmp sgt i8 %x, 23
4609  %b = icmp ugt i8 %x, 17
4610  %c = or i1 %a, %b
4611  ret i1 %c
4612}
4613
4614; x >s 23 || x <=u 17
4615
4616define i1 @or_sgt_ule_swap(i8 %x) {
4617; CHECK-LABEL: @or_sgt_ule_swap(
4618; CHECK-NEXT:    [[A:%.*]] = icmp sgt i8 %x, 23
4619; CHECK-NEXT:    [[B:%.*]] = icmp ule i8 %x, 17
4620; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
4621; CHECK-NEXT:    ret i1 [[C]]
4622;
4623  %a = icmp sgt i8 %x, 23
4624  %b = icmp ule i8 %x, 17
4625  %c = or i1 %a, %b
4626  ret i1 %c
4627}
4628
4629; x >s 23 || x <u 17
4630
4631define i1 @or_sgt_ult_swap(i8 %x) {
4632; CHECK-LABEL: @or_sgt_ult_swap(
4633; CHECK-NEXT:    [[A:%.*]] = icmp sgt i8 %x, 23
4634; CHECK-NEXT:    [[B:%.*]] = icmp ult i8 %x, 17
4635; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
4636; CHECK-NEXT:    ret i1 [[C]]
4637;
4638  %a = icmp sgt i8 %x, 23
4639  %b = icmp ult i8 %x, 17
4640  %c = or i1 %a, %b
4641  ret i1 %c
4642}
4643
4644; sle
4645; x <=s 23 || x == 17
4646
4647define i1 @or_sle_eq_swap(i8 %x) {
4648; CHECK-LABEL: @or_sle_eq_swap(
4649; CHECK-NEXT:    [[A:%.*]] = icmp sle i8 %x, 23
4650; CHECK-NEXT:    ret i1 [[A]]
4651;
4652  %a = icmp sle i8 %x, 23
4653  %b = icmp eq i8 %x, 17
4654  %c = or i1 %a, %b
4655  ret i1 %c
4656}
4657
4658; x <=s 23 || x != 17
4659
4660define i1 @or_sle_ne_swap(i8 %x) {
4661; CHECK-LABEL: @or_sle_ne_swap(
4662; CHECK-NEXT:    ret i1 true
4663;
4664  %a = icmp sle i8 %x, 23
4665  %b = icmp ne i8 %x, 17
4666  %c = or i1 %a, %b
4667  ret i1 %c
4668}
4669
4670; x <=s 23 || x >=s 17
4671
4672define i1 @or_sle_sge_swap(i8 %x) {
4673; CHECK-LABEL: @or_sle_sge_swap(
4674; CHECK-NEXT:    ret i1 true
4675;
4676  %a = icmp sle i8 %x, 23
4677  %b = icmp sge i8 %x, 17
4678  %c = or i1 %a, %b
4679  ret i1 %c
4680}
4681
4682; x <=s 23 || x >s 17
4683
4684define i1 @or_sle_sgt_swap(i8 %x) {
4685; CHECK-LABEL: @or_sle_sgt_swap(
4686; CHECK-NEXT:    ret i1 true
4687;
4688  %a = icmp sle i8 %x, 23
4689  %b = icmp sgt i8 %x, 17
4690  %c = or i1 %a, %b
4691  ret i1 %c
4692}
4693
4694; x <=s 23 || x <=s 17
4695
4696define i1 @or_sle_sle_swap(i8 %x) {
4697; CHECK-LABEL: @or_sle_sle_swap(
4698; CHECK-NEXT:    [[A:%.*]] = icmp sle i8 %x, 23
4699; CHECK-NEXT:    ret i1 [[A]]
4700;
4701  %a = icmp sle i8 %x, 23
4702  %b = icmp sle i8 %x, 17
4703  %c = or i1 %a, %b
4704  ret i1 %c
4705}
4706
4707; x <=s 23 || x <s 17
4708
4709define i1 @or_sle_slt_swap(i8 %x) {
4710; CHECK-LABEL: @or_sle_slt_swap(
4711; CHECK-NEXT:    [[A:%.*]] = icmp sle i8 %x, 23
4712; CHECK-NEXT:    ret i1 [[A]]
4713;
4714  %a = icmp sle i8 %x, 23
4715  %b = icmp slt i8 %x, 17
4716  %c = or i1 %a, %b
4717  ret i1 %c
4718}
4719
4720; x <=s 23 || x >=u 17
4721
4722define i1 @or_sle_uge_swap(i8 %x) {
4723; CHECK-LABEL: @or_sle_uge_swap(
4724; CHECK-NEXT:    ret i1 true
4725;
4726  %a = icmp sle i8 %x, 23
4727  %b = icmp uge i8 %x, 17
4728  %c = or i1 %a, %b
4729  ret i1 %c
4730}
4731
4732; x <=s 23 || x >u 17
4733
4734define i1 @or_sle_ugt_swap(i8 %x) {
4735; CHECK-LABEL: @or_sle_ugt_swap(
4736; CHECK-NEXT:    ret i1 true
4737;
4738  %a = icmp sle i8 %x, 23
4739  %b = icmp ugt i8 %x, 17
4740  %c = or i1 %a, %b
4741  ret i1 %c
4742}
4743
4744; x <=s 23 || x <=u 17
4745
4746define i1 @or_sle_ule_swap(i8 %x) {
4747; CHECK-LABEL: @or_sle_ule_swap(
4748; CHECK-NEXT:    [[A:%.*]] = icmp sle i8 %x, 23
4749; CHECK-NEXT:    ret i1 [[A]]
4750;
4751  %a = icmp sle i8 %x, 23
4752  %b = icmp ule i8 %x, 17
4753  %c = or i1 %a, %b
4754  ret i1 %c
4755}
4756
4757; x <=s 23 || x <u 17
4758
4759define i1 @or_sle_ult_swap(i8 %x) {
4760; CHECK-LABEL: @or_sle_ult_swap(
4761; CHECK-NEXT:    [[A:%.*]] = icmp sle i8 %x, 23
4762; CHECK-NEXT:    ret i1 [[A]]
4763;
4764  %a = icmp sle i8 %x, 23
4765  %b = icmp ult i8 %x, 17
4766  %c = or i1 %a, %b
4767  ret i1 %c
4768}
4769
4770; slt
4771; x <s 23 || x == 17
4772
4773define i1 @or_slt_eq_swap(i8 %x) {
4774; CHECK-LABEL: @or_slt_eq_swap(
4775; CHECK-NEXT:    [[A:%.*]] = icmp slt i8 %x, 23
4776; CHECK-NEXT:    ret i1 [[A]]
4777;
4778  %a = icmp slt i8 %x, 23
4779  %b = icmp eq i8 %x, 17
4780  %c = or i1 %a, %b
4781  ret i1 %c
4782}
4783
4784; x <s 23 || x != 17
4785
4786define i1 @or_slt_ne_swap(i8 %x) {
4787; CHECK-LABEL: @or_slt_ne_swap(
4788; CHECK-NEXT:    ret i1 true
4789;
4790  %a = icmp slt i8 %x, 23
4791  %b = icmp ne i8 %x, 17
4792  %c = or i1 %a, %b
4793  ret i1 %c
4794}
4795
4796; x <s 23 || x >=s 17
4797
4798define i1 @or_slt_sge_swap(i8 %x) {
4799; CHECK-LABEL: @or_slt_sge_swap(
4800; CHECK-NEXT:    ret i1 true
4801;
4802  %a = icmp slt i8 %x, 23
4803  %b = icmp sge i8 %x, 17
4804  %c = or i1 %a, %b
4805  ret i1 %c
4806}
4807
4808; x <s 23 || x >s 17
4809
4810define i1 @or_slt_sgt_swap(i8 %x) {
4811; CHECK-LABEL: @or_slt_sgt_swap(
4812; CHECK-NEXT:    ret i1 true
4813;
4814  %a = icmp slt i8 %x, 23
4815  %b = icmp sgt i8 %x, 17
4816  %c = or i1 %a, %b
4817  ret i1 %c
4818}
4819
4820; x <s 23 || x <=s 17
4821
4822define i1 @or_slt_sle_swap(i8 %x) {
4823; CHECK-LABEL: @or_slt_sle_swap(
4824; CHECK-NEXT:    [[A:%.*]] = icmp slt i8 %x, 23
4825; CHECK-NEXT:    ret i1 [[A]]
4826;
4827  %a = icmp slt i8 %x, 23
4828  %b = icmp sle i8 %x, 17
4829  %c = or i1 %a, %b
4830  ret i1 %c
4831}
4832
4833; x <s 23 || x <s 17
4834
4835define i1 @or_slt_slt_swap(i8 %x) {
4836; CHECK-LABEL: @or_slt_slt_swap(
4837; CHECK-NEXT:    [[A:%.*]] = icmp slt i8 %x, 23
4838; CHECK-NEXT:    ret i1 [[A]]
4839;
4840  %a = icmp slt i8 %x, 23
4841  %b = icmp slt i8 %x, 17
4842  %c = or i1 %a, %b
4843  ret i1 %c
4844}
4845
4846; x <s 23 || x >=u 17
4847
4848define i1 @or_slt_uge_swap(i8 %x) {
4849; CHECK-LABEL: @or_slt_uge_swap(
4850; CHECK-NEXT:    ret i1 true
4851;
4852  %a = icmp slt i8 %x, 23
4853  %b = icmp uge i8 %x, 17
4854  %c = or i1 %a, %b
4855  ret i1 %c
4856}
4857
4858; x <s 23 || x >u 17
4859
4860define i1 @or_slt_ugt_swap(i8 %x) {
4861; CHECK-LABEL: @or_slt_ugt_swap(
4862; CHECK-NEXT:    ret i1 true
4863;
4864  %a = icmp slt i8 %x, 23
4865  %b = icmp ugt i8 %x, 17
4866  %c = or i1 %a, %b
4867  ret i1 %c
4868}
4869
4870; x <s 23 || x <=u 17
4871
4872define i1 @or_slt_ule_swap(i8 %x) {
4873; CHECK-LABEL: @or_slt_ule_swap(
4874; CHECK-NEXT:    [[A:%.*]] = icmp slt i8 %x, 23
4875; CHECK-NEXT:    ret i1 [[A]]
4876;
4877  %a = icmp slt i8 %x, 23
4878  %b = icmp ule i8 %x, 17
4879  %c = or i1 %a, %b
4880  ret i1 %c
4881}
4882
4883; x <s 23 || x <u 17
4884
4885define i1 @or_slt_ult_swap(i8 %x) {
4886; CHECK-LABEL: @or_slt_ult_swap(
4887; CHECK-NEXT:    [[A:%.*]] = icmp slt i8 %x, 23
4888; CHECK-NEXT:    ret i1 [[A]]
4889;
4890  %a = icmp slt i8 %x, 23
4891  %b = icmp ult i8 %x, 17
4892  %c = or i1 %a, %b
4893  ret i1 %c
4894}
4895
4896; uge
4897; x >=u 23 || x == 17
4898
4899define i1 @or_uge_eq_swap(i8 %x) {
4900; CHECK-LABEL: @or_uge_eq_swap(
4901; CHECK-NEXT:    [[A:%.*]] = icmp uge i8 %x, 23
4902; CHECK-NEXT:    [[B:%.*]] = icmp eq i8 %x, 17
4903; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
4904; CHECK-NEXT:    ret i1 [[C]]
4905;
4906  %a = icmp uge i8 %x, 23
4907  %b = icmp eq i8 %x, 17
4908  %c = or i1 %a, %b
4909  ret i1 %c
4910}
4911
4912; x >=u 23 || x != 17
4913
4914define i1 @or_uge_ne_swap(i8 %x) {
4915; CHECK-LABEL: @or_uge_ne_swap(
4916; CHECK-NEXT:    [[B:%.*]] = icmp ne i8 %x, 17
4917; CHECK-NEXT:    ret i1 [[B]]
4918;
4919  %a = icmp uge i8 %x, 23
4920  %b = icmp ne i8 %x, 17
4921  %c = or i1 %a, %b
4922  ret i1 %c
4923}
4924
4925; x >=u 23 || x >=s 17
4926
4927define i1 @or_uge_sge_swap(i8 %x) {
4928; CHECK-LABEL: @or_uge_sge_swap(
4929; CHECK-NEXT:    [[A:%.*]] = icmp uge i8 %x, 23
4930; CHECK-NEXT:    [[B:%.*]] = icmp sge i8 %x, 17
4931; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
4932; CHECK-NEXT:    ret i1 [[C]]
4933;
4934  %a = icmp uge i8 %x, 23
4935  %b = icmp sge i8 %x, 17
4936  %c = or i1 %a, %b
4937  ret i1 %c
4938}
4939
4940; x >=u 23 || x >s 17
4941
4942define i1 @or_uge_sgt_swap(i8 %x) {
4943; CHECK-LABEL: @or_uge_sgt_swap(
4944; CHECK-NEXT:    [[A:%.*]] = icmp uge i8 %x, 23
4945; CHECK-NEXT:    [[B:%.*]] = icmp sgt i8 %x, 17
4946; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
4947; CHECK-NEXT:    ret i1 [[C]]
4948;
4949  %a = icmp uge i8 %x, 23
4950  %b = icmp sgt i8 %x, 17
4951  %c = or i1 %a, %b
4952  ret i1 %c
4953}
4954
4955; x >=u 23 || x <=s 17
4956
4957define i1 @or_uge_sle_swap(i8 %x) {
4958; CHECK-LABEL: @or_uge_sle_swap(
4959; CHECK-NEXT:    [[A:%.*]] = icmp uge i8 %x, 23
4960; CHECK-NEXT:    [[B:%.*]] = icmp sle i8 %x, 17
4961; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
4962; CHECK-NEXT:    ret i1 [[C]]
4963;
4964  %a = icmp uge i8 %x, 23
4965  %b = icmp sle i8 %x, 17
4966  %c = or i1 %a, %b
4967  ret i1 %c
4968}
4969
4970; x >=u 23 || x <s 17
4971
4972define i1 @or_uge_slt_swap(i8 %x) {
4973; CHECK-LABEL: @or_uge_slt_swap(
4974; CHECK-NEXT:    [[A:%.*]] = icmp uge i8 %x, 23
4975; CHECK-NEXT:    [[B:%.*]] = icmp slt i8 %x, 17
4976; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
4977; CHECK-NEXT:    ret i1 [[C]]
4978;
4979  %a = icmp uge i8 %x, 23
4980  %b = icmp slt i8 %x, 17
4981  %c = or i1 %a, %b
4982  ret i1 %c
4983}
4984
4985; x >=u 23 || x >=u 17
4986
4987define i1 @or_uge_uge_swap(i8 %x) {
4988; CHECK-LABEL: @or_uge_uge_swap(
4989; CHECK-NEXT:    [[B:%.*]] = icmp uge i8 %x, 17
4990; CHECK-NEXT:    ret i1 [[B]]
4991;
4992  %a = icmp uge i8 %x, 23
4993  %b = icmp uge i8 %x, 17
4994  %c = or i1 %a, %b
4995  ret i1 %c
4996}
4997
4998; x >=u 23 || x >u 17
4999
5000define i1 @or_uge_ugt_swap(i8 %x) {
5001; CHECK-LABEL: @or_uge_ugt_swap(
5002; CHECK-NEXT:    [[B:%.*]] = icmp ugt i8 %x, 17
5003; CHECK-NEXT:    ret i1 [[B]]
5004;
5005  %a = icmp uge i8 %x, 23
5006  %b = icmp ugt i8 %x, 17
5007  %c = or i1 %a, %b
5008  ret i1 %c
5009}
5010
5011; x >=u 23 || x <=u 17
5012
5013define i1 @or_uge_ule_swap(i8 %x) {
5014; CHECK-LABEL: @or_uge_ule_swap(
5015; CHECK-NEXT:    [[A:%.*]] = icmp uge i8 %x, 23
5016; CHECK-NEXT:    [[B:%.*]] = icmp ule i8 %x, 17
5017; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
5018; CHECK-NEXT:    ret i1 [[C]]
5019;
5020  %a = icmp uge i8 %x, 23
5021  %b = icmp ule i8 %x, 17
5022  %c = or i1 %a, %b
5023  ret i1 %c
5024}
5025
5026; x >=u 23 || x <u 17
5027
5028define i1 @or_uge_ult_swap(i8 %x) {
5029; CHECK-LABEL: @or_uge_ult_swap(
5030; CHECK-NEXT:    [[A:%.*]] = icmp uge i8 %x, 23
5031; CHECK-NEXT:    [[B:%.*]] = icmp ult i8 %x, 17
5032; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
5033; CHECK-NEXT:    ret i1 [[C]]
5034;
5035  %a = icmp uge i8 %x, 23
5036  %b = icmp ult i8 %x, 17
5037  %c = or i1 %a, %b
5038  ret i1 %c
5039}
5040
5041; ugt
5042; x >u 23 || x == 17
5043
5044define i1 @or_ugt_eq_swap(i8 %x) {
5045; CHECK-LABEL: @or_ugt_eq_swap(
5046; CHECK-NEXT:    [[A:%.*]] = icmp ugt i8 %x, 23
5047; CHECK-NEXT:    [[B:%.*]] = icmp eq i8 %x, 17
5048; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
5049; CHECK-NEXT:    ret i1 [[C]]
5050;
5051  %a = icmp ugt i8 %x, 23
5052  %b = icmp eq i8 %x, 17
5053  %c = or i1 %a, %b
5054  ret i1 %c
5055}
5056
5057; x >u 23 || x != 17
5058
5059define i1 @or_ugt_ne_swap(i8 %x) {
5060; CHECK-LABEL: @or_ugt_ne_swap(
5061; CHECK-NEXT:    [[B:%.*]] = icmp ne i8 %x, 17
5062; CHECK-NEXT:    ret i1 [[B]]
5063;
5064  %a = icmp ugt i8 %x, 23
5065  %b = icmp ne i8 %x, 17
5066  %c = or i1 %a, %b
5067  ret i1 %c
5068}
5069
5070; x >u 23 || x >=s 17
5071
5072define i1 @or_ugt_sge_swap(i8 %x) {
5073; CHECK-LABEL: @or_ugt_sge_swap(
5074; CHECK-NEXT:    [[A:%.*]] = icmp ugt i8 %x, 23
5075; CHECK-NEXT:    [[B:%.*]] = icmp sge i8 %x, 17
5076; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
5077; CHECK-NEXT:    ret i1 [[C]]
5078;
5079  %a = icmp ugt i8 %x, 23
5080  %b = icmp sge i8 %x, 17
5081  %c = or i1 %a, %b
5082  ret i1 %c
5083}
5084
5085; x >u 23 || x >s 17
5086
5087define i1 @or_ugt_sgt_swap(i8 %x) {
5088; CHECK-LABEL: @or_ugt_sgt_swap(
5089; CHECK-NEXT:    [[A:%.*]] = icmp ugt i8 %x, 23
5090; CHECK-NEXT:    [[B:%.*]] = icmp sgt i8 %x, 17
5091; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
5092; CHECK-NEXT:    ret i1 [[C]]
5093;
5094  %a = icmp ugt i8 %x, 23
5095  %b = icmp sgt i8 %x, 17
5096  %c = or i1 %a, %b
5097  ret i1 %c
5098}
5099
5100; x >u 23 || x <=s 17
5101
5102define i1 @or_ugt_sle_swap(i8 %x) {
5103; CHECK-LABEL: @or_ugt_sle_swap(
5104; CHECK-NEXT:    [[A:%.*]] = icmp ugt i8 %x, 23
5105; CHECK-NEXT:    [[B:%.*]] = icmp sle i8 %x, 17
5106; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
5107; CHECK-NEXT:    ret i1 [[C]]
5108;
5109  %a = icmp ugt i8 %x, 23
5110  %b = icmp sle i8 %x, 17
5111  %c = or i1 %a, %b
5112  ret i1 %c
5113}
5114
5115; x >u 23 || x <s 17
5116
5117define i1 @or_ugt_slt_swap(i8 %x) {
5118; CHECK-LABEL: @or_ugt_slt_swap(
5119; CHECK-NEXT:    [[A:%.*]] = icmp ugt i8 %x, 23
5120; CHECK-NEXT:    [[B:%.*]] = icmp slt i8 %x, 17
5121; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
5122; CHECK-NEXT:    ret i1 [[C]]
5123;
5124  %a = icmp ugt i8 %x, 23
5125  %b = icmp slt i8 %x, 17
5126  %c = or i1 %a, %b
5127  ret i1 %c
5128}
5129
5130; x >u 23 || x >=u 17
5131
5132define i1 @or_ugt_uge_swap(i8 %x) {
5133; CHECK-LABEL: @or_ugt_uge_swap(
5134; CHECK-NEXT:    [[B:%.*]] = icmp uge i8 %x, 17
5135; CHECK-NEXT:    ret i1 [[B]]
5136;
5137  %a = icmp ugt i8 %x, 23
5138  %b = icmp uge i8 %x, 17
5139  %c = or i1 %a, %b
5140  ret i1 %c
5141}
5142
5143; x >u 23 || x >u 17
5144
5145define i1 @or_ugt_ugt_swap(i8 %x) {
5146; CHECK-LABEL: @or_ugt_ugt_swap(
5147; CHECK-NEXT:    [[B:%.*]] = icmp ugt i8 %x, 17
5148; CHECK-NEXT:    ret i1 [[B]]
5149;
5150  %a = icmp ugt i8 %x, 23
5151  %b = icmp ugt i8 %x, 17
5152  %c = or i1 %a, %b
5153  ret i1 %c
5154}
5155
5156; x >u 23 || x <=u 17
5157
5158define i1 @or_ugt_ule_swap(i8 %x) {
5159; CHECK-LABEL: @or_ugt_ule_swap(
5160; CHECK-NEXT:    [[A:%.*]] = icmp ugt i8 %x, 23
5161; CHECK-NEXT:    [[B:%.*]] = icmp ule i8 %x, 17
5162; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
5163; CHECK-NEXT:    ret i1 [[C]]
5164;
5165  %a = icmp ugt i8 %x, 23
5166  %b = icmp ule i8 %x, 17
5167  %c = or i1 %a, %b
5168  ret i1 %c
5169}
5170
5171; x >u 23 || x <u 17
5172
5173define i1 @or_ugt_ult_swap(i8 %x) {
5174; CHECK-LABEL: @or_ugt_ult_swap(
5175; CHECK-NEXT:    [[A:%.*]] = icmp ugt i8 %x, 23
5176; CHECK-NEXT:    [[B:%.*]] = icmp ult i8 %x, 17
5177; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
5178; CHECK-NEXT:    ret i1 [[C]]
5179;
5180  %a = icmp ugt i8 %x, 23
5181  %b = icmp ult i8 %x, 17
5182  %c = or i1 %a, %b
5183  ret i1 %c
5184}
5185
5186; ule
5187; x <=u 23 || x == 17
5188
5189define i1 @or_ule_eq_swap(i8 %x) {
5190; CHECK-LABEL: @or_ule_eq_swap(
5191; CHECK-NEXT:    [[A:%.*]] = icmp ule i8 %x, 23
5192; CHECK-NEXT:    ret i1 [[A]]
5193;
5194  %a = icmp ule i8 %x, 23
5195  %b = icmp eq i8 %x, 17
5196  %c = or i1 %a, %b
5197  ret i1 %c
5198}
5199
5200; x <=u 23 || x != 17
5201
5202define i1 @or_ule_ne_swap(i8 %x) {
5203; CHECK-LABEL: @or_ule_ne_swap(
5204; CHECK-NEXT:    ret i1 true
5205;
5206  %a = icmp ule i8 %x, 23
5207  %b = icmp ne i8 %x, 17
5208  %c = or i1 %a, %b
5209  ret i1 %c
5210}
5211
5212; x <=u 23 || x >=s 17
5213
5214define i1 @or_ule_sge_swap(i8 %x) {
5215; CHECK-LABEL: @or_ule_sge_swap(
5216; CHECK-NEXT:    [[A:%.*]] = icmp ule i8 %x, 23
5217; CHECK-NEXT:    [[B:%.*]] = icmp sge i8 %x, 17
5218; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
5219; CHECK-NEXT:    ret i1 [[C]]
5220;
5221  %a = icmp ule i8 %x, 23
5222  %b = icmp sge i8 %x, 17
5223  %c = or i1 %a, %b
5224  ret i1 %c
5225}
5226
5227; x <=u 23 || x >s 17
5228
5229define i1 @or_ule_sgt_swap(i8 %x) {
5230; CHECK-LABEL: @or_ule_sgt_swap(
5231; CHECK-NEXT:    [[A:%.*]] = icmp ule i8 %x, 23
5232; CHECK-NEXT:    [[B:%.*]] = icmp sgt i8 %x, 17
5233; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
5234; CHECK-NEXT:    ret i1 [[C]]
5235;
5236  %a = icmp ule i8 %x, 23
5237  %b = icmp sgt i8 %x, 17
5238  %c = or i1 %a, %b
5239  ret i1 %c
5240}
5241
5242; x <=u 23 || x <=s 17
5243
5244define i1 @or_ule_sle_swap(i8 %x) {
5245; CHECK-LABEL: @or_ule_sle_swap(
5246; CHECK-NEXT:    [[A:%.*]] = icmp ule i8 %x, 23
5247; CHECK-NEXT:    [[B:%.*]] = icmp sle i8 %x, 17
5248; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
5249; CHECK-NEXT:    ret i1 [[C]]
5250;
5251  %a = icmp ule i8 %x, 23
5252  %b = icmp sle i8 %x, 17
5253  %c = or i1 %a, %b
5254  ret i1 %c
5255}
5256
5257; x <=u 23 || x <s 17
5258
5259define i1 @or_ule_slt_swap(i8 %x) {
5260; CHECK-LABEL: @or_ule_slt_swap(
5261; CHECK-NEXT:    [[A:%.*]] = icmp ule i8 %x, 23
5262; CHECK-NEXT:    [[B:%.*]] = icmp slt i8 %x, 17
5263; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
5264; CHECK-NEXT:    ret i1 [[C]]
5265;
5266  %a = icmp ule i8 %x, 23
5267  %b = icmp slt i8 %x, 17
5268  %c = or i1 %a, %b
5269  ret i1 %c
5270}
5271
5272; x <=u 23 || x >=u 17
5273
5274define i1 @or_ule_uge_swap(i8 %x) {
5275; CHECK-LABEL: @or_ule_uge_swap(
5276; CHECK-NEXT:    ret i1 true
5277;
5278  %a = icmp ule i8 %x, 23
5279  %b = icmp uge i8 %x, 17
5280  %c = or i1 %a, %b
5281  ret i1 %c
5282}
5283
5284; x <=u 23 || x >u 17
5285
5286define i1 @or_ule_ugt_swap(i8 %x) {
5287; CHECK-LABEL: @or_ule_ugt_swap(
5288; CHECK-NEXT:    ret i1 true
5289;
5290  %a = icmp ule i8 %x, 23
5291  %b = icmp ugt i8 %x, 17
5292  %c = or i1 %a, %b
5293  ret i1 %c
5294}
5295
5296; x <=u 23 || x <=u 17
5297
5298define i1 @or_ule_ule_swap(i8 %x) {
5299; CHECK-LABEL: @or_ule_ule_swap(
5300; CHECK-NEXT:    [[A:%.*]] = icmp ule i8 %x, 23
5301; CHECK-NEXT:    ret i1 [[A]]
5302;
5303  %a = icmp ule i8 %x, 23
5304  %b = icmp ule i8 %x, 17
5305  %c = or i1 %a, %b
5306  ret i1 %c
5307}
5308
5309; x <=u 23 || x <u 17
5310
5311define i1 @or_ule_ult_swap(i8 %x) {
5312; CHECK-LABEL: @or_ule_ult_swap(
5313; CHECK-NEXT:    [[A:%.*]] = icmp ule i8 %x, 23
5314; CHECK-NEXT:    ret i1 [[A]]
5315;
5316  %a = icmp ule i8 %x, 23
5317  %b = icmp ult i8 %x, 17
5318  %c = or i1 %a, %b
5319  ret i1 %c
5320}
5321
5322; ult
5323; x <u 23 || x == 17
5324
5325define i1 @or_ult_eq_swap(i8 %x) {
5326; CHECK-LABEL: @or_ult_eq_swap(
5327; CHECK-NEXT:    [[A:%.*]] = icmp ult i8 %x, 23
5328; CHECK-NEXT:    ret i1 [[A]]
5329;
5330  %a = icmp ult i8 %x, 23
5331  %b = icmp eq i8 %x, 17
5332  %c = or i1 %a, %b
5333  ret i1 %c
5334}
5335
5336; x <u 23 || x != 17
5337
5338define i1 @or_ult_ne_swap(i8 %x) {
5339; CHECK-LABEL: @or_ult_ne_swap(
5340; CHECK-NEXT:    ret i1 true
5341;
5342  %a = icmp ult i8 %x, 23
5343  %b = icmp ne i8 %x, 17
5344  %c = or i1 %a, %b
5345  ret i1 %c
5346}
5347
5348; x <u 23 || x >=s 17
5349
5350define i1 @or_ult_sge_swap(i8 %x) {
5351; CHECK-LABEL: @or_ult_sge_swap(
5352; CHECK-NEXT:    [[A:%.*]] = icmp ult i8 %x, 23
5353; CHECK-NEXT:    [[B:%.*]] = icmp sge i8 %x, 17
5354; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
5355; CHECK-NEXT:    ret i1 [[C]]
5356;
5357  %a = icmp ult i8 %x, 23
5358  %b = icmp sge i8 %x, 17
5359  %c = or i1 %a, %b
5360  ret i1 %c
5361}
5362
5363; x <u 23 || x >s 17
5364
5365define i1 @or_ult_sgt_swap(i8 %x) {
5366; CHECK-LABEL: @or_ult_sgt_swap(
5367; CHECK-NEXT:    [[A:%.*]] = icmp ult i8 %x, 23
5368; CHECK-NEXT:    [[B:%.*]] = icmp sgt i8 %x, 17
5369; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
5370; CHECK-NEXT:    ret i1 [[C]]
5371;
5372  %a = icmp ult i8 %x, 23
5373  %b = icmp sgt i8 %x, 17
5374  %c = or i1 %a, %b
5375  ret i1 %c
5376}
5377
5378; x <u 23 || x <=s 17
5379
5380define i1 @or_ult_sle_swap(i8 %x) {
5381; CHECK-LABEL: @or_ult_sle_swap(
5382; CHECK-NEXT:    [[A:%.*]] = icmp ult i8 %x, 23
5383; CHECK-NEXT:    [[B:%.*]] = icmp sle i8 %x, 17
5384; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
5385; CHECK-NEXT:    ret i1 [[C]]
5386;
5387  %a = icmp ult i8 %x, 23
5388  %b = icmp sle i8 %x, 17
5389  %c = or i1 %a, %b
5390  ret i1 %c
5391}
5392
5393; x <u 23 || x <s 17
5394
5395define i1 @or_ult_slt_swap(i8 %x) {
5396; CHECK-LABEL: @or_ult_slt_swap(
5397; CHECK-NEXT:    [[A:%.*]] = icmp ult i8 %x, 23
5398; CHECK-NEXT:    [[B:%.*]] = icmp slt i8 %x, 17
5399; CHECK-NEXT:    [[C:%.*]] = or i1 [[A]], [[B]]
5400; CHECK-NEXT:    ret i1 [[C]]
5401;
5402  %a = icmp ult i8 %x, 23
5403  %b = icmp slt i8 %x, 17
5404  %c = or i1 %a, %b
5405  ret i1 %c
5406}
5407
5408; x <u 23 || x >=u 17
5409
5410define i1 @or_ult_uge_swap(i8 %x) {
5411; CHECK-LABEL: @or_ult_uge_swap(
5412; CHECK-NEXT:    ret i1 true
5413;
5414  %a = icmp ult i8 %x, 23
5415  %b = icmp uge i8 %x, 17
5416  %c = or i1 %a, %b
5417  ret i1 %c
5418}
5419
5420; x <u 23 || x >u 17
5421
5422define i1 @or_ult_ugt_swap(i8 %x) {
5423; CHECK-LABEL: @or_ult_ugt_swap(
5424; CHECK-NEXT:    ret i1 true
5425;
5426  %a = icmp ult i8 %x, 23
5427  %b = icmp ugt i8 %x, 17
5428  %c = or i1 %a, %b
5429  ret i1 %c
5430}
5431
5432; x <u 23 || x <=u 17
5433
5434define i1 @or_ult_ule_swap(i8 %x) {
5435; CHECK-LABEL: @or_ult_ule_swap(
5436; CHECK-NEXT:    [[A:%.*]] = icmp ult i8 %x, 23
5437; CHECK-NEXT:    ret i1 [[A]]
5438;
5439  %a = icmp ult i8 %x, 23
5440  %b = icmp ule i8 %x, 17
5441  %c = or i1 %a, %b
5442  ret i1 %c
5443}
5444
5445; x <u 23 || x <u 17
5446
5447define i1 @or_ult_ult_swap(i8 %x) {
5448; CHECK-LABEL: @or_ult_ult_swap(
5449; CHECK-NEXT:    [[A:%.*]] = icmp ult i8 %x, 23
5450; CHECK-NEXT:    ret i1 [[A]]
5451;
5452  %a = icmp ult i8 %x, 23
5453  %b = icmp ult i8 %x, 17
5454  %c = or i1 %a, %b
5455  ret i1 %c
5456}
5457
5458; Special case - slt is uge
5459; x <u 31 && x <s 0
5460
5461define i1 @empty2(i32 %x) {
5462; CHECK-LABEL: @empty2(
5463; CHECK-NEXT:    ret i1 false
5464;
5465  %a = icmp ult i32 %x, 31
5466  %b = icmp slt i32 %x, 0
5467  %c = and i1 %a, %b
5468  ret i1 %c
5469}
5470
5471