1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=riscv32 | FileCheck %s --check-prefixes=NOZBB,RV32I
3 ; RUN: llc < %s -mtriple=riscv64 | FileCheck %s --check-prefixes=NOZBB,RV64I
4 ; RUN: llc < %s -mtriple=riscv32 -mattr=+zbb | \
5 ; RUN: FileCheck %s --check-prefixes=ZBB,RV32ZBB
6 ; RUN: llc < %s -mtriple=riscv64 -mattr=+zbb | \
7 ; RUN: FileCheck %s --check-prefixes=ZBB,RV64ZBB
11 declare i8 @llvm.smax.i8(i8 %a, i8 %b) readnone
13 define signext i8 @smax_i8(i8 signext %a, i8 signext %b) {
14 ; NOZBB-LABEL: smax_i8:
16 ; NOZBB-NEXT: blt a1, a0, .LBB0_2
17 ; NOZBB-NEXT: # %bb.1:
18 ; NOZBB-NEXT: mv a0, a1
19 ; NOZBB-NEXT: .LBB0_2:
24 ; ZBB-NEXT: max a0, a0, a1
26 %c = call i8 @llvm.smax.i8(i8 %a, i8 %b)
30 declare i16 @llvm.smax.i16(i16 %a, i16 %b) readnone
32 define signext i16 @smax_i16(i16 signext %a, i16 signext %b) {
33 ; NOZBB-LABEL: smax_i16:
35 ; NOZBB-NEXT: blt a1, a0, .LBB1_2
36 ; NOZBB-NEXT: # %bb.1:
37 ; NOZBB-NEXT: mv a0, a1
38 ; NOZBB-NEXT: .LBB1_2:
41 ; ZBB-LABEL: smax_i16:
43 ; ZBB-NEXT: max a0, a0, a1
45 %c = call i16 @llvm.smax.i16(i16 %a, i16 %b)
49 declare i32 @llvm.smax.i32(i32 %a, i32 %b) readnone
51 define signext i32 @smax_i32(i32 signext %a, i32 signext %b) {
52 ; NOZBB-LABEL: smax_i32:
54 ; NOZBB-NEXT: blt a1, a0, .LBB2_2
55 ; NOZBB-NEXT: # %bb.1:
56 ; NOZBB-NEXT: mv a0, a1
57 ; NOZBB-NEXT: .LBB2_2:
60 ; ZBB-LABEL: smax_i32:
62 ; ZBB-NEXT: max a0, a0, a1
64 %c = call i32 @llvm.smax.i32(i32 %a, i32 %b)
68 declare i64 @llvm.smax.i64(i64 %a, i64 %b) readnone
70 define i64 @smax_i64(i64 %a, i64 %b) {
71 ; RV32I-LABEL: smax_i64:
73 ; RV32I-NEXT: beq a1, a3, .LBB3_2
74 ; RV32I-NEXT: # %bb.1:
75 ; RV32I-NEXT: slt a4, a3, a1
76 ; RV32I-NEXT: beqz a4, .LBB3_3
77 ; RV32I-NEXT: j .LBB3_4
78 ; RV32I-NEXT: .LBB3_2:
79 ; RV32I-NEXT: sltu a4, a2, a0
80 ; RV32I-NEXT: bnez a4, .LBB3_4
81 ; RV32I-NEXT: .LBB3_3:
82 ; RV32I-NEXT: mv a0, a2
83 ; RV32I-NEXT: mv a1, a3
84 ; RV32I-NEXT: .LBB3_4:
87 ; RV64I-LABEL: smax_i64:
89 ; RV64I-NEXT: blt a1, a0, .LBB3_2
90 ; RV64I-NEXT: # %bb.1:
91 ; RV64I-NEXT: mv a0, a1
92 ; RV64I-NEXT: .LBB3_2:
95 ; RV32ZBB-LABEL: smax_i64:
97 ; RV32ZBB-NEXT: beq a1, a3, .LBB3_2
98 ; RV32ZBB-NEXT: # %bb.1:
99 ; RV32ZBB-NEXT: slt a4, a3, a1
100 ; RV32ZBB-NEXT: beqz a4, .LBB3_3
101 ; RV32ZBB-NEXT: j .LBB3_4
102 ; RV32ZBB-NEXT: .LBB3_2:
103 ; RV32ZBB-NEXT: sltu a4, a2, a0
104 ; RV32ZBB-NEXT: bnez a4, .LBB3_4
105 ; RV32ZBB-NEXT: .LBB3_3:
106 ; RV32ZBB-NEXT: mv a0, a2
107 ; RV32ZBB-NEXT: mv a1, a3
108 ; RV32ZBB-NEXT: .LBB3_4:
111 ; RV64ZBB-LABEL: smax_i64:
113 ; RV64ZBB-NEXT: max a0, a0, a1
115 %c = call i64 @llvm.smax.i64(i64 %a, i64 %b)
119 declare i8 @llvm.smin.i8(i8 %a, i8 %b) readnone
121 define signext i8 @smin_i8(i8 signext %a, i8 signext %b) {
122 ; NOZBB-LABEL: smin_i8:
124 ; NOZBB-NEXT: blt a0, a1, .LBB4_2
125 ; NOZBB-NEXT: # %bb.1:
126 ; NOZBB-NEXT: mv a0, a1
127 ; NOZBB-NEXT: .LBB4_2:
130 ; ZBB-LABEL: smin_i8:
132 ; ZBB-NEXT: min a0, a0, a1
134 %c = call i8 @llvm.smin.i8(i8 %a, i8 %b)
138 declare i16 @llvm.smin.i16(i16 %a, i16 %b) readnone
140 define signext i16 @smin_i16(i16 signext %a, i16 signext %b) {
141 ; NOZBB-LABEL: smin_i16:
143 ; NOZBB-NEXT: blt a0, a1, .LBB5_2
144 ; NOZBB-NEXT: # %bb.1:
145 ; NOZBB-NEXT: mv a0, a1
146 ; NOZBB-NEXT: .LBB5_2:
149 ; ZBB-LABEL: smin_i16:
151 ; ZBB-NEXT: min a0, a0, a1
153 %c = call i16 @llvm.smin.i16(i16 %a, i16 %b)
157 declare i32 @llvm.smin.i32(i32 %a, i32 %b) readnone
159 define signext i32 @smin_i32(i32 signext %a, i32 signext %b) {
160 ; NOZBB-LABEL: smin_i32:
162 ; NOZBB-NEXT: blt a0, a1, .LBB6_2
163 ; NOZBB-NEXT: # %bb.1:
164 ; NOZBB-NEXT: mv a0, a1
165 ; NOZBB-NEXT: .LBB6_2:
168 ; ZBB-LABEL: smin_i32:
170 ; ZBB-NEXT: min a0, a0, a1
172 %c = call i32 @llvm.smin.i32(i32 %a, i32 %b)
176 declare i64 @llvm.smin.i64(i64 %a, i64 %b) readnone
178 define i64 @smin_i64(i64 %a, i64 %b) {
179 ; RV32I-LABEL: smin_i64:
181 ; RV32I-NEXT: beq a1, a3, .LBB7_2
182 ; RV32I-NEXT: # %bb.1:
183 ; RV32I-NEXT: slt a4, a1, a3
184 ; RV32I-NEXT: beqz a4, .LBB7_3
185 ; RV32I-NEXT: j .LBB7_4
186 ; RV32I-NEXT: .LBB7_2:
187 ; RV32I-NEXT: sltu a4, a0, a2
188 ; RV32I-NEXT: bnez a4, .LBB7_4
189 ; RV32I-NEXT: .LBB7_3:
190 ; RV32I-NEXT: mv a0, a2
191 ; RV32I-NEXT: mv a1, a3
192 ; RV32I-NEXT: .LBB7_4:
195 ; RV64I-LABEL: smin_i64:
197 ; RV64I-NEXT: blt a0, a1, .LBB7_2
198 ; RV64I-NEXT: # %bb.1:
199 ; RV64I-NEXT: mv a0, a1
200 ; RV64I-NEXT: .LBB7_2:
203 ; RV32ZBB-LABEL: smin_i64:
205 ; RV32ZBB-NEXT: beq a1, a3, .LBB7_2
206 ; RV32ZBB-NEXT: # %bb.1:
207 ; RV32ZBB-NEXT: slt a4, a1, a3
208 ; RV32ZBB-NEXT: beqz a4, .LBB7_3
209 ; RV32ZBB-NEXT: j .LBB7_4
210 ; RV32ZBB-NEXT: .LBB7_2:
211 ; RV32ZBB-NEXT: sltu a4, a0, a2
212 ; RV32ZBB-NEXT: bnez a4, .LBB7_4
213 ; RV32ZBB-NEXT: .LBB7_3:
214 ; RV32ZBB-NEXT: mv a0, a2
215 ; RV32ZBB-NEXT: mv a1, a3
216 ; RV32ZBB-NEXT: .LBB7_4:
219 ; RV64ZBB-LABEL: smin_i64:
221 ; RV64ZBB-NEXT: min a0, a0, a1
223 %c = call i64 @llvm.smin.i64(i64 %a, i64 %b)
227 declare i8 @llvm.umax.i8(i8 %a, i8 %b) readnone
229 define i8 @umax_i8(i8 zeroext %a, i8 zeroext %b) {
230 ; NOZBB-LABEL: umax_i8:
232 ; NOZBB-NEXT: bltu a1, a0, .LBB8_2
233 ; NOZBB-NEXT: # %bb.1:
234 ; NOZBB-NEXT: mv a0, a1
235 ; NOZBB-NEXT: .LBB8_2:
238 ; ZBB-LABEL: umax_i8:
240 ; ZBB-NEXT: maxu a0, a0, a1
242 %c = call i8 @llvm.umax.i8(i8 %a, i8 %b)
246 declare i16 @llvm.umax.i16(i16 %a, i16 %b) readnone
248 define i16 @umax_i16(i16 zeroext %a, i16 zeroext %b) {
249 ; NOZBB-LABEL: umax_i16:
251 ; NOZBB-NEXT: bltu a1, a0, .LBB9_2
252 ; NOZBB-NEXT: # %bb.1:
253 ; NOZBB-NEXT: mv a0, a1
254 ; NOZBB-NEXT: .LBB9_2:
257 ; ZBB-LABEL: umax_i16:
259 ; ZBB-NEXT: maxu a0, a0, a1
261 %c = call i16 @llvm.umax.i16(i16 %a, i16 %b)
265 declare i32 @llvm.umax.i32(i32 %a, i32 %b) readnone
267 define signext i32 @umax_i32(i32 signext %a, i32 signext %b) {
268 ; NOZBB-LABEL: umax_i32:
270 ; NOZBB-NEXT: bltu a1, a0, .LBB10_2
271 ; NOZBB-NEXT: # %bb.1:
272 ; NOZBB-NEXT: mv a0, a1
273 ; NOZBB-NEXT: .LBB10_2:
276 ; ZBB-LABEL: umax_i32:
278 ; ZBB-NEXT: maxu a0, a0, a1
280 %c = call i32 @llvm.umax.i32(i32 %a, i32 %b)
284 declare i64 @llvm.umax.i64(i64 %a, i64 %b) readnone
286 define i64 @umax_i64(i64 %a, i64 %b) {
287 ; RV32I-LABEL: umax_i64:
289 ; RV32I-NEXT: beq a1, a3, .LBB11_2
290 ; RV32I-NEXT: # %bb.1:
291 ; RV32I-NEXT: sltu a4, a3, a1
292 ; RV32I-NEXT: beqz a4, .LBB11_3
293 ; RV32I-NEXT: j .LBB11_4
294 ; RV32I-NEXT: .LBB11_2:
295 ; RV32I-NEXT: sltu a4, a2, a0
296 ; RV32I-NEXT: bnez a4, .LBB11_4
297 ; RV32I-NEXT: .LBB11_3:
298 ; RV32I-NEXT: mv a0, a2
299 ; RV32I-NEXT: mv a1, a3
300 ; RV32I-NEXT: .LBB11_4:
303 ; RV64I-LABEL: umax_i64:
305 ; RV64I-NEXT: bltu a1, a0, .LBB11_2
306 ; RV64I-NEXT: # %bb.1:
307 ; RV64I-NEXT: mv a0, a1
308 ; RV64I-NEXT: .LBB11_2:
311 ; RV32ZBB-LABEL: umax_i64:
313 ; RV32ZBB-NEXT: beq a1, a3, .LBB11_2
314 ; RV32ZBB-NEXT: # %bb.1:
315 ; RV32ZBB-NEXT: sltu a4, a3, a1
316 ; RV32ZBB-NEXT: beqz a4, .LBB11_3
317 ; RV32ZBB-NEXT: j .LBB11_4
318 ; RV32ZBB-NEXT: .LBB11_2:
319 ; RV32ZBB-NEXT: sltu a4, a2, a0
320 ; RV32ZBB-NEXT: bnez a4, .LBB11_4
321 ; RV32ZBB-NEXT: .LBB11_3:
322 ; RV32ZBB-NEXT: mv a0, a2
323 ; RV32ZBB-NEXT: mv a1, a3
324 ; RV32ZBB-NEXT: .LBB11_4:
327 ; RV64ZBB-LABEL: umax_i64:
329 ; RV64ZBB-NEXT: maxu a0, a0, a1
331 %c = call i64 @llvm.umax.i64(i64 %a, i64 %b)
335 declare i8 @llvm.umin.i8(i8 %a, i8 %b) readnone
337 define zeroext i8 @umin_i8(i8 zeroext %a, i8 zeroext %b) {
338 ; NOZBB-LABEL: umin_i8:
340 ; NOZBB-NEXT: bltu a0, a1, .LBB12_2
341 ; NOZBB-NEXT: # %bb.1:
342 ; NOZBB-NEXT: mv a0, a1
343 ; NOZBB-NEXT: .LBB12_2:
346 ; ZBB-LABEL: umin_i8:
348 ; ZBB-NEXT: minu a0, a0, a1
350 %c = call i8 @llvm.umin.i8(i8 %a, i8 %b)
354 declare i16 @llvm.umin.i16(i16 %a, i16 %b) readnone
356 define zeroext i16 @umin_i16(i16 zeroext %a, i16 zeroext %b) {
357 ; NOZBB-LABEL: umin_i16:
359 ; NOZBB-NEXT: bltu a0, a1, .LBB13_2
360 ; NOZBB-NEXT: # %bb.1:
361 ; NOZBB-NEXT: mv a0, a1
362 ; NOZBB-NEXT: .LBB13_2:
365 ; ZBB-LABEL: umin_i16:
367 ; ZBB-NEXT: minu a0, a0, a1
369 %c = call i16 @llvm.umin.i16(i16 %a, i16 %b)
373 declare i32 @llvm.umin.i32(i32 %a, i32 %b) readnone
375 define signext i32 @umin_i32(i32 signext %a, i32 signext %b) {
376 ; NOZBB-LABEL: umin_i32:
378 ; NOZBB-NEXT: bltu a0, a1, .LBB14_2
379 ; NOZBB-NEXT: # %bb.1:
380 ; NOZBB-NEXT: mv a0, a1
381 ; NOZBB-NEXT: .LBB14_2:
384 ; ZBB-LABEL: umin_i32:
386 ; ZBB-NEXT: minu a0, a0, a1
388 %c = call i32 @llvm.umin.i32(i32 %a, i32 %b)
392 declare i64 @llvm.umin.i64(i64 %a, i64 %b) readnone
394 define i64 @umin_i64(i64 %a, i64 %b) {
395 ; RV32I-LABEL: umin_i64:
397 ; RV32I-NEXT: beq a1, a3, .LBB15_2
398 ; RV32I-NEXT: # %bb.1:
399 ; RV32I-NEXT: sltu a4, a1, a3
400 ; RV32I-NEXT: beqz a4, .LBB15_3
401 ; RV32I-NEXT: j .LBB15_4
402 ; RV32I-NEXT: .LBB15_2:
403 ; RV32I-NEXT: sltu a4, a0, a2
404 ; RV32I-NEXT: bnez a4, .LBB15_4
405 ; RV32I-NEXT: .LBB15_3:
406 ; RV32I-NEXT: mv a0, a2
407 ; RV32I-NEXT: mv a1, a3
408 ; RV32I-NEXT: .LBB15_4:
411 ; RV64I-LABEL: umin_i64:
413 ; RV64I-NEXT: bltu a0, a1, .LBB15_2
414 ; RV64I-NEXT: # %bb.1:
415 ; RV64I-NEXT: mv a0, a1
416 ; RV64I-NEXT: .LBB15_2:
419 ; RV32ZBB-LABEL: umin_i64:
421 ; RV32ZBB-NEXT: beq a1, a3, .LBB15_2
422 ; RV32ZBB-NEXT: # %bb.1:
423 ; RV32ZBB-NEXT: sltu a4, a1, a3
424 ; RV32ZBB-NEXT: beqz a4, .LBB15_3
425 ; RV32ZBB-NEXT: j .LBB15_4
426 ; RV32ZBB-NEXT: .LBB15_2:
427 ; RV32ZBB-NEXT: sltu a4, a0, a2
428 ; RV32ZBB-NEXT: bnez a4, .LBB15_4
429 ; RV32ZBB-NEXT: .LBB15_3:
430 ; RV32ZBB-NEXT: mv a0, a2
431 ; RV32ZBB-NEXT: mv a1, a3
432 ; RV32ZBB-NEXT: .LBB15_4:
435 ; RV64ZBB-LABEL: umin_i64:
437 ; RV64ZBB-NEXT: minu a0, a0, a1
439 %c = call i64 @llvm.umin.i64(i64 %a, i64 %b)
443 ; Tests with the same operand used twice. These should fold away.
445 define signext i32 @smin_same_op_i32(i32 signext %a) {
446 ; NOZBB-LABEL: smin_same_op_i32:
450 ; ZBB-LABEL: smin_same_op_i32:
453 %c = call i32 @llvm.smin.i32(i32 %a, i32 %a)
457 define signext i32 @smax_same_op_i32(i32 signext %a) {
458 ; NOZBB-LABEL: smax_same_op_i32:
462 ; ZBB-LABEL: smax_same_op_i32:
465 %c = call i32 @llvm.smax.i32(i32 %a, i32 %a)
469 define signext i32 @umin_same_op_i32(i32 signext %a) {
470 ; NOZBB-LABEL: umin_same_op_i32:
474 ; ZBB-LABEL: umin_same_op_i32:
477 %c = call i32 @llvm.umin.i32(i32 %a, i32 %a)
481 define signext i32 @umax_same_op_i32(i32 signext %a) {
482 ; NOZBB-LABEL: umax_same_op_i32:
486 ; ZBB-LABEL: umax_same_op_i32:
489 %c = call i32 @llvm.umax.i32(i32 %a, i32 %a)
493 ; Tests with undef operands. These should fold to undef for RV32 or 0 for RV64.
495 define signext i32 @smin_undef_i32() {
496 ; RV32I-LABEL: smin_undef_i32:
500 ; RV64I-LABEL: smin_undef_i32:
502 ; RV64I-NEXT: li a0, 0
505 ; RV32ZBB-LABEL: smin_undef_i32:
509 ; RV64ZBB-LABEL: smin_undef_i32:
511 ; RV64ZBB-NEXT: li a0, 0
513 %c = call i32 @llvm.smin.i32(i32 undef, i32 undef)
517 define signext i32 @smax_undef_i32() {
518 ; RV32I-LABEL: smax_undef_i32:
522 ; RV64I-LABEL: smax_undef_i32:
524 ; RV64I-NEXT: li a0, 0
527 ; RV32ZBB-LABEL: smax_undef_i32:
531 ; RV64ZBB-LABEL: smax_undef_i32:
533 ; RV64ZBB-NEXT: li a0, 0
535 %c = call i32 @llvm.smax.i32(i32 undef, i32 undef)
539 define signext i32 @umin_undef_i32() {
540 ; RV32I-LABEL: umin_undef_i32:
544 ; RV64I-LABEL: umin_undef_i32:
546 ; RV64I-NEXT: li a0, 0
549 ; RV32ZBB-LABEL: umin_undef_i32:
553 ; RV64ZBB-LABEL: umin_undef_i32:
555 ; RV64ZBB-NEXT: li a0, 0
557 %c = call i32 @llvm.umin.i32(i32 undef, i32 undef)
561 define signext i32 @umax_undef_i32() {
562 ; RV32I-LABEL: umax_undef_i32:
566 ; RV64I-LABEL: umax_undef_i32:
568 ; RV64I-NEXT: li a0, 0
571 ; RV32ZBB-LABEL: umax_undef_i32:
575 ; RV64ZBB-LABEL: umax_undef_i32:
577 ; RV64ZBB-NEXT: li a0, 0
579 %c = call i32 @llvm.umax.i32(i32 undef, i32 undef)
583 define signext i32 @smax_i32_pos_constant(i32 signext %a) {
584 ; NOZBB-LABEL: smax_i32_pos_constant:
586 ; NOZBB-NEXT: li a1, 10
587 ; NOZBB-NEXT: blt a1, a0, .LBB24_2
588 ; NOZBB-NEXT: # %bb.1:
589 ; NOZBB-NEXT: li a0, 10
590 ; NOZBB-NEXT: .LBB24_2:
593 ; ZBB-LABEL: smax_i32_pos_constant:
595 ; ZBB-NEXT: li a1, 10
596 ; ZBB-NEXT: max a0, a0, a1
598 %c = call i32 @llvm.smax.i32(i32 %a, i32 10)
602 define signext i32 @smax_i32_pos_constant_trailing_zeros(i32 signext %a) {
603 ; NOZBB-LABEL: smax_i32_pos_constant_trailing_zeros:
605 ; NOZBB-NEXT: andi a0, a0, -8
606 ; NOZBB-NEXT: li a1, 16
607 ; NOZBB-NEXT: blt a1, a0, .LBB25_2
608 ; NOZBB-NEXT: # %bb.1:
609 ; NOZBB-NEXT: li a0, 16
610 ; NOZBB-NEXT: .LBB25_2:
613 ; ZBB-LABEL: smax_i32_pos_constant_trailing_zeros:
615 ; ZBB-NEXT: andi a0, a0, -8
616 ; ZBB-NEXT: li a1, 16
617 ; ZBB-NEXT: max a0, a0, a1
620 %c = call i32 @llvm.smax.i32(i32 %b, i32 16)
625 define signext i32 @smin_i32_negone(i32 signext %a) {
626 ; NOZBB-LABEL: smin_i32_negone:
628 ; NOZBB-NEXT: slti a1, a0, -1
629 ; NOZBB-NEXT: addi a1, a1, -1
630 ; NOZBB-NEXT: or a0, a1, a0
633 ; ZBB-LABEL: smin_i32_negone:
635 ; ZBB-NEXT: li a1, -1
636 ; ZBB-NEXT: min a0, a0, a1
638 %c = call i32 @llvm.smin.i32(i32 %a, i32 -1)
642 define i64 @smin_i64_negone(i64 %a) {
643 ; RV32I-LABEL: smin_i64_negone:
645 ; RV32I-NEXT: slti a2, a1, 0
646 ; RV32I-NEXT: addi a2, a2, -1
647 ; RV32I-NEXT: or a0, a2, a0
648 ; RV32I-NEXT: slti a2, a1, -1
649 ; RV32I-NEXT: addi a2, a2, -1
650 ; RV32I-NEXT: or a1, a2, a1
653 ; RV64I-LABEL: smin_i64_negone:
655 ; RV64I-NEXT: slti a1, a0, -1
656 ; RV64I-NEXT: addi a1, a1, -1
657 ; RV64I-NEXT: or a0, a1, a0
660 ; RV32ZBB-LABEL: smin_i64_negone:
662 ; RV32ZBB-NEXT: li a2, -1
663 ; RV32ZBB-NEXT: min a2, a1, a2
664 ; RV32ZBB-NEXT: slti a1, a1, 0
665 ; RV32ZBB-NEXT: addi a1, a1, -1
666 ; RV32ZBB-NEXT: or a0, a1, a0
667 ; RV32ZBB-NEXT: mv a1, a2
670 ; RV64ZBB-LABEL: smin_i64_negone:
672 ; RV64ZBB-NEXT: li a1, -1
673 ; RV64ZBB-NEXT: min a0, a0, a1
675 %c = call i64 @llvm.smin.i64(i64 %a, i64 -1)
679 define i64 @umax_i64_one(i64 %a, i64 %b) {
680 ; RV32I-LABEL: umax_i64_one:
682 ; RV32I-NEXT: mv a2, a0
683 ; RV32I-NEXT: beqz a1, .LBB28_3
684 ; RV32I-NEXT: # %bb.1:
685 ; RV32I-NEXT: beqz a1, .LBB28_4
686 ; RV32I-NEXT: .LBB28_2:
688 ; RV32I-NEXT: .LBB28_3:
689 ; RV32I-NEXT: li a0, 1
690 ; RV32I-NEXT: bnez a1, .LBB28_2
691 ; RV32I-NEXT: .LBB28_4:
692 ; RV32I-NEXT: seqz a0, a2
693 ; RV32I-NEXT: add a0, a2, a0
696 ; RV64I-LABEL: umax_i64_one:
698 ; RV64I-NEXT: seqz a1, a0
699 ; RV64I-NEXT: add a0, a0, a1
702 ; RV32ZBB-LABEL: umax_i64_one:
704 ; RV32ZBB-NEXT: mv a2, a0
705 ; RV32ZBB-NEXT: li a3, 1
706 ; RV32ZBB-NEXT: beqz a1, .LBB28_3
707 ; RV32ZBB-NEXT: # %bb.1:
708 ; RV32ZBB-NEXT: beqz a1, .LBB28_4
709 ; RV32ZBB-NEXT: .LBB28_2:
711 ; RV32ZBB-NEXT: .LBB28_3:
712 ; RV32ZBB-NEXT: li a0, 1
713 ; RV32ZBB-NEXT: bnez a1, .LBB28_2
714 ; RV32ZBB-NEXT: .LBB28_4:
715 ; RV32ZBB-NEXT: maxu a0, a2, a3
718 ; RV64ZBB-LABEL: umax_i64_one:
720 ; RV64ZBB-NEXT: li a1, 1
721 ; RV64ZBB-NEXT: maxu a0, a0, a1
723 %c = call i64 @llvm.umax.i64(i64 %a, i64 1)