llvm.org GIT mirror llvm / b1960d4
[InstSimplify] add tests for or-of-icmps; NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288830 91177308-0d34-0410-b5e6-96231b3b80d8 Sanjay Patel 2 years ago
1 changed file(s) with 1352 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
1 ; RUN: opt < %s -instsimplify -S | FileCheck %s
2
3 ; There are 10 * 10 combinations of icmp predicates that can be OR'd together.
4 ; FIXME: The majority of these can be simplified to always true or just one of the icmps.
5
6 define i1 @eq_eq(i8 %a, i8 %b) {
7 ; CHECK-LABEL: @eq_eq(
8 ; CHECK-NEXT: [[CMP1:%.*]] = icmp eq i8 %a, %b
9 ; CHECK-NEXT: [[CMP2:%.*]] = icmp eq i8 %a, %b
10 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
11 ; CHECK-NEXT: ret i1 [[OR]]
12 ;
13 %cmp1 = icmp eq i8 %a, %b
14 %cmp2 = icmp eq i8 %a, %b
15 %or = or i1 %cmp1, %cmp2
16 ret i1 %or
17 }
18
19 define i1 @eq_ne(i8 %a, i8 %b) {
20 ; CHECK-LABEL: @eq_ne(
21 ; CHECK-NEXT: [[CMP1:%.*]] = icmp eq i8 %a, %b
22 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ne i8 %a, %b
23 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
24 ; CHECK-NEXT: ret i1 [[OR]]
25 ;
26 %cmp1 = icmp eq i8 %a, %b
27 %cmp2 = icmp ne i8 %a, %b
28 %or = or i1 %cmp1, %cmp2
29 ret i1 %or
30 }
31
32 define i1 @eq_sge(i8 %a, i8 %b) {
33 ; CHECK-LABEL: @eq_sge(
34 ; CHECK-NEXT: [[CMP1:%.*]] = icmp eq i8 %a, %b
35 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sge i8 %a, %b
36 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
37 ; CHECK-NEXT: ret i1 [[OR]]
38 ;
39 %cmp1 = icmp eq i8 %a, %b
40 %cmp2 = icmp sge i8 %a, %b
41 %or = or i1 %cmp1, %cmp2
42 ret i1 %or
43 }
44
45 define i1 @eq_sgt(i8 %a, i8 %b) {
46 ; CHECK-LABEL: @eq_sgt(
47 ; CHECK-NEXT: [[CMP1:%.*]] = icmp eq i8 %a, %b
48 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sgt i8 %a, %b
49 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
50 ; CHECK-NEXT: ret i1 [[OR]]
51 ;
52 %cmp1 = icmp eq i8 %a, %b
53 %cmp2 = icmp sgt i8 %a, %b
54 %or = or i1 %cmp1, %cmp2
55 ret i1 %or
56 }
57
58 define i1 @eq_sle(i8 %a, i8 %b) {
59 ; CHECK-LABEL: @eq_sle(
60 ; CHECK-NEXT: [[CMP1:%.*]] = icmp eq i8 %a, %b
61 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sle i8 %a, %b
62 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
63 ; CHECK-NEXT: ret i1 [[OR]]
64 ;
65 %cmp1 = icmp eq i8 %a, %b
66 %cmp2 = icmp sle i8 %a, %b
67 %or = or i1 %cmp1, %cmp2
68 ret i1 %or
69 }
70
71 define i1 @eq_slt(i8 %a, i8 %b) {
72 ; CHECK-LABEL: @eq_slt(
73 ; CHECK-NEXT: [[CMP1:%.*]] = icmp eq i8 %a, %b
74 ; CHECK-NEXT: [[CMP2:%.*]] = icmp slt i8 %a, %b
75 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
76 ; CHECK-NEXT: ret i1 [[OR]]
77 ;
78 %cmp1 = icmp eq i8 %a, %b
79 %cmp2 = icmp slt i8 %a, %b
80 %or = or i1 %cmp1, %cmp2
81 ret i1 %or
82 }
83
84 define i1 @eq_uge(i8 %a, i8 %b) {
85 ; CHECK-LABEL: @eq_uge(
86 ; CHECK-NEXT: [[CMP1:%.*]] = icmp eq i8 %a, %b
87 ; CHECK-NEXT: [[CMP2:%.*]] = icmp uge i8 %a, %b
88 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
89 ; CHECK-NEXT: ret i1 [[OR]]
90 ;
91 %cmp1 = icmp eq i8 %a, %b
92 %cmp2 = icmp uge i8 %a, %b
93 %or = or i1 %cmp1, %cmp2
94 ret i1 %or
95 }
96
97 define i1 @eq_ugt(i8 %a, i8 %b) {
98 ; CHECK-LABEL: @eq_ugt(
99 ; CHECK-NEXT: [[CMP1:%.*]] = icmp eq i8 %a, %b
100 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ugt i8 %a, %b
101 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
102 ; CHECK-NEXT: ret i1 [[OR]]
103 ;
104 %cmp1 = icmp eq i8 %a, %b
105 %cmp2 = icmp ugt i8 %a, %b
106 %or = or i1 %cmp1, %cmp2
107 ret i1 %or
108 }
109
110 define i1 @eq_ule(i8 %a, i8 %b) {
111 ; CHECK-LABEL: @eq_ule(
112 ; CHECK-NEXT: [[CMP1:%.*]] = icmp eq i8 %a, %b
113 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ule i8 %a, %b
114 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
115 ; CHECK-NEXT: ret i1 [[OR]]
116 ;
117 %cmp1 = icmp eq i8 %a, %b
118 %cmp2 = icmp ule i8 %a, %b
119 %or = or i1 %cmp1, %cmp2
120 ret i1 %or
121 }
122
123 define i1 @eq_ult(i8 %a, i8 %b) {
124 ; CHECK-LABEL: @eq_ult(
125 ; CHECK-NEXT: [[CMP1:%.*]] = icmp eq i8 %a, %b
126 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ult i8 %a, %b
127 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
128 ; CHECK-NEXT: ret i1 [[OR]]
129 ;
130 %cmp1 = icmp eq i8 %a, %b
131 %cmp2 = icmp ult i8 %a, %b
132 %or = or i1 %cmp1, %cmp2
133 ret i1 %or
134 }
135
136 ;
137
138 define i1 @ne_eq(i8 %a, i8 %b) {
139 ; CHECK-LABEL: @ne_eq(
140 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ne i8 %a, %b
141 ; CHECK-NEXT: [[CMP2:%.*]] = icmp eq i8 %a, %b
142 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
143 ; CHECK-NEXT: ret i1 [[OR]]
144 ;
145 %cmp1 = icmp ne i8 %a, %b
146 %cmp2 = icmp eq i8 %a, %b
147 %or = or i1 %cmp1, %cmp2
148 ret i1 %or
149 }
150
151 define i1 @ne_ne(i8 %a, i8 %b) {
152 ; CHECK-LABEL: @ne_ne(
153 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ne i8 %a, %b
154 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ne i8 %a, %b
155 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
156 ; CHECK-NEXT: ret i1 [[OR]]
157 ;
158 %cmp1 = icmp ne i8 %a, %b
159 %cmp2 = icmp ne i8 %a, %b
160 %or = or i1 %cmp1, %cmp2
161 ret i1 %or
162 }
163
164 define i1 @ne_sge(i8 %a, i8 %b) {
165 ; CHECK-LABEL: @ne_sge(
166 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ne i8 %a, %b
167 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sge i8 %a, %b
168 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
169 ; CHECK-NEXT: ret i1 [[OR]]
170 ;
171 %cmp1 = icmp ne i8 %a, %b
172 %cmp2 = icmp sge i8 %a, %b
173 %or = or i1 %cmp1, %cmp2
174 ret i1 %or
175 }
176
177 define i1 @ne_sgt(i8 %a, i8 %b) {
178 ; CHECK-LABEL: @ne_sgt(
179 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ne i8 %a, %b
180 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sgt i8 %a, %b
181 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
182 ; CHECK-NEXT: ret i1 [[OR]]
183 ;
184 %cmp1 = icmp ne i8 %a, %b
185 %cmp2 = icmp sgt i8 %a, %b
186 %or = or i1 %cmp1, %cmp2
187 ret i1 %or
188 }
189
190 define i1 @ne_sle(i8 %a, i8 %b) {
191 ; CHECK-LABEL: @ne_sle(
192 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ne i8 %a, %b
193 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sle i8 %a, %b
194 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
195 ; CHECK-NEXT: ret i1 [[OR]]
196 ;
197 %cmp1 = icmp ne i8 %a, %b
198 %cmp2 = icmp sle i8 %a, %b
199 %or = or i1 %cmp1, %cmp2
200 ret i1 %or
201 }
202
203 define i1 @ne_slt(i8 %a, i8 %b) {
204 ; CHECK-LABEL: @ne_slt(
205 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ne i8 %a, %b
206 ; CHECK-NEXT: [[CMP2:%.*]] = icmp slt i8 %a, %b
207 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
208 ; CHECK-NEXT: ret i1 [[OR]]
209 ;
210 %cmp1 = icmp ne i8 %a, %b
211 %cmp2 = icmp slt i8 %a, %b
212 %or = or i1 %cmp1, %cmp2
213 ret i1 %or
214 }
215
216 define i1 @ne_uge(i8 %a, i8 %b) {
217 ; CHECK-LABEL: @ne_uge(
218 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ne i8 %a, %b
219 ; CHECK-NEXT: [[CMP2:%.*]] = icmp uge i8 %a, %b
220 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
221 ; CHECK-NEXT: ret i1 [[OR]]
222 ;
223 %cmp1 = icmp ne i8 %a, %b
224 %cmp2 = icmp uge i8 %a, %b
225 %or = or i1 %cmp1, %cmp2
226 ret i1 %or
227 }
228
229 define i1 @ne_ugt(i8 %a, i8 %b) {
230 ; CHECK-LABEL: @ne_ugt(
231 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ne i8 %a, %b
232 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ugt i8 %a, %b
233 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
234 ; CHECK-NEXT: ret i1 [[OR]]
235 ;
236 %cmp1 = icmp ne i8 %a, %b
237 %cmp2 = icmp ugt i8 %a, %b
238 %or = or i1 %cmp1, %cmp2
239 ret i1 %or
240 }
241
242 define i1 @ne_ule(i8 %a, i8 %b) {
243 ; CHECK-LABEL: @ne_ule(
244 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ne i8 %a, %b
245 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ule i8 %a, %b
246 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
247 ; CHECK-NEXT: ret i1 [[OR]]
248 ;
249 %cmp1 = icmp ne i8 %a, %b
250 %cmp2 = icmp ule i8 %a, %b
251 %or = or i1 %cmp1, %cmp2
252 ret i1 %or
253 }
254
255 define i1 @ne_ult(i8 %a, i8 %b) {
256 ; CHECK-LABEL: @ne_ult(
257 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ne i8 %a, %b
258 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ult i8 %a, %b
259 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
260 ; CHECK-NEXT: ret i1 [[OR]]
261 ;
262 %cmp1 = icmp ne i8 %a, %b
263 %cmp2 = icmp ult i8 %a, %b
264 %or = or i1 %cmp1, %cmp2
265 ret i1 %or
266 }
267
268 ;
269
270 define i1 @sge_eq(i8 %a, i8 %b) {
271 ; CHECK-LABEL: @sge_eq(
272 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sge i8 %a, %b
273 ; CHECK-NEXT: [[CMP2:%.*]] = icmp eq i8 %a, %b
274 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
275 ; CHECK-NEXT: ret i1 [[OR]]
276 ;
277 %cmp1 = icmp sge i8 %a, %b
278 %cmp2 = icmp eq i8 %a, %b
279 %or = or i1 %cmp1, %cmp2
280 ret i1 %or
281 }
282
283 define i1 @sge_ne(i8 %a, i8 %b) {
284 ; CHECK-LABEL: @sge_ne(
285 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sge i8 %a, %b
286 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ne i8 %a, %b
287 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
288 ; CHECK-NEXT: ret i1 [[OR]]
289 ;
290 %cmp1 = icmp sge i8 %a, %b
291 %cmp2 = icmp ne i8 %a, %b
292 %or = or i1 %cmp1, %cmp2
293 ret i1 %or
294 }
295
296 define i1 @sge_sge(i8 %a, i8 %b) {
297 ; CHECK-LABEL: @sge_sge(
298 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sge i8 %a, %b
299 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sge i8 %a, %b
300 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
301 ; CHECK-NEXT: ret i1 [[OR]]
302 ;
303 %cmp1 = icmp sge i8 %a, %b
304 %cmp2 = icmp sge i8 %a, %b
305 %or = or i1 %cmp1, %cmp2
306 ret i1 %or
307 }
308
309 define i1 @sge_sgt(i8 %a, i8 %b) {
310 ; CHECK-LABEL: @sge_sgt(
311 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sge i8 %a, %b
312 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sgt i8 %a, %b
313 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
314 ; CHECK-NEXT: ret i1 [[OR]]
315 ;
316 %cmp1 = icmp sge i8 %a, %b
317 %cmp2 = icmp sgt i8 %a, %b
318 %or = or i1 %cmp1, %cmp2
319 ret i1 %or
320 }
321
322 define i1 @sge_sle(i8 %a, i8 %b) {
323 ; CHECK-LABEL: @sge_sle(
324 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sge i8 %a, %b
325 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sle i8 %a, %b
326 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
327 ; CHECK-NEXT: ret i1 [[OR]]
328 ;
329 %cmp1 = icmp sge i8 %a, %b
330 %cmp2 = icmp sle i8 %a, %b
331 %or = or i1 %cmp1, %cmp2
332 ret i1 %or
333 }
334
335 define i1 @sge_slt(i8 %a, i8 %b) {
336 ; CHECK-LABEL: @sge_slt(
337 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sge i8 %a, %b
338 ; CHECK-NEXT: [[CMP2:%.*]] = icmp slt i8 %a, %b
339 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
340 ; CHECK-NEXT: ret i1 [[OR]]
341 ;
342 %cmp1 = icmp sge i8 %a, %b
343 %cmp2 = icmp slt i8 %a, %b
344 %or = or i1 %cmp1, %cmp2
345 ret i1 %or
346 }
347
348 define i1 @sge_uge(i8 %a, i8 %b) {
349 ; CHECK-LABEL: @sge_uge(
350 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sge i8 %a, %b
351 ; CHECK-NEXT: [[CMP2:%.*]] = icmp uge i8 %a, %b
352 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
353 ; CHECK-NEXT: ret i1 [[OR]]
354 ;
355 %cmp1 = icmp sge i8 %a, %b
356 %cmp2 = icmp uge i8 %a, %b
357 %or = or i1 %cmp1, %cmp2
358 ret i1 %or
359 }
360
361 define i1 @sge_ugt(i8 %a, i8 %b) {
362 ; CHECK-LABEL: @sge_ugt(
363 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sge i8 %a, %b
364 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ugt i8 %a, %b
365 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
366 ; CHECK-NEXT: ret i1 [[OR]]
367 ;
368 %cmp1 = icmp sge i8 %a, %b
369 %cmp2 = icmp ugt i8 %a, %b
370 %or = or i1 %cmp1, %cmp2
371 ret i1 %or
372 }
373
374 define i1 @sge_ule(i8 %a, i8 %b) {
375 ; CHECK-LABEL: @sge_ule(
376 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sge i8 %a, %b
377 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ule i8 %a, %b
378 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
379 ; CHECK-NEXT: ret i1 [[OR]]
380 ;
381 %cmp1 = icmp sge i8 %a, %b
382 %cmp2 = icmp ule i8 %a, %b
383 %or = or i1 %cmp1, %cmp2
384 ret i1 %or
385 }
386
387 define i1 @sge_ult(i8 %a, i8 %b) {
388 ; CHECK-LABEL: @sge_ult(
389 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sge i8 %a, %b
390 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ult i8 %a, %b
391 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
392 ; CHECK-NEXT: ret i1 [[OR]]
393 ;
394 %cmp1 = icmp sge i8 %a, %b
395 %cmp2 = icmp ult i8 %a, %b
396 %or = or i1 %cmp1, %cmp2
397 ret i1 %or
398 }
399
400 ;
401
402 define i1 @sgt_eq(i8 %a, i8 %b) {
403 ; CHECK-LABEL: @sgt_eq(
404 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sgt i8 %a, %b
405 ; CHECK-NEXT: [[CMP2:%.*]] = icmp eq i8 %a, %b
406 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
407 ; CHECK-NEXT: ret i1 [[OR]]
408 ;
409 %cmp1 = icmp sgt i8 %a, %b
410 %cmp2 = icmp eq i8 %a, %b
411 %or = or i1 %cmp1, %cmp2
412 ret i1 %or
413 }
414
415 define i1 @sgt_ne(i8 %a, i8 %b) {
416 ; CHECK-LABEL: @sgt_ne(
417 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sgt i8 %a, %b
418 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ne i8 %a, %b
419 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
420 ; CHECK-NEXT: ret i1 [[OR]]
421 ;
422 %cmp1 = icmp sgt i8 %a, %b
423 %cmp2 = icmp ne i8 %a, %b
424 %or = or i1 %cmp1, %cmp2
425 ret i1 %or
426 }
427
428 define i1 @sgt_sge(i8 %a, i8 %b) {
429 ; CHECK-LABEL: @sgt_sge(
430 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sgt i8 %a, %b
431 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sge i8 %a, %b
432 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
433 ; CHECK-NEXT: ret i1 [[OR]]
434 ;
435 %cmp1 = icmp sgt i8 %a, %b
436 %cmp2 = icmp sge i8 %a, %b
437 %or = or i1 %cmp1, %cmp2
438 ret i1 %or
439 }
440
441 define i1 @sgt_sgt(i8 %a, i8 %b) {
442 ; CHECK-LABEL: @sgt_sgt(
443 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sgt i8 %a, %b
444 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sgt i8 %a, %b
445 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
446 ; CHECK-NEXT: ret i1 [[OR]]
447 ;
448 %cmp1 = icmp sgt i8 %a, %b
449 %cmp2 = icmp sgt i8 %a, %b
450 %or = or i1 %cmp1, %cmp2
451 ret i1 %or
452 }
453
454 define i1 @sgt_sle(i8 %a, i8 %b) {
455 ; CHECK-LABEL: @sgt_sle(
456 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sgt i8 %a, %b
457 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sle i8 %a, %b
458 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
459 ; CHECK-NEXT: ret i1 [[OR]]
460 ;
461 %cmp1 = icmp sgt i8 %a, %b
462 %cmp2 = icmp sle i8 %a, %b
463 %or = or i1 %cmp1, %cmp2
464 ret i1 %or
465 }
466
467 define i1 @sgt_slt(i8 %a, i8 %b) {
468 ; CHECK-LABEL: @sgt_slt(
469 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sgt i8 %a, %b
470 ; CHECK-NEXT: [[CMP2:%.*]] = icmp slt i8 %a, %b
471 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
472 ; CHECK-NEXT: ret i1 [[OR]]
473 ;
474 %cmp1 = icmp sgt i8 %a, %b
475 %cmp2 = icmp slt i8 %a, %b
476 %or = or i1 %cmp1, %cmp2
477 ret i1 %or
478 }
479
480 define i1 @sgt_uge(i8 %a, i8 %b) {
481 ; CHECK-LABEL: @sgt_uge(
482 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sgt i8 %a, %b
483 ; CHECK-NEXT: [[CMP2:%.*]] = icmp uge i8 %a, %b
484 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
485 ; CHECK-NEXT: ret i1 [[OR]]
486 ;
487 %cmp1 = icmp sgt i8 %a, %b
488 %cmp2 = icmp uge i8 %a, %b
489 %or = or i1 %cmp1, %cmp2
490 ret i1 %or
491 }
492
493 define i1 @sgt_ugt(i8 %a, i8 %b) {
494 ; CHECK-LABEL: @sgt_ugt(
495 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sgt i8 %a, %b
496 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ugt i8 %a, %b
497 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
498 ; CHECK-NEXT: ret i1 [[OR]]
499 ;
500 %cmp1 = icmp sgt i8 %a, %b
501 %cmp2 = icmp ugt i8 %a, %b
502 %or = or i1 %cmp1, %cmp2
503 ret i1 %or
504 }
505
506 define i1 @sgt_ule(i8 %a, i8 %b) {
507 ; CHECK-LABEL: @sgt_ule(
508 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sgt i8 %a, %b
509 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ule i8 %a, %b
510 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
511 ; CHECK-NEXT: ret i1 [[OR]]
512 ;
513 %cmp1 = icmp sgt i8 %a, %b
514 %cmp2 = icmp ule i8 %a, %b
515 %or = or i1 %cmp1, %cmp2
516 ret i1 %or
517 }
518
519 define i1 @sgt_ult(i8 %a, i8 %b) {
520 ; CHECK-LABEL: @sgt_ult(
521 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sgt i8 %a, %b
522 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ult i8 %a, %b
523 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
524 ; CHECK-NEXT: ret i1 [[OR]]
525 ;
526 %cmp1 = icmp sgt i8 %a, %b
527 %cmp2 = icmp ult i8 %a, %b
528 %or = or i1 %cmp1, %cmp2
529 ret i1 %or
530 }
531
532 ;
533
534 define i1 @sle_eq(i8 %a, i8 %b) {
535 ; CHECK-LABEL: @sle_eq(
536 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sle i8 %a, %b
537 ; CHECK-NEXT: [[CMP2:%.*]] = icmp eq i8 %a, %b
538 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
539 ; CHECK-NEXT: ret i1 [[OR]]
540 ;
541 %cmp1 = icmp sle i8 %a, %b
542 %cmp2 = icmp eq i8 %a, %b
543 %or = or i1 %cmp1, %cmp2
544 ret i1 %or
545 }
546
547 define i1 @sle_ne(i8 %a, i8 %b) {
548 ; CHECK-LABEL: @sle_ne(
549 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sle i8 %a, %b
550 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ne i8 %a, %b
551 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
552 ; CHECK-NEXT: ret i1 [[OR]]
553 ;
554 %cmp1 = icmp sle i8 %a, %b
555 %cmp2 = icmp ne i8 %a, %b
556 %or = or i1 %cmp1, %cmp2
557 ret i1 %or
558 }
559
560 define i1 @sle_sge(i8 %a, i8 %b) {
561 ; CHECK-LABEL: @sle_sge(
562 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sle i8 %a, %b
563 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sge i8 %a, %b
564 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
565 ; CHECK-NEXT: ret i1 [[OR]]
566 ;
567 %cmp1 = icmp sle i8 %a, %b
568 %cmp2 = icmp sge i8 %a, %b
569 %or = or i1 %cmp1, %cmp2
570 ret i1 %or
571 }
572
573 define i1 @sle_sgt(i8 %a, i8 %b) {
574 ; CHECK-LABEL: @sle_sgt(
575 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sle i8 %a, %b
576 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sgt i8 %a, %b
577 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
578 ; CHECK-NEXT: ret i1 [[OR]]
579 ;
580 %cmp1 = icmp sle i8 %a, %b
581 %cmp2 = icmp sgt i8 %a, %b
582 %or = or i1 %cmp1, %cmp2
583 ret i1 %or
584 }
585
586 define i1 @sle_sle(i8 %a, i8 %b) {
587 ; CHECK-LABEL: @sle_sle(
588 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sle i8 %a, %b
589 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sle i8 %a, %b
590 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
591 ; CHECK-NEXT: ret i1 [[OR]]
592 ;
593 %cmp1 = icmp sle i8 %a, %b
594 %cmp2 = icmp sle i8 %a, %b
595 %or = or i1 %cmp1, %cmp2
596 ret i1 %or
597 }
598
599 define i1 @sle_slt(i8 %a, i8 %b) {
600 ; CHECK-LABEL: @sle_slt(
601 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sle i8 %a, %b
602 ; CHECK-NEXT: [[CMP2:%.*]] = icmp slt i8 %a, %b
603 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
604 ; CHECK-NEXT: ret i1 [[OR]]
605 ;
606 %cmp1 = icmp sle i8 %a, %b
607 %cmp2 = icmp slt i8 %a, %b
608 %or = or i1 %cmp1, %cmp2
609 ret i1 %or
610 }
611
612 define i1 @sle_uge(i8 %a, i8 %b) {
613 ; CHECK-LABEL: @sle_uge(
614 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sle i8 %a, %b
615 ; CHECK-NEXT: [[CMP2:%.*]] = icmp uge i8 %a, %b
616 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
617 ; CHECK-NEXT: ret i1 [[OR]]
618 ;
619 %cmp1 = icmp sle i8 %a, %b
620 %cmp2 = icmp uge i8 %a, %b
621 %or = or i1 %cmp1, %cmp2
622 ret i1 %or
623 }
624
625 define i1 @sle_ugt(i8 %a, i8 %b) {
626 ; CHECK-LABEL: @sle_ugt(
627 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sle i8 %a, %b
628 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ugt i8 %a, %b
629 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
630 ; CHECK-NEXT: ret i1 [[OR]]
631 ;
632 %cmp1 = icmp sle i8 %a, %b
633 %cmp2 = icmp ugt i8 %a, %b
634 %or = or i1 %cmp1, %cmp2
635 ret i1 %or
636 }
637
638 define i1 @sle_ule(i8 %a, i8 %b) {
639 ; CHECK-LABEL: @sle_ule(
640 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sle i8 %a, %b
641 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ule i8 %a, %b
642 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
643 ; CHECK-NEXT: ret i1 [[OR]]
644 ;
645 %cmp1 = icmp sle i8 %a, %b
646 %cmp2 = icmp ule i8 %a, %b
647 %or = or i1 %cmp1, %cmp2
648 ret i1 %or
649 }
650
651 define i1 @sle_ult(i8 %a, i8 %b) {
652 ; CHECK-LABEL: @sle_ult(
653 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sle i8 %a, %b
654 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ult i8 %a, %b
655 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
656 ; CHECK-NEXT: ret i1 [[OR]]
657 ;
658 %cmp1 = icmp sle i8 %a, %b
659 %cmp2 = icmp ult i8 %a, %b
660 %or = or i1 %cmp1, %cmp2
661 ret i1 %or
662 }
663
664 ;
665
666 define i1 @slt_eq(i8 %a, i8 %b) {
667 ; CHECK-LABEL: @slt_eq(
668 ; CHECK-NEXT: [[CMP1:%.*]] = icmp slt i8 %a, %b
669 ; CHECK-NEXT: [[CMP2:%.*]] = icmp eq i8 %a, %b
670 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
671 ; CHECK-NEXT: ret i1 [[OR]]
672 ;
673 %cmp1 = icmp slt i8 %a, %b
674 %cmp2 = icmp eq i8 %a, %b
675 %or = or i1 %cmp1, %cmp2
676 ret i1 %or
677 }
678
679 define i1 @slt_ne(i8 %a, i8 %b) {
680 ; CHECK-LABEL: @slt_ne(
681 ; CHECK-NEXT: [[CMP1:%.*]] = icmp slt i8 %a, %b
682 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ne i8 %a, %b
683 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
684 ; CHECK-NEXT: ret i1 [[OR]]
685 ;
686 %cmp1 = icmp slt i8 %a, %b
687 %cmp2 = icmp ne i8 %a, %b
688 %or = or i1 %cmp1, %cmp2
689 ret i1 %or
690 }
691
692 define i1 @slt_sge(i8 %a, i8 %b) {
693 ; CHECK-LABEL: @slt_sge(
694 ; CHECK-NEXT: [[CMP1:%.*]] = icmp slt i8 %a, %b
695 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sge i8 %a, %b
696 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
697 ; CHECK-NEXT: ret i1 [[OR]]
698 ;
699 %cmp1 = icmp slt i8 %a, %b
700 %cmp2 = icmp sge i8 %a, %b
701 %or = or i1 %cmp1, %cmp2
702 ret i1 %or
703 }
704
705 define i1 @slt_sgt(i8 %a, i8 %b) {
706 ; CHECK-LABEL: @slt_sgt(
707 ; CHECK-NEXT: [[CMP1:%.*]] = icmp slt i8 %a, %b
708 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sgt i8 %a, %b
709 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
710 ; CHECK-NEXT: ret i1 [[OR]]
711 ;
712 %cmp1 = icmp slt i8 %a, %b
713 %cmp2 = icmp sgt i8 %a, %b
714 %or = or i1 %cmp1, %cmp2
715 ret i1 %or
716 }
717
718 define i1 @slt_sle(i8 %a, i8 %b) {
719 ; CHECK-LABEL: @slt_sle(
720 ; CHECK-NEXT: [[CMP1:%.*]] = icmp slt i8 %a, %b
721 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sle i8 %a, %b
722 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
723 ; CHECK-NEXT: ret i1 [[OR]]
724 ;
725 %cmp1 = icmp slt i8 %a, %b
726 %cmp2 = icmp sle i8 %a, %b
727 %or = or i1 %cmp1, %cmp2
728 ret i1 %or
729 }
730
731 define i1 @slt_slt(i8 %a, i8 %b) {
732 ; CHECK-LABEL: @slt_slt(
733 ; CHECK-NEXT: [[CMP1:%.*]] = icmp slt i8 %a, %b
734 ; CHECK-NEXT: [[CMP2:%.*]] = icmp slt i8 %a, %b
735 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
736 ; CHECK-NEXT: ret i1 [[OR]]
737 ;
738 %cmp1 = icmp slt i8 %a, %b
739 %cmp2 = icmp slt i8 %a, %b
740 %or = or i1 %cmp1, %cmp2
741 ret i1 %or
742 }
743
744 define i1 @slt_uge(i8 %a, i8 %b) {
745 ; CHECK-LABEL: @slt_uge(
746 ; CHECK-NEXT: [[CMP1:%.*]] = icmp slt i8 %a, %b
747 ; CHECK-NEXT: [[CMP2:%.*]] = icmp uge i8 %a, %b
748 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
749 ; CHECK-NEXT: ret i1 [[OR]]
750 ;
751 %cmp1 = icmp slt i8 %a, %b
752 %cmp2 = icmp uge i8 %a, %b
753 %or = or i1 %cmp1, %cmp2
754 ret i1 %or
755 }
756
757 define i1 @slt_ugt(i8 %a, i8 %b) {
758 ; CHECK-LABEL: @slt_ugt(
759 ; CHECK-NEXT: [[CMP1:%.*]] = icmp slt i8 %a, %b
760 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ugt i8 %a, %b
761 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
762 ; CHECK-NEXT: ret i1 [[OR]]
763 ;
764 %cmp1 = icmp slt i8 %a, %b
765 %cmp2 = icmp ugt i8 %a, %b
766 %or = or i1 %cmp1, %cmp2
767 ret i1 %or
768 }
769
770 define i1 @slt_ule(i8 %a, i8 %b) {
771 ; CHECK-LABEL: @slt_ule(
772 ; CHECK-NEXT: [[CMP1:%.*]] = icmp slt i8 %a, %b
773 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ule i8 %a, %b
774 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
775 ; CHECK-NEXT: ret i1 [[OR]]
776 ;
777 %cmp1 = icmp slt i8 %a, %b
778 %cmp2 = icmp ule i8 %a, %b
779 %or = or i1 %cmp1, %cmp2
780 ret i1 %or
781 }
782
783 define i1 @slt_ult(i8 %a, i8 %b) {
784 ; CHECK-LABEL: @slt_ult(
785 ; CHECK-NEXT: [[CMP1:%.*]] = icmp slt i8 %a, %b
786 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ult i8 %a, %b
787 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
788 ; CHECK-NEXT: ret i1 [[OR]]
789 ;
790 %cmp1 = icmp slt i8 %a, %b
791 %cmp2 = icmp ult i8 %a, %b
792 %or = or i1 %cmp1, %cmp2
793 ret i1 %or
794 }
795
796 ;
797
798 define i1 @uge_eq(i8 %a, i8 %b) {
799 ; CHECK-LABEL: @uge_eq(
800 ; CHECK-NEXT: [[CMP1:%.*]] = icmp uge i8 %a, %b
801 ; CHECK-NEXT: [[CMP2:%.*]] = icmp eq i8 %a, %b
802 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
803 ; CHECK-NEXT: ret i1 [[OR]]
804 ;
805 %cmp1 = icmp uge i8 %a, %b
806 %cmp2 = icmp eq i8 %a, %b
807 %or = or i1 %cmp1, %cmp2
808 ret i1 %or
809 }
810
811 define i1 @uge_ne(i8 %a, i8 %b) {
812 ; CHECK-LABEL: @uge_ne(
813 ; CHECK-NEXT: [[CMP1:%.*]] = icmp uge i8 %a, %b
814 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ne i8 %a, %b
815 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
816 ; CHECK-NEXT: ret i1 [[OR]]
817 ;
818 %cmp1 = icmp uge i8 %a, %b
819 %cmp2 = icmp ne i8 %a, %b
820 %or = or i1 %cmp1, %cmp2
821 ret i1 %or
822 }
823
824 define i1 @uge_sge(i8 %a, i8 %b) {
825 ; CHECK-LABEL: @uge_sge(
826 ; CHECK-NEXT: [[CMP1:%.*]] = icmp uge i8 %a, %b
827 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sge i8 %a, %b
828 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
829 ; CHECK-NEXT: ret i1 [[OR]]
830 ;
831 %cmp1 = icmp uge i8 %a, %b
832 %cmp2 = icmp sge i8 %a, %b
833 %or = or i1 %cmp1, %cmp2
834 ret i1 %or
835 }
836
837 define i1 @uge_sgt(i8 %a, i8 %b) {
838 ; CHECK-LABEL: @uge_sgt(
839 ; CHECK-NEXT: [[CMP1:%.*]] = icmp uge i8 %a, %b
840 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sgt i8 %a, %b
841 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
842 ; CHECK-NEXT: ret i1 [[OR]]
843 ;
844 %cmp1 = icmp uge i8 %a, %b
845 %cmp2 = icmp sgt i8 %a, %b
846 %or = or i1 %cmp1, %cmp2
847 ret i1 %or
848 }
849
850 define i1 @uge_sle(i8 %a, i8 %b) {
851 ; CHECK-LABEL: @uge_sle(
852 ; CHECK-NEXT: [[CMP1:%.*]] = icmp uge i8 %a, %b
853 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sle i8 %a, %b
854 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
855 ; CHECK-NEXT: ret i1 [[OR]]
856 ;
857 %cmp1 = icmp uge i8 %a, %b
858 %cmp2 = icmp sle i8 %a, %b
859 %or = or i1 %cmp1, %cmp2
860 ret i1 %or
861 }
862
863 define i1 @uge_slt(i8 %a, i8 %b) {
864 ; CHECK-LABEL: @uge_slt(
865 ; CHECK-NEXT: [[CMP1:%.*]] = icmp uge i8 %a, %b
866 ; CHECK-NEXT: [[CMP2:%.*]] = icmp slt i8 %a, %b
867 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
868 ; CHECK-NEXT: ret i1 [[OR]]
869 ;
870 %cmp1 = icmp uge i8 %a, %b
871 %cmp2 = icmp slt i8 %a, %b
872 %or = or i1 %cmp1, %cmp2
873 ret i1 %or
874 }
875
876 define i1 @uge_uge(i8 %a, i8 %b) {
877 ; CHECK-LABEL: @uge_uge(
878 ; CHECK-NEXT: [[CMP1:%.*]] = icmp uge i8 %a, %b
879 ; CHECK-NEXT: [[CMP2:%.*]] = icmp uge i8 %a, %b
880 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
881 ; CHECK-NEXT: ret i1 [[OR]]
882 ;
883 %cmp1 = icmp uge i8 %a, %b
884 %cmp2 = icmp uge i8 %a, %b
885 %or = or i1 %cmp1, %cmp2
886 ret i1 %or
887 }
888
889 define i1 @uge_ugt(i8 %a, i8 %b) {
890 ; CHECK-LABEL: @uge_ugt(
891 ; CHECK-NEXT: [[CMP1:%.*]] = icmp uge i8 %a, %b
892 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ugt i8 %a, %b
893 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
894 ; CHECK-NEXT: ret i1 [[OR]]
895 ;
896 %cmp1 = icmp uge i8 %a, %b
897 %cmp2 = icmp ugt i8 %a, %b
898 %or = or i1 %cmp1, %cmp2
899 ret i1 %or
900 }
901
902 define i1 @uge_ule(i8 %a, i8 %b) {
903 ; CHECK-LABEL: @uge_ule(
904 ; CHECK-NEXT: [[CMP1:%.*]] = icmp uge i8 %a, %b
905 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ule i8 %a, %b
906 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
907 ; CHECK-NEXT: ret i1 [[OR]]
908 ;
909 %cmp1 = icmp uge i8 %a, %b
910 %cmp2 = icmp ule i8 %a, %b
911 %or = or i1 %cmp1, %cmp2
912 ret i1 %or
913 }
914
915 define i1 @uge_ult(i8 %a, i8 %b) {
916 ; CHECK-LABEL: @uge_ult(
917 ; CHECK-NEXT: [[CMP1:%.*]] = icmp uge i8 %a, %b
918 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ult i8 %a, %b
919 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
920 ; CHECK-NEXT: ret i1 [[OR]]
921 ;
922 %cmp1 = icmp uge i8 %a, %b
923 %cmp2 = icmp ult i8 %a, %b
924 %or = or i1 %cmp1, %cmp2
925 ret i1 %or
926 }
927
928 ;
929
930 define i1 @ugt_eq(i8 %a, i8 %b) {
931 ; CHECK-LABEL: @ugt_eq(
932 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ugt i8 %a, %b
933 ; CHECK-NEXT: [[CMP2:%.*]] = icmp eq i8 %a, %b
934 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
935 ; CHECK-NEXT: ret i1 [[OR]]
936 ;
937 %cmp1 = icmp ugt i8 %a, %b
938 %cmp2 = icmp eq i8 %a, %b
939 %or = or i1 %cmp1, %cmp2
940 ret i1 %or
941 }
942
943 define i1 @ugt_ne(i8 %a, i8 %b) {
944 ; CHECK-LABEL: @ugt_ne(
945 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ugt i8 %a, %b
946 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ne i8 %a, %b
947 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
948 ; CHECK-NEXT: ret i1 [[OR]]
949 ;
950 %cmp1 = icmp ugt i8 %a, %b
951 %cmp2 = icmp ne i8 %a, %b
952 %or = or i1 %cmp1, %cmp2
953 ret i1 %or
954 }
955
956 define i1 @ugt_sge(i8 %a, i8 %b) {
957 ; CHECK-LABEL: @ugt_sge(
958 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ugt i8 %a, %b
959 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sge i8 %a, %b
960 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
961 ; CHECK-NEXT: ret i1 [[OR]]
962 ;
963 %cmp1 = icmp ugt i8 %a, %b
964 %cmp2 = icmp sge i8 %a, %b
965 %or = or i1 %cmp1, %cmp2
966 ret i1 %or
967 }
968
969 define i1 @ugt_sgt(i8 %a, i8 %b) {
970 ; CHECK-LABEL: @ugt_sgt(
971 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ugt i8 %a, %b
972 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sgt i8 %a, %b
973 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
974 ; CHECK-NEXT: ret i1 [[OR]]
975 ;
976 %cmp1 = icmp ugt i8 %a, %b
977 %cmp2 = icmp sgt i8 %a, %b
978 %or = or i1 %cmp1, %cmp2
979 ret i1 %or
980 }
981
982 define i1 @ugt_sle(i8 %a, i8 %b) {
983 ; CHECK-LABEL: @ugt_sle(
984 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ugt i8 %a, %b
985 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sle i8 %a, %b
986 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
987 ; CHECK-NEXT: ret i1 [[OR]]
988 ;
989 %cmp1 = icmp ugt i8 %a, %b
990 %cmp2 = icmp sle i8 %a, %b
991 %or = or i1 %cmp1, %cmp2
992 ret i1 %or
993 }
994
995 define i1 @ugt_slt(i8 %a, i8 %b) {
996 ; CHECK-LABEL: @ugt_slt(
997 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ugt i8 %a, %b
998 ; CHECK-NEXT: [[CMP2:%.*]] = icmp slt i8 %a, %b
999 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
1000 ; CHECK-NEXT: ret i1 [[OR]]
1001 ;
1002 %cmp1 = icmp ugt i8 %a, %b
1003 %cmp2 = icmp slt i8 %a, %b
1004 %or = or i1 %cmp1, %cmp2
1005 ret i1 %or
1006 }
1007
1008 define i1 @ugt_uge(i8 %a, i8 %b) {
1009 ; CHECK-LABEL: @ugt_uge(
1010 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ugt i8 %a, %b
1011 ; CHECK-NEXT: [[CMP2:%.*]] = icmp uge i8 %a, %b
1012 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
1013 ; CHECK-NEXT: ret i1 [[OR]]
1014 ;
1015 %cmp1 = icmp ugt i8 %a, %b
1016 %cmp2 = icmp uge i8 %a, %b
1017 %or = or i1 %cmp1, %cmp2
1018 ret i1 %or
1019 }
1020
1021 define i1 @ugt_ugt(i8 %a, i8 %b) {
1022 ; CHECK-LABEL: @ugt_ugt(
1023 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ugt i8 %a, %b
1024 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ugt i8 %a, %b
1025 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
1026 ; CHECK-NEXT: ret i1 [[OR]]
1027 ;
1028 %cmp1 = icmp ugt i8 %a, %b
1029 %cmp2 = icmp ugt i8 %a, %b
1030 %or = or i1 %cmp1, %cmp2
1031 ret i1 %or
1032 }
1033
1034 define i1 @ugt_ule(i8 %a, i8 %b) {
1035 ; CHECK-LABEL: @ugt_ule(
1036 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ugt i8 %a, %b
1037 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ule i8 %a, %b
1038 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
1039 ; CHECK-NEXT: ret i1 [[OR]]
1040 ;
1041 %cmp1 = icmp ugt i8 %a, %b
1042 %cmp2 = icmp ule i8 %a, %b
1043 %or = or i1 %cmp1, %cmp2
1044 ret i1 %or
1045 }
1046
1047 define i1 @ugt_ult(i8 %a, i8 %b) {
1048 ; CHECK-LABEL: @ugt_ult(
1049 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ugt i8 %a, %b
1050 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ult i8 %a, %b
1051 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
1052 ; CHECK-NEXT: ret i1 [[OR]]
1053 ;
1054 %cmp1 = icmp ugt i8 %a, %b
1055 %cmp2 = icmp ult i8 %a, %b
1056 %or = or i1 %cmp1, %cmp2
1057 ret i1 %or
1058 }
1059
1060 ;
1061
1062 define i1 @ule_eq(i8 %a, i8 %b) {
1063 ; CHECK-LABEL: @ule_eq(
1064 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ule i8 %a, %b
1065 ; CHECK-NEXT: [[CMP2:%.*]] = icmp eq i8 %a, %b
1066 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
1067 ; CHECK-NEXT: ret i1 [[OR]]
1068 ;
1069 %cmp1 = icmp ule i8 %a, %b
1070 %cmp2 = icmp eq i8 %a, %b
1071 %or = or i1 %cmp1, %cmp2
1072 ret i1 %or
1073 }
1074
1075 define i1 @ule_ne(i8 %a, i8 %b) {
1076 ; CHECK-LABEL: @ule_ne(
1077 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ule i8 %a, %b
1078 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ne i8 %a, %b
1079 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
1080 ; CHECK-NEXT: ret i1 [[OR]]
1081 ;
1082 %cmp1 = icmp ule i8 %a, %b
1083 %cmp2 = icmp ne i8 %a, %b
1084 %or = or i1 %cmp1, %cmp2
1085 ret i1 %or
1086 }
1087
1088 define i1 @ule_sge(i8 %a, i8 %b) {
1089 ; CHECK-LABEL: @ule_sge(
1090 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ule i8 %a, %b
1091 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sge i8 %a, %b
1092 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
1093 ; CHECK-NEXT: ret i1 [[OR]]
1094 ;
1095 %cmp1 = icmp ule i8 %a, %b
1096 %cmp2 = icmp sge i8 %a, %b
1097 %or = or i1 %cmp1, %cmp2
1098 ret i1 %or
1099 }
1100
1101 define i1 @ule_sgt(i8 %a, i8 %b) {
1102 ; CHECK-LABEL: @ule_sgt(
1103 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ule i8 %a, %b
1104 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sgt i8 %a, %b
1105 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
1106 ; CHECK-NEXT: ret i1 [[OR]]
1107 ;
1108 %cmp1 = icmp ule i8 %a, %b
1109 %cmp2 = icmp sgt i8 %a, %b
1110 %or = or i1 %cmp1, %cmp2
1111 ret i1 %or
1112 }
1113
1114 define i1 @ule_sle(i8 %a, i8 %b) {
1115 ; CHECK-LABEL: @ule_sle(
1116 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ule i8 %a, %b
1117 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sle i8 %a, %b
1118 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
1119 ; CHECK-NEXT: ret i1 [[OR]]
1120 ;
1121 %cmp1 = icmp ule i8 %a, %b
1122 %cmp2 = icmp sle i8 %a, %b
1123 %or = or i1 %cmp1, %cmp2
1124 ret i1 %or
1125 }
1126
1127 define i1 @ule_slt(i8 %a, i8 %b) {
1128 ; CHECK-LABEL: @ule_slt(
1129 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ule i8 %a, %b
1130 ; CHECK-NEXT: [[CMP2:%.*]] = icmp slt i8 %a, %b
1131 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
1132 ; CHECK-NEXT: ret i1 [[OR]]
1133 ;
1134 %cmp1 = icmp ule i8 %a, %b
1135 %cmp2 = icmp slt i8 %a, %b
1136 %or = or i1 %cmp1, %cmp2
1137 ret i1 %or
1138 }
1139
1140 define i1 @ule_uge(i8 %a, i8 %b) {
1141 ; CHECK-LABEL: @ule_uge(
1142 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ule i8 %a, %b
1143 ; CHECK-NEXT: [[CMP2:%.*]] = icmp uge i8 %a, %b
1144 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
1145 ; CHECK-NEXT: ret i1 [[OR]]
1146 ;
1147 %cmp1 = icmp ule i8 %a, %b
1148 %cmp2 = icmp uge i8 %a, %b
1149 %or = or i1 %cmp1, %cmp2
1150 ret i1 %or
1151 }
1152
1153 define i1 @ule_ugt(i8 %a, i8 %b) {
1154 ; CHECK-LABEL: @ule_ugt(
1155 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ule i8 %a, %b
1156 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ugt i8 %a, %b
1157 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
1158 ; CHECK-NEXT: ret i1 [[OR]]
1159 ;
1160 %cmp1 = icmp ule i8 %a, %b
1161 %cmp2 = icmp ugt i8 %a, %b
1162 %or = or i1 %cmp1, %cmp2
1163 ret i1 %or
1164 }
1165
1166 define i1 @ule_ule(i8 %a, i8 %b) {
1167 ; CHECK-LABEL: @ule_ule(
1168 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ule i8 %a, %b
1169 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ule i8 %a, %b
1170 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
1171 ; CHECK-NEXT: ret i1 [[OR]]
1172 ;
1173 %cmp1 = icmp ule i8 %a, %b
1174 %cmp2 = icmp ule i8 %a, %b
1175 %or = or i1 %cmp1, %cmp2
1176 ret i1 %or
1177 }
1178
1179 define i1 @ule_ult(i8 %a, i8 %b) {
1180 ; CHECK-LABEL: @ule_ult(
1181 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ule i8 %a, %b
1182 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ult i8 %a, %b
1183 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
1184 ; CHECK-NEXT: ret i1 [[OR]]
1185 ;
1186 %cmp1 = icmp ule i8 %a, %b
1187 %cmp2 = icmp ult i8 %a, %b
1188 %or = or i1 %cmp1, %cmp2
1189 ret i1 %or
1190 }
1191
1192 ;
1193
1194 define i1 @ult_eq(i8 %a, i8 %b) {
1195 ; CHECK-LABEL: @ult_eq(
1196 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ult i8 %a, %b
1197 ; CHECK-NEXT: [[CMP2:%.*]] = icmp eq i8 %a, %b
1198 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
1199 ; CHECK-NEXT: ret i1 [[OR]]
1200 ;
1201 %cmp1 = icmp ult i8 %a, %b
1202 %cmp2 = icmp eq i8 %a, %b
1203 %or = or i1 %cmp1, %cmp2
1204 ret i1 %or
1205 }
1206
1207 define i1 @ult_ne(i8 %a, i8 %b) {
1208 ; CHECK-LABEL: @ult_ne(
1209 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ult i8 %a, %b
1210 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ne i8 %a, %b
1211 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
1212 ; CHECK-NEXT: ret i1 [[OR]]
1213 ;
1214 %cmp1 = icmp ult i8 %a, %b
1215 %cmp2 = icmp ne i8 %a, %b
1216 %or = or i1 %cmp1, %cmp2
1217 ret i1 %or
1218 }
1219
1220 define i1 @ult_sge(i8 %a, i8 %b) {
1221 ; CHECK-LABEL: @ult_sge(
1222 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ult i8 %a, %b
1223 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sge i8 %a, %b
1224 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
1225 ; CHECK-NEXT: ret i1 [[OR]]
1226 ;
1227 %cmp1 = icmp ult i8 %a, %b
1228 %cmp2 = icmp sge i8 %a, %b
1229 %or = or i1 %cmp1, %cmp2
1230 ret i1 %or
1231 }
1232
1233 define i1 @ult_sgt(i8 %a, i8 %b) {
1234 ; CHECK-LABEL: @ult_sgt(
1235 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ult i8 %a, %b
1236 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sgt i8 %a, %b
1237 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
1238 ; CHECK-NEXT: ret i1 [[OR]]
1239 ;
1240 %cmp1 = icmp ult i8 %a, %b
1241 %cmp2 = icmp sgt i8 %a, %b
1242 %or = or i1 %cmp1, %cmp2
1243 ret i1 %or
1244 }
1245
1246 define i1 @ult_sle(i8 %a, i8 %b) {
1247 ; CHECK-LABEL: @ult_sle(
1248 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ult i8 %a, %b
1249 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sle i8 %a, %b
1250 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
1251 ; CHECK-NEXT: ret i1 [[OR]]
1252 ;
1253 %cmp1 = icmp ult i8 %a, %b
1254 %cmp2 = icmp sle i8 %a, %b
1255 %or = or i1 %cmp1, %cmp2
1256 ret i1 %or
1257 }
1258
1259 define i1 @ult_slt(i8 %a, i8 %b) {
1260 ; CHECK-LABEL: @ult_slt(
1261 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ult i8 %a, %b
1262 ; CHECK-NEXT: [[CMP2:%.*]] = icmp slt i8 %a, %b
1263 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
1264 ; CHECK-NEXT: ret i1 [[OR]]
1265 ;
1266 %cmp1 = icmp ult i8 %a, %b
1267 %cmp2 = icmp slt i8 %a, %b
1268 %or = or i1 %cmp1, %cmp2
1269 ret i1 %or
1270 }
1271
1272 define i1 @ult_uge(i8 %a, i8 %b) {
1273 ; CHECK-LABEL: @ult_uge(
1274 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ult i8 %a, %b
1275 ; CHECK-NEXT: [[CMP2:%.*]] = icmp uge i8 %a, %b
1276 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
1277 ; CHECK-NEXT: ret i1 [[OR]]
1278 ;
1279 %cmp1 = icmp ult i8 %a, %b
1280 %cmp2 = icmp uge i8 %a, %b
1281 %or = or i1 %cmp1, %cmp2
1282 ret i1 %or
1283 }
1284
1285 define i1 @ult_ugt(i8 %a, i8 %b) {
1286 ; CHECK-LABEL: @ult_ugt(
1287 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ult i8 %a, %b
1288 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ugt i8 %a, %b
1289 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
1290 ; CHECK-NEXT: ret i1 [[OR]]
1291 ;
1292 %cmp1 = icmp ult i8 %a, %b
1293 %cmp2 = icmp ugt i8 %a, %b
1294 %or = or i1 %cmp1, %cmp2
1295 ret i1 %or
1296 }
1297
1298 define i1 @ult_ule(i8 %a, i8 %b) {
1299 ; CHECK-LABEL: @ult_ule(
1300 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ult i8 %a, %b
1301 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ule i8 %a, %b
1302 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
1303 ; CHECK-NEXT: ret i1 [[OR]]
1304 ;
1305 %cmp1 = icmp ult i8 %a, %b
1306 %cmp2 = icmp ule i8 %a, %b
1307 %or = or i1 %cmp1, %cmp2
1308 ret i1 %or
1309 }
1310
1311 define i1 @ult_ult(i8 %a, i8 %b) {
1312 ; CHECK-LABEL: @ult_ult(
1313 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ult i8 %a, %b
1314 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ult i8 %a, %b
1315 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[CMP1]], [[CMP2]]
1316 ; CHECK-NEXT: ret i1 [[OR]]
1317 ;
1318 %cmp1 = icmp ult i8 %a, %b
1319 %cmp2 = icmp ult i8 %a, %b
1320 %or = or i1 %cmp1, %cmp2
1321 ret i1 %or
1322 }
1323
1324 ; Check a couple of vector variants to make sure those work too.
1325
1326 define <2 x i1> @ult_uge_vec(<2 x i8> %a, <2 x i8> %b) {
1327 ; CHECK-LABEL: @ult_uge_vec(
1328 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ult <2 x i8> %a, %b
1329 ; CHECK-NEXT: [[CMP2:%.*]] = icmp uge <2 x i8> %a, %b
1330 ; CHECK-NEXT: [[OR:%.*]] = or <2 x i1> [[CMP1]], [[CMP2]]
1331 ; CHECK-NEXT: ret <2 x i1> [[OR]]
1332 ;
1333 %cmp1 = icmp ult <2 x i8> %a, %b
1334 %cmp2 = icmp uge <2 x i8> %a, %b
1335 %or = or <2 x i1> %cmp1, %cmp2
1336 ret <2 x i1> %or
1337 }
1338
1339 define <2 x i1> @ult_ule_vec(<2 x i8> %a, <2 x i8> %b) {
1340 ; CHECK-LABEL: @ult_ule_vec(
1341 ; CHECK-NEXT: [[CMP1:%.*]] = icmp ult <2 x i8> %a, %b
1342 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ule <2 x i8> %a, %b
1343 ; CHECK-NEXT: [[OR:%.*]] = or <2 x i1> [[CMP1]], [[CMP2]]
1344 ; CHECK-NEXT: ret <2 x i1> [[OR]]
1345 ;
1346 %cmp1 = icmp ult <2 x i8> %a, %b
1347 %cmp2 = icmp ule <2 x i8> %a, %b
1348 %or = or <2 x i1> %cmp1, %cmp2
1349 ret <2 x i1> %or
1350 }
1351