1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv64 -mattr=+c,+zbb -verify-machineinstrs < %s \
3 ; RUN: | FileCheck -check-prefix=NOSFB %s
4 ; RUN: llc -mtriple=riscv64 -mcpu=sifive-u74 -mattr=+zbb -verify-machineinstrs < %s \
5 ; RUN: | FileCheck -check-prefixes=SFB,NOZICOND,RV64SFB %s
6 ; RUN: llc -mtriple=riscv64 -mcpu=sifive-u74 -mattr=+zicond,+zbb \
7 ; RUN: -verify-machineinstrs < %s | FileCheck -check-prefixes=SFB,ZICOND %s
8 ; RUN: llc -mtriple=riscv32 -mcpu=sifive-e76 -mattr=+zbb -verify-machineinstrs < %s \
9 ; RUN: | FileCheck -check-prefixes=SFB,NOZICOND,RV32SFB %s
11 ; The sifive-7-series can predicate a mv.
13 define signext i32 @test1(i32 signext %x, i32 signext %y, i32 signext %z) {
16 ; NOSFB-NEXT: beqz a2, .LBB0_2
17 ; NOSFB-NEXT: # %bb.1:
18 ; NOSFB-NEXT: mv a0, a1
19 ; NOSFB-NEXT: .LBB0_2:
24 ; SFB-NEXT: beqz a2, .LBB0_2
29 %c = icmp eq i32 %z, 0
30 %b = select i1 %c, i32 %x, i32 %y
34 ; Same as above with select operands swapped.
35 define signext i32 @test2(i32 signext %x, i32 signext %y, i32 signext %z) {
38 ; NOSFB-NEXT: beqz a2, .LBB1_2
39 ; NOSFB-NEXT: # %bb.1:
40 ; NOSFB-NEXT: mv a1, a0
41 ; NOSFB-NEXT: .LBB1_2:
42 ; NOSFB-NEXT: mv a0, a1
47 ; SFB-NEXT: bnez a2, .LBB1_2
52 %c = icmp eq i32 %z, 0
53 %b = select i1 %c, i32 %y, i32 %x
57 ; Make sure we don't share the same basic block for two selects with the same
58 ; condition this would break the predication.
59 define signext i32 @test3(i32 signext %v, i32 signext %w, i32 signext %x, i32 signext %y, i32 signext %z) {
62 ; NOSFB-NEXT: beqz a4, .LBB2_2
63 ; NOSFB-NEXT: # %bb.1:
64 ; NOSFB-NEXT: mv a1, a0
65 ; NOSFB-NEXT: mv a2, a3
66 ; NOSFB-NEXT: .LBB2_2:
67 ; NOSFB-NEXT: addw a0, a1, a2
70 ; RV64SFB-LABEL: test3:
72 ; RV64SFB-NEXT: beqz a4, .LBB2_2
73 ; RV64SFB-NEXT: # %bb.1:
74 ; RV64SFB-NEXT: mv a2, a3
75 ; RV64SFB-NEXT: .LBB2_2:
76 ; RV64SFB-NEXT: bnez a4, .LBB2_4
77 ; RV64SFB-NEXT: # %bb.3:
78 ; RV64SFB-NEXT: mv a0, a1
79 ; RV64SFB-NEXT: .LBB2_4:
80 ; RV64SFB-NEXT: addw a0, a0, a2
83 ; ZICOND-LABEL: test3:
85 ; ZICOND-NEXT: beqz a4, .LBB2_2
86 ; ZICOND-NEXT: # %bb.1:
87 ; ZICOND-NEXT: mv a2, a3
88 ; ZICOND-NEXT: .LBB2_2:
89 ; ZICOND-NEXT: bnez a4, .LBB2_4
90 ; ZICOND-NEXT: # %bb.3:
91 ; ZICOND-NEXT: mv a0, a1
92 ; ZICOND-NEXT: .LBB2_4:
93 ; ZICOND-NEXT: addw a0, a0, a2
96 ; RV32SFB-LABEL: test3:
98 ; RV32SFB-NEXT: beqz a4, .LBB2_2
99 ; RV32SFB-NEXT: # %bb.1:
100 ; RV32SFB-NEXT: mv a2, a3
101 ; RV32SFB-NEXT: .LBB2_2:
102 ; RV32SFB-NEXT: bnez a4, .LBB2_4
103 ; RV32SFB-NEXT: # %bb.3:
104 ; RV32SFB-NEXT: mv a0, a1
105 ; RV32SFB-NEXT: .LBB2_4:
106 ; RV32SFB-NEXT: add a0, a0, a2
108 %c = icmp eq i32 %z, 0
109 %a = select i1 %c, i32 %w, i32 %v
110 %b = select i1 %c, i32 %x, i32 %y
115 ; Test with false value 0.
116 define signext i32 @test4(i32 signext %x, i32 signext %z) {
117 ; NOSFB-LABEL: test4:
119 ; NOSFB-NEXT: snez a1, a1
120 ; NOSFB-NEXT: addi a1, a1, -1
121 ; NOSFB-NEXT: and a0, a0, a1
124 ; NOZICOND-LABEL: test4:
126 ; NOZICOND-NEXT: beqz a1, .LBB3_2
127 ; NOZICOND-NEXT: # %bb.1:
128 ; NOZICOND-NEXT: li a0, 0
129 ; NOZICOND-NEXT: .LBB3_2:
132 ; ZICOND-LABEL: test4:
134 ; ZICOND-NEXT: czero.nez a0, a0, a1
136 %c = icmp eq i32 %z, 0
137 %b = select i1 %c, i32 %x, i32 0
141 ; Same as above with select operands swapped.
142 define signext i32 @test5(i32 signext %x, i32 signext %z) {
143 ; NOSFB-LABEL: test5:
145 ; NOSFB-NEXT: seqz a1, a1
146 ; NOSFB-NEXT: addi a1, a1, -1
147 ; NOSFB-NEXT: and a0, a0, a1
150 ; NOZICOND-LABEL: test5:
152 ; NOZICOND-NEXT: bnez a1, .LBB4_2
153 ; NOZICOND-NEXT: # %bb.1:
154 ; NOZICOND-NEXT: li a0, 0
155 ; NOZICOND-NEXT: .LBB4_2:
158 ; ZICOND-LABEL: test5:
160 ; ZICOND-NEXT: czero.eqz a0, a0, a1
162 %c = icmp eq i32 %z, 0
163 %b = select i1 %c, i32 0, i32 %x
167 ; Test with false value -1.
168 define signext i32 @test6(i32 signext %x, i32 signext %z) {
169 ; NOSFB-LABEL: test6:
171 ; NOSFB-NEXT: seqz a1, a1
172 ; NOSFB-NEXT: addi a1, a1, -1
173 ; NOSFB-NEXT: or a0, a0, a1
178 ; SFB-NEXT: li a2, -1
179 ; SFB-NEXT: beqz a1, .LBB5_2
181 ; SFB-NEXT: mv a0, a2
184 %c = icmp eq i32 %z, 0
185 %b = select i1 %c, i32 %x, i32 -1
189 ; Same as above with select operands swapped.
190 define signext i32 @test7(i32 signext %x, i32 signext %z) {
191 ; NOSFB-LABEL: test7:
193 ; NOSFB-NEXT: snez a1, a1
194 ; NOSFB-NEXT: addi a1, a1, -1
195 ; NOSFB-NEXT: or a0, a0, a1
200 ; SFB-NEXT: li a2, -1
201 ; SFB-NEXT: bnez a1, .LBB6_2
203 ; SFB-NEXT: mv a0, a2
206 %c = icmp eq i32 %z, 0
207 %b = select i1 %c, i32 -1, i32 %x
211 define i16 @select_xor_1(i16 %A, i8 %cond) {
212 ; NOSFB-LABEL: select_xor_1:
213 ; NOSFB: # %bb.0: # %entry
214 ; NOSFB-NEXT: slli a1, a1, 63
215 ; NOSFB-NEXT: srai a1, a1, 63
216 ; NOSFB-NEXT: andi a1, a1, 43
217 ; NOSFB-NEXT: xor a0, a0, a1
220 ; SFB-LABEL: select_xor_1:
221 ; SFB: # %bb.0: # %entry
222 ; SFB-NEXT: andi a1, a1, 1
223 ; SFB-NEXT: beqz a1, .LBB7_2
224 ; SFB-NEXT: # %bb.1: # %entry
225 ; SFB-NEXT: xori a0, a0, 43
226 ; SFB-NEXT: .LBB7_2: # %entry
229 %and = and i8 %cond, 1
230 %cmp10 = icmp eq i8 %and, 0
232 %1 = select i1 %cmp10, i16 %A, i16 %0
236 ; Equivalent to above, but with icmp ne (and %cond, 1), 1 instead of
237 ; icmp eq (and %cond, 1), 0
238 define i16 @select_xor_1b(i16 %A, i8 %cond) {
239 ; NOSFB-LABEL: select_xor_1b:
240 ; NOSFB: # %bb.0: # %entry
241 ; NOSFB-NEXT: slli a1, a1, 63
242 ; NOSFB-NEXT: srai a1, a1, 63
243 ; NOSFB-NEXT: andi a1, a1, 43
244 ; NOSFB-NEXT: xor a0, a0, a1
247 ; SFB-LABEL: select_xor_1b:
248 ; SFB: # %bb.0: # %entry
249 ; SFB-NEXT: andi a1, a1, 1
250 ; SFB-NEXT: beqz a1, .LBB8_2
251 ; SFB-NEXT: # %bb.1: # %entry
252 ; SFB-NEXT: xori a0, a0, 43
253 ; SFB-NEXT: .LBB8_2: # %entry
256 %and = and i8 %cond, 1
257 %cmp10 = icmp ne i8 %and, 1
259 %1 = select i1 %cmp10, i16 %A, i16 %0
263 define i32 @select_xor_2(i32 %A, i32 %B, i8 %cond) {
264 ; NOSFB-LABEL: select_xor_2:
265 ; NOSFB: # %bb.0: # %entry
266 ; NOSFB-NEXT: slli a2, a2, 63
267 ; NOSFB-NEXT: srai a2, a2, 63
268 ; NOSFB-NEXT: and a1, a1, a2
269 ; NOSFB-NEXT: xor a0, a0, a1
272 ; SFB-LABEL: select_xor_2:
273 ; SFB: # %bb.0: # %entry
274 ; SFB-NEXT: andi a2, a2, 1
275 ; SFB-NEXT: beqz a2, .LBB9_2
276 ; SFB-NEXT: # %bb.1: # %entry
277 ; SFB-NEXT: xor a0, a0, a1
278 ; SFB-NEXT: .LBB9_2: # %entry
281 %and = and i8 %cond, 1
282 %cmp10 = icmp eq i8 %and, 0
284 %1 = select i1 %cmp10, i32 %A, i32 %0
288 ; Equivalent to above, but with icmp ne (and %cond, 1), 1 instead of
289 ; icmp eq (and %cond, 1), 0
290 define i32 @select_xor_2b(i32 %A, i32 %B, i8 %cond) {
291 ; NOSFB-LABEL: select_xor_2b:
292 ; NOSFB: # %bb.0: # %entry
293 ; NOSFB-NEXT: slli a2, a2, 63
294 ; NOSFB-NEXT: srai a2, a2, 63
295 ; NOSFB-NEXT: and a1, a1, a2
296 ; NOSFB-NEXT: xor a0, a0, a1
299 ; SFB-LABEL: select_xor_2b:
300 ; SFB: # %bb.0: # %entry
301 ; SFB-NEXT: andi a2, a2, 1
302 ; SFB-NEXT: beqz a2, .LBB10_2
303 ; SFB-NEXT: # %bb.1: # %entry
304 ; SFB-NEXT: xor a0, a0, a1
305 ; SFB-NEXT: .LBB10_2: # %entry
308 %and = and i8 %cond, 1
309 %cmp10 = icmp ne i8 %and, 1
311 %1 = select i1 %cmp10, i32 %A, i32 %0
315 define i32 @select_or(i32 %A, i32 %B, i8 %cond) {
316 ; NOSFB-LABEL: select_or:
317 ; NOSFB: # %bb.0: # %entry
318 ; NOSFB-NEXT: slli a2, a2, 63
319 ; NOSFB-NEXT: srai a2, a2, 63
320 ; NOSFB-NEXT: and a1, a1, a2
321 ; NOSFB-NEXT: or a0, a0, a1
324 ; SFB-LABEL: select_or:
325 ; SFB: # %bb.0: # %entry
326 ; SFB-NEXT: andi a2, a2, 1
327 ; SFB-NEXT: beqz a2, .LBB11_2
328 ; SFB-NEXT: # %bb.1: # %entry
329 ; SFB-NEXT: or a0, a0, a1
330 ; SFB-NEXT: .LBB11_2: # %entry
333 %and = and i8 %cond, 1
334 %cmp10 = icmp eq i8 %and, 0
336 %1 = select i1 %cmp10, i32 %A, i32 %0
340 ; Equivalent to above, but with icmp ne (and %cond, 1), 1 instead of
341 ; icmp eq (and %cond, 1), 0
342 define i32 @select_or_b(i32 %A, i32 %B, i8 %cond) {
343 ; NOSFB-LABEL: select_or_b:
344 ; NOSFB: # %bb.0: # %entry
345 ; NOSFB-NEXT: slli a2, a2, 63
346 ; NOSFB-NEXT: srai a2, a2, 63
347 ; NOSFB-NEXT: and a1, a1, a2
348 ; NOSFB-NEXT: or a0, a0, a1
351 ; SFB-LABEL: select_or_b:
352 ; SFB: # %bb.0: # %entry
353 ; SFB-NEXT: andi a2, a2, 1
354 ; SFB-NEXT: beqz a2, .LBB12_2
355 ; SFB-NEXT: # %bb.1: # %entry
356 ; SFB-NEXT: or a0, a0, a1
357 ; SFB-NEXT: .LBB12_2: # %entry
360 %and = and i8 %cond, 1
361 %cmp10 = icmp ne i8 %and, 1
363 %1 = select i1 %cmp10, i32 %A, i32 %0
367 define i32 @select_or_1(i32 %A, i32 %B, i32 %cond) {
368 ; NOSFB-LABEL: select_or_1:
369 ; NOSFB: # %bb.0: # %entry
370 ; NOSFB-NEXT: slli a2, a2, 63
371 ; NOSFB-NEXT: srai a2, a2, 63
372 ; NOSFB-NEXT: and a1, a1, a2
373 ; NOSFB-NEXT: or a0, a0, a1
376 ; SFB-LABEL: select_or_1:
377 ; SFB: # %bb.0: # %entry
378 ; SFB-NEXT: andi a2, a2, 1
379 ; SFB-NEXT: beqz a2, .LBB13_2
380 ; SFB-NEXT: # %bb.1: # %entry
381 ; SFB-NEXT: or a0, a0, a1
382 ; SFB-NEXT: .LBB13_2: # %entry
385 %and = and i32 %cond, 1
386 %cmp10 = icmp eq i32 %and, 0
388 %1 = select i1 %cmp10, i32 %A, i32 %0
392 ; Equivalent to above, but with icmp ne (and %cond, 1), 1 instead of
393 ; icmp eq (and %cond, 1), 0
394 define i32 @select_or_1b(i32 %A, i32 %B, i32 %cond) {
395 ; NOSFB-LABEL: select_or_1b:
396 ; NOSFB: # %bb.0: # %entry
397 ; NOSFB-NEXT: slli a2, a2, 63
398 ; NOSFB-NEXT: srai a2, a2, 63
399 ; NOSFB-NEXT: and a1, a1, a2
400 ; NOSFB-NEXT: or a0, a0, a1
403 ; SFB-LABEL: select_or_1b:
404 ; SFB: # %bb.0: # %entry
405 ; SFB-NEXT: andi a2, a2, 1
406 ; SFB-NEXT: beqz a2, .LBB14_2
407 ; SFB-NEXT: # %bb.1: # %entry
408 ; SFB-NEXT: or a0, a0, a1
409 ; SFB-NEXT: .LBB14_2: # %entry
412 %and = and i32 %cond, 1
413 %cmp10 = icmp ne i32 %and, 1
415 %1 = select i1 %cmp10, i32 %A, i32 %0
419 define void @sextw_removal_ccor(i1 %c, i32 signext %arg, i32 signext %arg1, i32 signext %arg2) nounwind {
420 ; NOSFB-LABEL: sextw_removal_ccor:
421 ; NOSFB: # %bb.0: # %bb
422 ; NOSFB-NEXT: addi sp, sp, -32
423 ; NOSFB-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
424 ; NOSFB-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
425 ; NOSFB-NEXT: sd s1, 8(sp) # 8-byte Folded Spill
426 ; NOSFB-NEXT: mv s0, a2
427 ; NOSFB-NEXT: slli a0, a0, 63
428 ; NOSFB-NEXT: srai a0, a0, 63
429 ; NOSFB-NEXT: and a0, a0, a1
430 ; NOSFB-NEXT: or s1, a0, a3
431 ; NOSFB-NEXT: .LBB15_1: # %bb2
432 ; NOSFB-NEXT: # =>This Inner Loop Header: Depth=1
433 ; NOSFB-NEXT: mv a0, s1
434 ; NOSFB-NEXT: call bar
435 ; NOSFB-NEXT: sllw s1, s1, s0
436 ; NOSFB-NEXT: bnez a0, .LBB15_1
437 ; NOSFB-NEXT: # %bb.2: # %bb7
438 ; NOSFB-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
439 ; NOSFB-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
440 ; NOSFB-NEXT: ld s1, 8(sp) # 8-byte Folded Reload
441 ; NOSFB-NEXT: addi sp, sp, 32
444 ; RV64SFB-LABEL: sextw_removal_ccor:
445 ; RV64SFB: # %bb.0: # %bb
446 ; RV64SFB-NEXT: addi sp, sp, -32
447 ; RV64SFB-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
448 ; RV64SFB-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
449 ; RV64SFB-NEXT: sd s1, 8(sp) # 8-byte Folded Spill
450 ; RV64SFB-NEXT: mv s0, a3
451 ; RV64SFB-NEXT: andi a0, a0, 1
452 ; RV64SFB-NEXT: mv s1, a2
453 ; RV64SFB-NEXT: beqz a0, .LBB15_4
454 ; RV64SFB-NEXT: # %bb.3: # %bb
455 ; RV64SFB-NEXT: or s0, a3, a1
456 ; RV64SFB-NEXT: .LBB15_4: # %bb
457 ; RV64SFB-NEXT: .LBB15_1: # %bb2
458 ; RV64SFB-NEXT: # =>This Inner Loop Header: Depth=1
459 ; RV64SFB-NEXT: mv a0, s0
460 ; RV64SFB-NEXT: call bar
461 ; RV64SFB-NEXT: sllw s0, s0, s1
462 ; RV64SFB-NEXT: bnez a0, .LBB15_1
463 ; RV64SFB-NEXT: # %bb.2: # %bb7
464 ; RV64SFB-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
465 ; RV64SFB-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
466 ; RV64SFB-NEXT: ld s1, 8(sp) # 8-byte Folded Reload
467 ; RV64SFB-NEXT: addi sp, sp, 32
470 ; ZICOND-LABEL: sextw_removal_ccor:
471 ; ZICOND: # %bb.0: # %bb
472 ; ZICOND-NEXT: addi sp, sp, -32
473 ; ZICOND-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
474 ; ZICOND-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
475 ; ZICOND-NEXT: sd s1, 8(sp) # 8-byte Folded Spill
476 ; ZICOND-NEXT: mv s0, a3
477 ; ZICOND-NEXT: andi a0, a0, 1
478 ; ZICOND-NEXT: mv s1, a2
479 ; ZICOND-NEXT: beqz a0, .LBB15_4
480 ; ZICOND-NEXT: # %bb.3: # %bb
481 ; ZICOND-NEXT: or s0, a3, a1
482 ; ZICOND-NEXT: .LBB15_4: # %bb
483 ; ZICOND-NEXT: .LBB15_1: # %bb2
484 ; ZICOND-NEXT: # =>This Inner Loop Header: Depth=1
485 ; ZICOND-NEXT: mv a0, s0
486 ; ZICOND-NEXT: call bar
487 ; ZICOND-NEXT: sllw s0, s0, s1
488 ; ZICOND-NEXT: bnez a0, .LBB15_1
489 ; ZICOND-NEXT: # %bb.2: # %bb7
490 ; ZICOND-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
491 ; ZICOND-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
492 ; ZICOND-NEXT: ld s1, 8(sp) # 8-byte Folded Reload
493 ; ZICOND-NEXT: addi sp, sp, 32
496 ; RV32SFB-LABEL: sextw_removal_ccor:
497 ; RV32SFB: # %bb.0: # %bb
498 ; RV32SFB-NEXT: addi sp, sp, -16
499 ; RV32SFB-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
500 ; RV32SFB-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
501 ; RV32SFB-NEXT: sw s1, 4(sp) # 4-byte Folded Spill
502 ; RV32SFB-NEXT: mv s0, a3
503 ; RV32SFB-NEXT: andi a0, a0, 1
504 ; RV32SFB-NEXT: mv s1, a2
505 ; RV32SFB-NEXT: beqz a0, .LBB15_4
506 ; RV32SFB-NEXT: # %bb.3: # %bb
507 ; RV32SFB-NEXT: or s0, a3, a1
508 ; RV32SFB-NEXT: .LBB15_4: # %bb
509 ; RV32SFB-NEXT: .LBB15_1: # %bb2
510 ; RV32SFB-NEXT: # =>This Inner Loop Header: Depth=1
511 ; RV32SFB-NEXT: mv a0, s0
512 ; RV32SFB-NEXT: call bar
513 ; RV32SFB-NEXT: sll s0, s0, s1
514 ; RV32SFB-NEXT: bnez a0, .LBB15_1
515 ; RV32SFB-NEXT: # %bb.2: # %bb7
516 ; RV32SFB-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
517 ; RV32SFB-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
518 ; RV32SFB-NEXT: lw s1, 4(sp) # 4-byte Folded Reload
519 ; RV32SFB-NEXT: addi sp, sp, 16
522 %sel = select i1 %c, i32 %arg, i32 0
523 %or = or i32 %sel, %arg2
526 bb2: ; preds = %bb2, %bb
527 %i3 = phi i32 [ %or, %bb ], [ %i5, %bb2 ]
528 %i4 = tail call signext i32 @bar(i32 signext %i3)
529 %i5 = shl i32 %i3, %arg1
530 %i6 = icmp eq i32 %i4, 0
531 br i1 %i6, label %bb7, label %bb2
536 declare signext i32 @bar(i32 signext)
538 define void @sextw_removal_ccaddw(i1 %c, i32 signext %arg, i32 signext %arg1, i32 %arg2) nounwind {
539 ; NOSFB-LABEL: sextw_removal_ccaddw:
540 ; NOSFB: # %bb.0: # %bb
541 ; NOSFB-NEXT: addi sp, sp, -32
542 ; NOSFB-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
543 ; NOSFB-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
544 ; NOSFB-NEXT: sd s1, 8(sp) # 8-byte Folded Spill
545 ; NOSFB-NEXT: mv s0, a2
546 ; NOSFB-NEXT: slli a0, a0, 63
547 ; NOSFB-NEXT: srai a0, a0, 63
548 ; NOSFB-NEXT: and a0, a0, a3
549 ; NOSFB-NEXT: addw s1, a0, a1
550 ; NOSFB-NEXT: .LBB16_1: # %bb2
551 ; NOSFB-NEXT: # =>This Inner Loop Header: Depth=1
552 ; NOSFB-NEXT: mv a0, s1
553 ; NOSFB-NEXT: call bar
554 ; NOSFB-NEXT: sllw s1, s1, s0
555 ; NOSFB-NEXT: bnez a0, .LBB16_1
556 ; NOSFB-NEXT: # %bb.2: # %bb7
557 ; NOSFB-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
558 ; NOSFB-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
559 ; NOSFB-NEXT: ld s1, 8(sp) # 8-byte Folded Reload
560 ; NOSFB-NEXT: addi sp, sp, 32
563 ; RV64SFB-LABEL: sextw_removal_ccaddw:
564 ; RV64SFB: # %bb.0: # %bb
565 ; RV64SFB-NEXT: addi sp, sp, -32
566 ; RV64SFB-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
567 ; RV64SFB-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
568 ; RV64SFB-NEXT: sd s1, 8(sp) # 8-byte Folded Spill
569 ; RV64SFB-NEXT: mv s1, a1
570 ; RV64SFB-NEXT: andi a0, a0, 1
571 ; RV64SFB-NEXT: mv s0, a2
572 ; RV64SFB-NEXT: beqz a0, .LBB16_4
573 ; RV64SFB-NEXT: # %bb.3: # %bb
574 ; RV64SFB-NEXT: addw s1, a1, a3
575 ; RV64SFB-NEXT: .LBB16_4: # %bb
576 ; RV64SFB-NEXT: .LBB16_1: # %bb2
577 ; RV64SFB-NEXT: # =>This Inner Loop Header: Depth=1
578 ; RV64SFB-NEXT: mv a0, s1
579 ; RV64SFB-NEXT: call bar
580 ; RV64SFB-NEXT: sllw s1, s1, s0
581 ; RV64SFB-NEXT: bnez a0, .LBB16_1
582 ; RV64SFB-NEXT: # %bb.2: # %bb7
583 ; RV64SFB-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
584 ; RV64SFB-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
585 ; RV64SFB-NEXT: ld s1, 8(sp) # 8-byte Folded Reload
586 ; RV64SFB-NEXT: addi sp, sp, 32
589 ; ZICOND-LABEL: sextw_removal_ccaddw:
590 ; ZICOND: # %bb.0: # %bb
591 ; ZICOND-NEXT: addi sp, sp, -32
592 ; ZICOND-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
593 ; ZICOND-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
594 ; ZICOND-NEXT: sd s1, 8(sp) # 8-byte Folded Spill
595 ; ZICOND-NEXT: mv s1, a1
596 ; ZICOND-NEXT: andi a0, a0, 1
597 ; ZICOND-NEXT: mv s0, a2
598 ; ZICOND-NEXT: beqz a0, .LBB16_4
599 ; ZICOND-NEXT: # %bb.3: # %bb
600 ; ZICOND-NEXT: addw s1, a1, a3
601 ; ZICOND-NEXT: .LBB16_4: # %bb
602 ; ZICOND-NEXT: .LBB16_1: # %bb2
603 ; ZICOND-NEXT: # =>This Inner Loop Header: Depth=1
604 ; ZICOND-NEXT: mv a0, s1
605 ; ZICOND-NEXT: call bar
606 ; ZICOND-NEXT: sllw s1, s1, s0
607 ; ZICOND-NEXT: bnez a0, .LBB16_1
608 ; ZICOND-NEXT: # %bb.2: # %bb7
609 ; ZICOND-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
610 ; ZICOND-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
611 ; ZICOND-NEXT: ld s1, 8(sp) # 8-byte Folded Reload
612 ; ZICOND-NEXT: addi sp, sp, 32
615 ; RV32SFB-LABEL: sextw_removal_ccaddw:
616 ; RV32SFB: # %bb.0: # %bb
617 ; RV32SFB-NEXT: addi sp, sp, -16
618 ; RV32SFB-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
619 ; RV32SFB-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
620 ; RV32SFB-NEXT: sw s1, 4(sp) # 4-byte Folded Spill
621 ; RV32SFB-NEXT: mv s1, a1
622 ; RV32SFB-NEXT: andi a0, a0, 1
623 ; RV32SFB-NEXT: mv s0, a2
624 ; RV32SFB-NEXT: beqz a0, .LBB16_4
625 ; RV32SFB-NEXT: # %bb.3: # %bb
626 ; RV32SFB-NEXT: add s1, a1, a3
627 ; RV32SFB-NEXT: .LBB16_4: # %bb
628 ; RV32SFB-NEXT: .LBB16_1: # %bb2
629 ; RV32SFB-NEXT: # =>This Inner Loop Header: Depth=1
630 ; RV32SFB-NEXT: mv a0, s1
631 ; RV32SFB-NEXT: call bar
632 ; RV32SFB-NEXT: sll s1, s1, s0
633 ; RV32SFB-NEXT: bnez a0, .LBB16_1
634 ; RV32SFB-NEXT: # %bb.2: # %bb7
635 ; RV32SFB-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
636 ; RV32SFB-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
637 ; RV32SFB-NEXT: lw s1, 4(sp) # 4-byte Folded Reload
638 ; RV32SFB-NEXT: addi sp, sp, 16
641 %sel = select i1 %c, i32 %arg2, i32 0
642 %or = add i32 %sel, %arg
645 bb2: ; preds = %bb2, %bb
646 %i3 = phi i32 [ %or, %bb ], [ %i5, %bb2 ]
647 %i4 = tail call signext i32 @bar(i32 signext %i3)
648 %i5 = shl i32 %i3, %arg1
649 %i6 = icmp eq i32 %i4, 0
650 br i1 %i6, label %bb7, label %bb2
656 define i32 @select_sllw(i32 %A, i32 %B, i32 %C, i1 zeroext %cond) {
657 ; NOSFB-LABEL: select_sllw:
658 ; NOSFB: # %bb.0: # %entry
659 ; NOSFB-NEXT: bnez a3, .LBB17_2
660 ; NOSFB-NEXT: # %bb.1: # %entry
661 ; NOSFB-NEXT: sllw a2, a0, a1
662 ; NOSFB-NEXT: .LBB17_2: # %entry
663 ; NOSFB-NEXT: mv a0, a2
666 ; RV64SFB-LABEL: select_sllw:
667 ; RV64SFB: # %bb.0: # %entry
668 ; RV64SFB-NEXT: bnez a3, .LBB17_2
669 ; RV64SFB-NEXT: # %bb.1: # %entry
670 ; RV64SFB-NEXT: sllw a2, a0, a1
671 ; RV64SFB-NEXT: .LBB17_2: # %entry
672 ; RV64SFB-NEXT: mv a0, a2
675 ; ZICOND-LABEL: select_sllw:
676 ; ZICOND: # %bb.0: # %entry
677 ; ZICOND-NEXT: bnez a3, .LBB17_2
678 ; ZICOND-NEXT: # %bb.1: # %entry
679 ; ZICOND-NEXT: sllw a2, a0, a1
680 ; ZICOND-NEXT: .LBB17_2: # %entry
681 ; ZICOND-NEXT: mv a0, a2
684 ; RV32SFB-LABEL: select_sllw:
685 ; RV32SFB: # %bb.0: # %entry
686 ; RV32SFB-NEXT: bnez a3, .LBB17_2
687 ; RV32SFB-NEXT: # %bb.1: # %entry
688 ; RV32SFB-NEXT: sll a2, a0, a1
689 ; RV32SFB-NEXT: .LBB17_2: # %entry
690 ; RV32SFB-NEXT: mv a0, a2
694 %1 = select i1 %cond, i32 %C, i32 %0
698 define i32 @select_srlw(i32 %A, i32 %B, i32 %C, i1 zeroext %cond) {
699 ; NOSFB-LABEL: select_srlw:
700 ; NOSFB: # %bb.0: # %entry
701 ; NOSFB-NEXT: bnez a3, .LBB18_2
702 ; NOSFB-NEXT: # %bb.1: # %entry
703 ; NOSFB-NEXT: srlw a2, a0, a1
704 ; NOSFB-NEXT: .LBB18_2: # %entry
705 ; NOSFB-NEXT: mv a0, a2
708 ; RV64SFB-LABEL: select_srlw:
709 ; RV64SFB: # %bb.0: # %entry
710 ; RV64SFB-NEXT: bnez a3, .LBB18_2
711 ; RV64SFB-NEXT: # %bb.1: # %entry
712 ; RV64SFB-NEXT: srlw a2, a0, a1
713 ; RV64SFB-NEXT: .LBB18_2: # %entry
714 ; RV64SFB-NEXT: mv a0, a2
717 ; ZICOND-LABEL: select_srlw:
718 ; ZICOND: # %bb.0: # %entry
719 ; ZICOND-NEXT: bnez a3, .LBB18_2
720 ; ZICOND-NEXT: # %bb.1: # %entry
721 ; ZICOND-NEXT: srlw a2, a0, a1
722 ; ZICOND-NEXT: .LBB18_2: # %entry
723 ; ZICOND-NEXT: mv a0, a2
726 ; RV32SFB-LABEL: select_srlw:
727 ; RV32SFB: # %bb.0: # %entry
728 ; RV32SFB-NEXT: bnez a3, .LBB18_2
729 ; RV32SFB-NEXT: # %bb.1: # %entry
730 ; RV32SFB-NEXT: srl a2, a0, a1
731 ; RV32SFB-NEXT: .LBB18_2: # %entry
732 ; RV32SFB-NEXT: mv a0, a2
736 %1 = select i1 %cond, i32 %C, i32 %0
740 define i32 @select_sraw(i32 %A, i32 %B, i32 %C, i1 zeroext %cond) {
741 ; NOSFB-LABEL: select_sraw:
742 ; NOSFB: # %bb.0: # %entry
743 ; NOSFB-NEXT: bnez a3, .LBB19_2
744 ; NOSFB-NEXT: # %bb.1: # %entry
745 ; NOSFB-NEXT: sraw a2, a0, a1
746 ; NOSFB-NEXT: .LBB19_2: # %entry
747 ; NOSFB-NEXT: mv a0, a2
750 ; RV64SFB-LABEL: select_sraw:
751 ; RV64SFB: # %bb.0: # %entry
752 ; RV64SFB-NEXT: bnez a3, .LBB19_2
753 ; RV64SFB-NEXT: # %bb.1: # %entry
754 ; RV64SFB-NEXT: sraw a2, a0, a1
755 ; RV64SFB-NEXT: .LBB19_2: # %entry
756 ; RV64SFB-NEXT: mv a0, a2
759 ; ZICOND-LABEL: select_sraw:
760 ; ZICOND: # %bb.0: # %entry
761 ; ZICOND-NEXT: bnez a3, .LBB19_2
762 ; ZICOND-NEXT: # %bb.1: # %entry
763 ; ZICOND-NEXT: sraw a2, a0, a1
764 ; ZICOND-NEXT: .LBB19_2: # %entry
765 ; ZICOND-NEXT: mv a0, a2
768 ; RV32SFB-LABEL: select_sraw:
769 ; RV32SFB: # %bb.0: # %entry
770 ; RV32SFB-NEXT: bnez a3, .LBB19_2
771 ; RV32SFB-NEXT: # %bb.1: # %entry
772 ; RV32SFB-NEXT: sra a2, a0, a1
773 ; RV32SFB-NEXT: .LBB19_2: # %entry
774 ; RV32SFB-NEXT: mv a0, a2
778 %1 = select i1 %cond, i32 %C, i32 %0
782 define i64 @select_sll(i64 %A, i64 %B, i64 %C, i1 zeroext %cond) {
783 ; NOSFB-LABEL: select_sll:
784 ; NOSFB: # %bb.0: # %entry
785 ; NOSFB-NEXT: bnez a3, .LBB20_2
786 ; NOSFB-NEXT: # %bb.1: # %entry
787 ; NOSFB-NEXT: sll a2, a0, a1
788 ; NOSFB-NEXT: .LBB20_2: # %entry
789 ; NOSFB-NEXT: mv a0, a2
792 ; RV64SFB-LABEL: select_sll:
793 ; RV64SFB: # %bb.0: # %entry
794 ; RV64SFB-NEXT: bnez a3, .LBB20_2
795 ; RV64SFB-NEXT: # %bb.1: # %entry
796 ; RV64SFB-NEXT: sll a2, a0, a1
797 ; RV64SFB-NEXT: .LBB20_2: # %entry
798 ; RV64SFB-NEXT: mv a0, a2
801 ; ZICOND-LABEL: select_sll:
802 ; ZICOND: # %bb.0: # %entry
803 ; ZICOND-NEXT: bnez a3, .LBB20_2
804 ; ZICOND-NEXT: # %bb.1: # %entry
805 ; ZICOND-NEXT: sll a2, a0, a1
806 ; ZICOND-NEXT: .LBB20_2: # %entry
807 ; ZICOND-NEXT: mv a0, a2
810 ; RV32SFB-LABEL: select_sll:
811 ; RV32SFB: # %bb.0: # %entry
812 ; RV32SFB-NEXT: sll a3, a0, a2
813 ; RV32SFB-NEXT: not a7, a2
814 ; RV32SFB-NEXT: srli a0, a0, 1
815 ; RV32SFB-NEXT: sll t0, a1, a2
816 ; RV32SFB-NEXT: addi a2, a2, -32
817 ; RV32SFB-NEXT: srl a0, a0, a7
818 ; RV32SFB-NEXT: mv a1, a3
819 ; RV32SFB-NEXT: bltz a2, .LBB20_2
820 ; RV32SFB-NEXT: # %bb.1: # %entry
821 ; RV32SFB-NEXT: li a3, 0
822 ; RV32SFB-NEXT: .LBB20_2: # %entry
823 ; RV32SFB-NEXT: bgez a2, .LBB20_4
824 ; RV32SFB-NEXT: # %bb.3: # %entry
825 ; RV32SFB-NEXT: or a1, t0, a0
826 ; RV32SFB-NEXT: .LBB20_4: # %entry
827 ; RV32SFB-NEXT: beqz a6, .LBB20_6
828 ; RV32SFB-NEXT: # %bb.5: # %entry
829 ; RV32SFB-NEXT: mv a3, a4
830 ; RV32SFB-NEXT: .LBB20_6: # %entry
831 ; RV32SFB-NEXT: beqz a6, .LBB20_8
832 ; RV32SFB-NEXT: # %bb.7: # %entry
833 ; RV32SFB-NEXT: mv a1, a5
834 ; RV32SFB-NEXT: .LBB20_8: # %entry
835 ; RV32SFB-NEXT: mv a0, a3
839 %1 = select i1 %cond, i64 %C, i64 %0
843 define i64 @select_srl(i64 %A, i64 %B, i64 %C, i1 zeroext %cond) {
844 ; NOSFB-LABEL: select_srl:
845 ; NOSFB: # %bb.0: # %entry
846 ; NOSFB-NEXT: bnez a3, .LBB21_2
847 ; NOSFB-NEXT: # %bb.1: # %entry
848 ; NOSFB-NEXT: srl a2, a0, a1
849 ; NOSFB-NEXT: .LBB21_2: # %entry
850 ; NOSFB-NEXT: mv a0, a2
853 ; RV64SFB-LABEL: select_srl:
854 ; RV64SFB: # %bb.0: # %entry
855 ; RV64SFB-NEXT: bnez a3, .LBB21_2
856 ; RV64SFB-NEXT: # %bb.1: # %entry
857 ; RV64SFB-NEXT: srl a2, a0, a1
858 ; RV64SFB-NEXT: .LBB21_2: # %entry
859 ; RV64SFB-NEXT: mv a0, a2
862 ; ZICOND-LABEL: select_srl:
863 ; ZICOND: # %bb.0: # %entry
864 ; ZICOND-NEXT: bnez a3, .LBB21_2
865 ; ZICOND-NEXT: # %bb.1: # %entry
866 ; ZICOND-NEXT: srl a2, a0, a1
867 ; ZICOND-NEXT: .LBB21_2: # %entry
868 ; ZICOND-NEXT: mv a0, a2
871 ; RV32SFB-LABEL: select_srl:
872 ; RV32SFB: # %bb.0: # %entry
873 ; RV32SFB-NEXT: srl a3, a1, a2
874 ; RV32SFB-NEXT: not a7, a2
875 ; RV32SFB-NEXT: slli a1, a1, 1
876 ; RV32SFB-NEXT: srl t0, a0, a2
877 ; RV32SFB-NEXT: addi a2, a2, -32
878 ; RV32SFB-NEXT: sll a1, a1, a7
879 ; RV32SFB-NEXT: mv a0, a3
880 ; RV32SFB-NEXT: bltz a2, .LBB21_2
881 ; RV32SFB-NEXT: # %bb.1: # %entry
882 ; RV32SFB-NEXT: li a3, 0
883 ; RV32SFB-NEXT: .LBB21_2: # %entry
884 ; RV32SFB-NEXT: bgez a2, .LBB21_4
885 ; RV32SFB-NEXT: # %bb.3: # %entry
886 ; RV32SFB-NEXT: or a0, t0, a1
887 ; RV32SFB-NEXT: .LBB21_4: # %entry
888 ; RV32SFB-NEXT: beqz a6, .LBB21_6
889 ; RV32SFB-NEXT: # %bb.5: # %entry
890 ; RV32SFB-NEXT: mv a3, a5
891 ; RV32SFB-NEXT: .LBB21_6: # %entry
892 ; RV32SFB-NEXT: beqz a6, .LBB21_8
893 ; RV32SFB-NEXT: # %bb.7: # %entry
894 ; RV32SFB-NEXT: mv a0, a4
895 ; RV32SFB-NEXT: .LBB21_8: # %entry
896 ; RV32SFB-NEXT: mv a1, a3
900 %1 = select i1 %cond, i64 %C, i64 %0
904 define i64 @select_sra(i64 %A, i64 %B, i64 %C, i1 zeroext %cond) {
905 ; NOSFB-LABEL: select_sra:
906 ; NOSFB: # %bb.0: # %entry
907 ; NOSFB-NEXT: bnez a3, .LBB22_2
908 ; NOSFB-NEXT: # %bb.1: # %entry
909 ; NOSFB-NEXT: sra a2, a0, a1
910 ; NOSFB-NEXT: .LBB22_2: # %entry
911 ; NOSFB-NEXT: mv a0, a2
914 ; RV64SFB-LABEL: select_sra:
915 ; RV64SFB: # %bb.0: # %entry
916 ; RV64SFB-NEXT: bnez a3, .LBB22_2
917 ; RV64SFB-NEXT: # %bb.1: # %entry
918 ; RV64SFB-NEXT: sra a2, a0, a1
919 ; RV64SFB-NEXT: .LBB22_2: # %entry
920 ; RV64SFB-NEXT: mv a0, a2
923 ; ZICOND-LABEL: select_sra:
924 ; ZICOND: # %bb.0: # %entry
925 ; ZICOND-NEXT: bnez a3, .LBB22_2
926 ; ZICOND-NEXT: # %bb.1: # %entry
927 ; ZICOND-NEXT: sra a2, a0, a1
928 ; ZICOND-NEXT: .LBB22_2: # %entry
929 ; ZICOND-NEXT: mv a0, a2
932 ; RV32SFB-LABEL: select_sra:
933 ; RV32SFB: # %bb.0: # %entry
934 ; RV32SFB-NEXT: sra a3, a1, a2
935 ; RV32SFB-NEXT: not a7, a2
936 ; RV32SFB-NEXT: slli t0, a1, 1
937 ; RV32SFB-NEXT: srl t1, a0, a2
938 ; RV32SFB-NEXT: addi a2, a2, -32
939 ; RV32SFB-NEXT: sll a7, t0, a7
940 ; RV32SFB-NEXT: mv a0, a3
941 ; RV32SFB-NEXT: bltz a2, .LBB22_2
942 ; RV32SFB-NEXT: # %bb.1: # %entry
943 ; RV32SFB-NEXT: srai a3, a1, 31
944 ; RV32SFB-NEXT: .LBB22_2: # %entry
945 ; RV32SFB-NEXT: bgez a2, .LBB22_4
946 ; RV32SFB-NEXT: # %bb.3: # %entry
947 ; RV32SFB-NEXT: or a0, t1, a7
948 ; RV32SFB-NEXT: .LBB22_4: # %entry
949 ; RV32SFB-NEXT: beqz a6, .LBB22_6
950 ; RV32SFB-NEXT: # %bb.5: # %entry
951 ; RV32SFB-NEXT: mv a3, a5
952 ; RV32SFB-NEXT: .LBB22_6: # %entry
953 ; RV32SFB-NEXT: beqz a6, .LBB22_8
954 ; RV32SFB-NEXT: # %bb.7: # %entry
955 ; RV32SFB-NEXT: mv a0, a4
956 ; RV32SFB-NEXT: .LBB22_8: # %entry
957 ; RV32SFB-NEXT: mv a1, a3
961 %1 = select i1 %cond, i64 %C, i64 %0
965 define i32 @select_addiw(i32 %A, i32 %C, i1 zeroext %cond) {
966 ; NOSFB-LABEL: select_addiw:
967 ; NOSFB: # %bb.0: # %entry
968 ; NOSFB-NEXT: bnez a2, .LBB23_2
969 ; NOSFB-NEXT: # %bb.1: # %entry
970 ; NOSFB-NEXT: addiw a1, a0, 1234
971 ; NOSFB-NEXT: .LBB23_2: # %entry
972 ; NOSFB-NEXT: mv a0, a1
975 ; RV64SFB-LABEL: select_addiw:
976 ; RV64SFB: # %bb.0: # %entry
977 ; RV64SFB-NEXT: bnez a2, .LBB23_2
978 ; RV64SFB-NEXT: # %bb.1: # %entry
979 ; RV64SFB-NEXT: addiw a1, a0, 1234
980 ; RV64SFB-NEXT: .LBB23_2: # %entry
981 ; RV64SFB-NEXT: mv a0, a1
984 ; ZICOND-LABEL: select_addiw:
985 ; ZICOND: # %bb.0: # %entry
986 ; ZICOND-NEXT: bnez a2, .LBB23_2
987 ; ZICOND-NEXT: # %bb.1: # %entry
988 ; ZICOND-NEXT: addiw a1, a0, 1234
989 ; ZICOND-NEXT: .LBB23_2: # %entry
990 ; ZICOND-NEXT: mv a0, a1
993 ; RV32SFB-LABEL: select_addiw:
994 ; RV32SFB: # %bb.0: # %entry
995 ; RV32SFB-NEXT: bnez a2, .LBB23_2
996 ; RV32SFB-NEXT: # %bb.1: # %entry
997 ; RV32SFB-NEXT: addi a1, a0, 1234
998 ; RV32SFB-NEXT: .LBB23_2: # %entry
999 ; RV32SFB-NEXT: mv a0, a1
1002 %0 = add i32 %A, 1234
1003 %1 = select i1 %cond, i32 %C, i32 %0
1007 define i64 @select_addi(i64 %A, i64 %C, i1 zeroext %cond) {
1008 ; NOSFB-LABEL: select_addi:
1009 ; NOSFB: # %bb.0: # %entry
1010 ; NOSFB-NEXT: bnez a2, .LBB24_2
1011 ; NOSFB-NEXT: # %bb.1: # %entry
1012 ; NOSFB-NEXT: addi a1, a0, 1234
1013 ; NOSFB-NEXT: .LBB24_2: # %entry
1014 ; NOSFB-NEXT: mv a0, a1
1017 ; RV64SFB-LABEL: select_addi:
1018 ; RV64SFB: # %bb.0: # %entry
1019 ; RV64SFB-NEXT: bnez a2, .LBB24_2
1020 ; RV64SFB-NEXT: # %bb.1: # %entry
1021 ; RV64SFB-NEXT: addi a1, a0, 1234
1022 ; RV64SFB-NEXT: .LBB24_2: # %entry
1023 ; RV64SFB-NEXT: mv a0, a1
1026 ; ZICOND-LABEL: select_addi:
1027 ; ZICOND: # %bb.0: # %entry
1028 ; ZICOND-NEXT: bnez a2, .LBB24_2
1029 ; ZICOND-NEXT: # %bb.1: # %entry
1030 ; ZICOND-NEXT: addi a1, a0, 1234
1031 ; ZICOND-NEXT: .LBB24_2: # %entry
1032 ; ZICOND-NEXT: mv a0, a1
1035 ; RV32SFB-LABEL: select_addi:
1036 ; RV32SFB: # %bb.0: # %entry
1037 ; RV32SFB-NEXT: addi a5, a0, 1234
1038 ; RV32SFB-NEXT: sltu a0, a5, a0
1039 ; RV32SFB-NEXT: beqz a4, .LBB24_2
1040 ; RV32SFB-NEXT: # %bb.1: # %entry
1041 ; RV32SFB-NEXT: mv a5, a2
1042 ; RV32SFB-NEXT: .LBB24_2: # %entry
1043 ; RV32SFB-NEXT: bnez a4, .LBB24_4
1044 ; RV32SFB-NEXT: # %bb.3: # %entry
1045 ; RV32SFB-NEXT: add a3, a1, a0
1046 ; RV32SFB-NEXT: .LBB24_4: # %entry
1047 ; RV32SFB-NEXT: mv a0, a5
1048 ; RV32SFB-NEXT: mv a1, a3
1051 %0 = add i64 %A, 1234
1052 %1 = select i1 %cond, i64 %C, i64 %0
1056 define i64 @select_andi(i64 %A, i64 %C, i1 zeroext %cond) {
1057 ; NOSFB-LABEL: select_andi:
1058 ; NOSFB: # %bb.0: # %entry
1059 ; NOSFB-NEXT: bnez a2, .LBB25_2
1060 ; NOSFB-NEXT: # %bb.1: # %entry
1061 ; NOSFB-NEXT: andi a1, a0, 567
1062 ; NOSFB-NEXT: .LBB25_2: # %entry
1063 ; NOSFB-NEXT: mv a0, a1
1066 ; RV64SFB-LABEL: select_andi:
1067 ; RV64SFB: # %bb.0: # %entry
1068 ; RV64SFB-NEXT: bnez a2, .LBB25_2
1069 ; RV64SFB-NEXT: # %bb.1: # %entry
1070 ; RV64SFB-NEXT: andi a1, a0, 567
1071 ; RV64SFB-NEXT: .LBB25_2: # %entry
1072 ; RV64SFB-NEXT: mv a0, a1
1075 ; ZICOND-LABEL: select_andi:
1076 ; ZICOND: # %bb.0: # %entry
1077 ; ZICOND-NEXT: bnez a2, .LBB25_2
1078 ; ZICOND-NEXT: # %bb.1: # %entry
1079 ; ZICOND-NEXT: andi a1, a0, 567
1080 ; ZICOND-NEXT: .LBB25_2: # %entry
1081 ; ZICOND-NEXT: mv a0, a1
1084 ; RV32SFB-LABEL: select_andi:
1085 ; RV32SFB: # %bb.0: # %entry
1086 ; RV32SFB-NEXT: mv a1, a3
1087 ; RV32SFB-NEXT: bnez a4, .LBB25_2
1088 ; RV32SFB-NEXT: # %bb.1: # %entry
1089 ; RV32SFB-NEXT: andi a2, a0, 567
1090 ; RV32SFB-NEXT: .LBB25_2: # %entry
1091 ; RV32SFB-NEXT: mv a0, a2
1092 ; RV32SFB-NEXT: bnez a4, .LBB25_4
1093 ; RV32SFB-NEXT: # %bb.3: # %entry
1094 ; RV32SFB-NEXT: li a1, 0
1095 ; RV32SFB-NEXT: .LBB25_4: # %entry
1098 %0 = and i64 %A, 567
1099 %1 = select i1 %cond, i64 %C, i64 %0
1103 define i64 @select_ori(i64 %A, i64 %C, i1 zeroext %cond) {
1104 ; NOSFB-LABEL: select_ori:
1105 ; NOSFB: # %bb.0: # %entry
1106 ; NOSFB-NEXT: bnez a2, .LBB26_2
1107 ; NOSFB-NEXT: # %bb.1: # %entry
1108 ; NOSFB-NEXT: ori a1, a0, 890
1109 ; NOSFB-NEXT: .LBB26_2: # %entry
1110 ; NOSFB-NEXT: mv a0, a1
1113 ; RV64SFB-LABEL: select_ori:
1114 ; RV64SFB: # %bb.0: # %entry
1115 ; RV64SFB-NEXT: bnez a2, .LBB26_2
1116 ; RV64SFB-NEXT: # %bb.1: # %entry
1117 ; RV64SFB-NEXT: ori a1, a0, 890
1118 ; RV64SFB-NEXT: .LBB26_2: # %entry
1119 ; RV64SFB-NEXT: mv a0, a1
1122 ; ZICOND-LABEL: select_ori:
1123 ; ZICOND: # %bb.0: # %entry
1124 ; ZICOND-NEXT: bnez a2, .LBB26_2
1125 ; ZICOND-NEXT: # %bb.1: # %entry
1126 ; ZICOND-NEXT: ori a1, a0, 890
1127 ; ZICOND-NEXT: .LBB26_2: # %entry
1128 ; ZICOND-NEXT: mv a0, a1
1131 ; RV32SFB-LABEL: select_ori:
1132 ; RV32SFB: # %bb.0: # %entry
1133 ; RV32SFB-NEXT: bnez a4, .LBB26_2
1134 ; RV32SFB-NEXT: # %bb.1: # %entry
1135 ; RV32SFB-NEXT: ori a2, a0, 890
1136 ; RV32SFB-NEXT: .LBB26_2: # %entry
1137 ; RV32SFB-NEXT: beqz a4, .LBB26_4
1138 ; RV32SFB-NEXT: # %bb.3: # %entry
1139 ; RV32SFB-NEXT: mv a1, a3
1140 ; RV32SFB-NEXT: .LBB26_4: # %entry
1141 ; RV32SFB-NEXT: mv a0, a2
1145 %1 = select i1 %cond, i64 %C, i64 %0
1149 define i64 @select_xori(i64 %A, i64 %C, i1 zeroext %cond) {
1150 ; NOSFB-LABEL: select_xori:
1151 ; NOSFB: # %bb.0: # %entry
1152 ; NOSFB-NEXT: bnez a2, .LBB27_2
1153 ; NOSFB-NEXT: # %bb.1: # %entry
1154 ; NOSFB-NEXT: xori a1, a0, 321
1155 ; NOSFB-NEXT: .LBB27_2: # %entry
1156 ; NOSFB-NEXT: mv a0, a1
1159 ; RV64SFB-LABEL: select_xori:
1160 ; RV64SFB: # %bb.0: # %entry
1161 ; RV64SFB-NEXT: bnez a2, .LBB27_2
1162 ; RV64SFB-NEXT: # %bb.1: # %entry
1163 ; RV64SFB-NEXT: xori a1, a0, 321
1164 ; RV64SFB-NEXT: .LBB27_2: # %entry
1165 ; RV64SFB-NEXT: mv a0, a1
1168 ; ZICOND-LABEL: select_xori:
1169 ; ZICOND: # %bb.0: # %entry
1170 ; ZICOND-NEXT: bnez a2, .LBB27_2
1171 ; ZICOND-NEXT: # %bb.1: # %entry
1172 ; ZICOND-NEXT: xori a1, a0, 321
1173 ; ZICOND-NEXT: .LBB27_2: # %entry
1174 ; ZICOND-NEXT: mv a0, a1
1177 ; RV32SFB-LABEL: select_xori:
1178 ; RV32SFB: # %bb.0: # %entry
1179 ; RV32SFB-NEXT: bnez a4, .LBB27_2
1180 ; RV32SFB-NEXT: # %bb.1: # %entry
1181 ; RV32SFB-NEXT: xori a2, a0, 321
1182 ; RV32SFB-NEXT: .LBB27_2: # %entry
1183 ; RV32SFB-NEXT: beqz a4, .LBB27_4
1184 ; RV32SFB-NEXT: # %bb.3: # %entry
1185 ; RV32SFB-NEXT: mv a1, a3
1186 ; RV32SFB-NEXT: .LBB27_4: # %entry
1187 ; RV32SFB-NEXT: mv a0, a2
1190 %0 = xor i64 %A, 321
1191 %1 = select i1 %cond, i64 %C, i64 %0
1195 define i64 @select_slli(i64 %A, i64 %C, i1 zeroext %cond) {
1196 ; NOSFB-LABEL: select_slli:
1197 ; NOSFB: # %bb.0: # %entry
1198 ; NOSFB-NEXT: bnez a2, .LBB28_2
1199 ; NOSFB-NEXT: # %bb.1: # %entry
1200 ; NOSFB-NEXT: slli a1, a0, 32
1201 ; NOSFB-NEXT: .LBB28_2: # %entry
1202 ; NOSFB-NEXT: mv a0, a1
1205 ; RV64SFB-LABEL: select_slli:
1206 ; RV64SFB: # %bb.0: # %entry
1207 ; RV64SFB-NEXT: bnez a2, .LBB28_2
1208 ; RV64SFB-NEXT: # %bb.1: # %entry
1209 ; RV64SFB-NEXT: slli a1, a0, 32
1210 ; RV64SFB-NEXT: .LBB28_2: # %entry
1211 ; RV64SFB-NEXT: mv a0, a1
1214 ; ZICOND-LABEL: select_slli:
1215 ; ZICOND: # %bb.0: # %entry
1216 ; ZICOND-NEXT: bnez a2, .LBB28_2
1217 ; ZICOND-NEXT: # %bb.1: # %entry
1218 ; ZICOND-NEXT: slli a1, a0, 32
1219 ; ZICOND-NEXT: .LBB28_2: # %entry
1220 ; ZICOND-NEXT: mv a0, a1
1223 ; RV32SFB-LABEL: select_slli:
1224 ; RV32SFB: # %bb.0: # %entry
1225 ; RV32SFB-NEXT: mv a1, a0
1226 ; RV32SFB-NEXT: bnez a4, .LBB28_2
1227 ; RV32SFB-NEXT: # %bb.1: # %entry
1228 ; RV32SFB-NEXT: li a2, 0
1229 ; RV32SFB-NEXT: .LBB28_2: # %entry
1230 ; RV32SFB-NEXT: mv a0, a2
1231 ; RV32SFB-NEXT: beqz a4, .LBB28_4
1232 ; RV32SFB-NEXT: # %bb.3: # %entry
1233 ; RV32SFB-NEXT: mv a1, a3
1234 ; RV32SFB-NEXT: .LBB28_4: # %entry
1238 %1 = select i1 %cond, i64 %C, i64 %0
1242 define i64 @select_srli(i64 %A, i64 %C, i1 zeroext %cond) {
1243 ; NOSFB-LABEL: select_srli:
1244 ; NOSFB: # %bb.0: # %entry
1245 ; NOSFB-NEXT: bnez a2, .LBB29_2
1246 ; NOSFB-NEXT: # %bb.1: # %entry
1247 ; NOSFB-NEXT: srli a1, a0, 35
1248 ; NOSFB-NEXT: .LBB29_2: # %entry
1249 ; NOSFB-NEXT: mv a0, a1
1252 ; RV64SFB-LABEL: select_srli:
1253 ; RV64SFB: # %bb.0: # %entry
1254 ; RV64SFB-NEXT: bnez a2, .LBB29_2
1255 ; RV64SFB-NEXT: # %bb.1: # %entry
1256 ; RV64SFB-NEXT: srli a1, a0, 35
1257 ; RV64SFB-NEXT: .LBB29_2: # %entry
1258 ; RV64SFB-NEXT: mv a0, a1
1261 ; ZICOND-LABEL: select_srli:
1262 ; ZICOND: # %bb.0: # %entry
1263 ; ZICOND-NEXT: bnez a2, .LBB29_2
1264 ; ZICOND-NEXT: # %bb.1: # %entry
1265 ; ZICOND-NEXT: srli a1, a0, 35
1266 ; ZICOND-NEXT: .LBB29_2: # %entry
1267 ; ZICOND-NEXT: mv a0, a1
1270 ; RV32SFB-LABEL: select_srli:
1271 ; RV32SFB: # %bb.0: # %entry
1272 ; RV32SFB-NEXT: mv a0, a2
1273 ; RV32SFB-NEXT: bnez a4, .LBB29_2
1274 ; RV32SFB-NEXT: # %bb.1: # %entry
1275 ; RV32SFB-NEXT: li a3, 0
1276 ; RV32SFB-NEXT: .LBB29_2: # %entry
1277 ; RV32SFB-NEXT: bnez a4, .LBB29_4
1278 ; RV32SFB-NEXT: # %bb.3: # %entry
1279 ; RV32SFB-NEXT: srli a0, a1, 3
1280 ; RV32SFB-NEXT: .LBB29_4: # %entry
1281 ; RV32SFB-NEXT: mv a1, a3
1284 %0 = lshr i64 %A, 35
1285 %1 = select i1 %cond, i64 %C, i64 %0
1289 define i64 @select_srai(i64 %A, i64 %C, i1 zeroext %cond) {
1290 ; NOSFB-LABEL: select_srai:
1291 ; NOSFB: # %bb.0: # %entry
1292 ; NOSFB-NEXT: bnez a2, .LBB30_2
1293 ; NOSFB-NEXT: # %bb.1: # %entry
1294 ; NOSFB-NEXT: srai a1, a0, 63
1295 ; NOSFB-NEXT: .LBB30_2: # %entry
1296 ; NOSFB-NEXT: mv a0, a1
1299 ; RV64SFB-LABEL: select_srai:
1300 ; RV64SFB: # %bb.0: # %entry
1301 ; RV64SFB-NEXT: bnez a2, .LBB30_2
1302 ; RV64SFB-NEXT: # %bb.1: # %entry
1303 ; RV64SFB-NEXT: srai a1, a0, 63
1304 ; RV64SFB-NEXT: .LBB30_2: # %entry
1305 ; RV64SFB-NEXT: mv a0, a1
1308 ; ZICOND-LABEL: select_srai:
1309 ; ZICOND: # %bb.0: # %entry
1310 ; ZICOND-NEXT: bnez a2, .LBB30_2
1311 ; ZICOND-NEXT: # %bb.1: # %entry
1312 ; ZICOND-NEXT: srai a1, a0, 63
1313 ; ZICOND-NEXT: .LBB30_2: # %entry
1314 ; ZICOND-NEXT: mv a0, a1
1317 ; RV32SFB-LABEL: select_srai:
1318 ; RV32SFB: # %bb.0: # %entry
1319 ; RV32SFB-NEXT: mv a0, a2
1320 ; RV32SFB-NEXT: srai a1, a1, 31
1321 ; RV32SFB-NEXT: bnez a4, .LBB30_2
1322 ; RV32SFB-NEXT: # %bb.1: # %entry
1323 ; RV32SFB-NEXT: mv a0, a1
1324 ; RV32SFB-NEXT: .LBB30_2: # %entry
1325 ; RV32SFB-NEXT: beqz a4, .LBB30_4
1326 ; RV32SFB-NEXT: # %bb.3: # %entry
1327 ; RV32SFB-NEXT: mv a1, a3
1328 ; RV32SFB-NEXT: .LBB30_4: # %entry
1331 %0 = ashr i64 %A, 63
1332 %1 = select i1 %cond, i64 %C, i64 %0
1336 define i32 @select_slliw(i32 %A, i32 %C, i1 zeroext %cond) {
1337 ; NOSFB-LABEL: select_slliw:
1338 ; NOSFB: # %bb.0: # %entry
1339 ; NOSFB-NEXT: bnez a2, .LBB31_2
1340 ; NOSFB-NEXT: # %bb.1: # %entry
1341 ; NOSFB-NEXT: slliw a1, a0, 3
1342 ; NOSFB-NEXT: .LBB31_2: # %entry
1343 ; NOSFB-NEXT: mv a0, a1
1346 ; RV64SFB-LABEL: select_slliw:
1347 ; RV64SFB: # %bb.0: # %entry
1348 ; RV64SFB-NEXT: bnez a2, .LBB31_2
1349 ; RV64SFB-NEXT: # %bb.1: # %entry
1350 ; RV64SFB-NEXT: slliw a1, a0, 3
1351 ; RV64SFB-NEXT: .LBB31_2: # %entry
1352 ; RV64SFB-NEXT: mv a0, a1
1355 ; ZICOND-LABEL: select_slliw:
1356 ; ZICOND: # %bb.0: # %entry
1357 ; ZICOND-NEXT: bnez a2, .LBB31_2
1358 ; ZICOND-NEXT: # %bb.1: # %entry
1359 ; ZICOND-NEXT: slliw a1, a0, 3
1360 ; ZICOND-NEXT: .LBB31_2: # %entry
1361 ; ZICOND-NEXT: mv a0, a1
1364 ; RV32SFB-LABEL: select_slliw:
1365 ; RV32SFB: # %bb.0: # %entry
1366 ; RV32SFB-NEXT: bnez a2, .LBB31_2
1367 ; RV32SFB-NEXT: # %bb.1: # %entry
1368 ; RV32SFB-NEXT: slli a1, a0, 3
1369 ; RV32SFB-NEXT: .LBB31_2: # %entry
1370 ; RV32SFB-NEXT: mv a0, a1
1374 %1 = select i1 %cond, i32 %C, i32 %0
1378 define i32 @select_srliw(i32 %A, i32 %C, i1 zeroext %cond) {
1379 ; NOSFB-LABEL: select_srliw:
1380 ; NOSFB: # %bb.0: # %entry
1381 ; NOSFB-NEXT: bnez a2, .LBB32_2
1382 ; NOSFB-NEXT: # %bb.1: # %entry
1383 ; NOSFB-NEXT: srliw a1, a0, 17
1384 ; NOSFB-NEXT: .LBB32_2: # %entry
1385 ; NOSFB-NEXT: mv a0, a1
1388 ; RV64SFB-LABEL: select_srliw:
1389 ; RV64SFB: # %bb.0: # %entry
1390 ; RV64SFB-NEXT: bnez a2, .LBB32_2
1391 ; RV64SFB-NEXT: # %bb.1: # %entry
1392 ; RV64SFB-NEXT: srliw a1, a0, 17
1393 ; RV64SFB-NEXT: .LBB32_2: # %entry
1394 ; RV64SFB-NEXT: mv a0, a1
1397 ; ZICOND-LABEL: select_srliw:
1398 ; ZICOND: # %bb.0: # %entry
1399 ; ZICOND-NEXT: bnez a2, .LBB32_2
1400 ; ZICOND-NEXT: # %bb.1: # %entry
1401 ; ZICOND-NEXT: srliw a1, a0, 17
1402 ; ZICOND-NEXT: .LBB32_2: # %entry
1403 ; ZICOND-NEXT: mv a0, a1
1406 ; RV32SFB-LABEL: select_srliw:
1407 ; RV32SFB: # %bb.0: # %entry
1408 ; RV32SFB-NEXT: bnez a2, .LBB32_2
1409 ; RV32SFB-NEXT: # %bb.1: # %entry
1410 ; RV32SFB-NEXT: srli a1, a0, 17
1411 ; RV32SFB-NEXT: .LBB32_2: # %entry
1412 ; RV32SFB-NEXT: mv a0, a1
1415 %0 = lshr i32 %A, 17
1416 %1 = select i1 %cond, i32 %C, i32 %0
1420 define i32 @select_sraiw(i32 %A, i32 %C, i1 zeroext %cond) {
1421 ; NOSFB-LABEL: select_sraiw:
1422 ; NOSFB: # %bb.0: # %entry
1423 ; NOSFB-NEXT: bnez a2, .LBB33_2
1424 ; NOSFB-NEXT: # %bb.1: # %entry
1425 ; NOSFB-NEXT: sraiw a1, a0, 31
1426 ; NOSFB-NEXT: .LBB33_2: # %entry
1427 ; NOSFB-NEXT: mv a0, a1
1430 ; RV64SFB-LABEL: select_sraiw:
1431 ; RV64SFB: # %bb.0: # %entry
1432 ; RV64SFB-NEXT: bnez a2, .LBB33_2
1433 ; RV64SFB-NEXT: # %bb.1: # %entry
1434 ; RV64SFB-NEXT: sraiw a1, a0, 31
1435 ; RV64SFB-NEXT: .LBB33_2: # %entry
1436 ; RV64SFB-NEXT: mv a0, a1
1439 ; ZICOND-LABEL: select_sraiw:
1440 ; ZICOND: # %bb.0: # %entry
1441 ; ZICOND-NEXT: bnez a2, .LBB33_2
1442 ; ZICOND-NEXT: # %bb.1: # %entry
1443 ; ZICOND-NEXT: sraiw a1, a0, 31
1444 ; ZICOND-NEXT: .LBB33_2: # %entry
1445 ; ZICOND-NEXT: mv a0, a1
1448 ; RV32SFB-LABEL: select_sraiw:
1449 ; RV32SFB: # %bb.0: # %entry
1450 ; RV32SFB-NEXT: bnez a2, .LBB33_2
1451 ; RV32SFB-NEXT: # %bb.1: # %entry
1452 ; RV32SFB-NEXT: srai a1, a0, 31
1453 ; RV32SFB-NEXT: .LBB33_2: # %entry
1454 ; RV32SFB-NEXT: mv a0, a1
1457 %0 = ashr i32 %A, 31
1458 %1 = select i1 %cond, i32 %C, i32 %0
1462 define signext i32 @abs_i32(i32 signext %x) {
1463 ; NOSFB-LABEL: abs_i32:
1465 ; NOSFB-NEXT: negw a1, a0
1466 ; NOSFB-NEXT: max a0, a0, a1
1469 ; RV64SFB-LABEL: abs_i32:
1471 ; RV64SFB-NEXT: bgez a0, .LBB34_2
1472 ; RV64SFB-NEXT: # %bb.1:
1473 ; RV64SFB-NEXT: negw a0, a0
1474 ; RV64SFB-NEXT: .LBB34_2:
1477 ; ZICOND-LABEL: abs_i32:
1479 ; ZICOND-NEXT: bgez a0, .LBB34_2
1480 ; ZICOND-NEXT: # %bb.1:
1481 ; ZICOND-NEXT: negw a0, a0
1482 ; ZICOND-NEXT: .LBB34_2:
1485 ; RV32SFB-LABEL: abs_i32:
1487 ; RV32SFB-NEXT: bgez a0, .LBB34_2
1488 ; RV32SFB-NEXT: # %bb.1:
1489 ; RV32SFB-NEXT: neg a0, a0
1490 ; RV32SFB-NEXT: .LBB34_2:
1492 %a = call i32 @llvm.abs.i32(i32 %x, i1 false)
1495 declare i32 @llvm.abs.i32(i32, i1)
1497 define i64 @abs_i64(i64 %x) {
1498 ; NOSFB-LABEL: abs_i64:
1500 ; NOSFB-NEXT: neg a1, a0
1501 ; NOSFB-NEXT: max a0, a0, a1
1504 ; RV64SFB-LABEL: abs_i64:
1506 ; RV64SFB-NEXT: bgez a0, .LBB35_2
1507 ; RV64SFB-NEXT: # %bb.1:
1508 ; RV64SFB-NEXT: neg a0, a0
1509 ; RV64SFB-NEXT: .LBB35_2:
1512 ; ZICOND-LABEL: abs_i64:
1514 ; ZICOND-NEXT: bgez a0, .LBB35_2
1515 ; ZICOND-NEXT: # %bb.1:
1516 ; ZICOND-NEXT: neg a0, a0
1517 ; ZICOND-NEXT: .LBB35_2:
1520 ; RV32SFB-LABEL: abs_i64:
1522 ; RV32SFB-NEXT: snez a2, a0
1523 ; RV32SFB-NEXT: add a2, a2, a1
1524 ; RV32SFB-NEXT: bgez a1, .LBB35_2
1525 ; RV32SFB-NEXT: # %bb.1:
1526 ; RV32SFB-NEXT: neg a0, a0
1527 ; RV32SFB-NEXT: .LBB35_2:
1528 ; RV32SFB-NEXT: bgez a1, .LBB35_4
1529 ; RV32SFB-NEXT: # %bb.3:
1530 ; RV32SFB-NEXT: neg a1, a2
1531 ; RV32SFB-NEXT: .LBB35_4:
1533 %a = call i64 @llvm.abs.i64(i64 %x, i1 false)
1536 declare i64 @llvm.abs.i64(i64, i1)
1538 define i64 @select_andn(i64 %A, i64 %B, i64 %C, i1 zeroext %cond) {
1539 ; NOSFB-LABEL: select_andn:
1540 ; NOSFB: # %bb.0: # %entry
1541 ; NOSFB-NEXT: bnez a3, .LBB36_2
1542 ; NOSFB-NEXT: # %bb.1: # %entry
1543 ; NOSFB-NEXT: andn a2, a0, a1
1544 ; NOSFB-NEXT: .LBB36_2: # %entry
1545 ; NOSFB-NEXT: mv a0, a2
1548 ; RV64SFB-LABEL: select_andn:
1549 ; RV64SFB: # %bb.0: # %entry
1550 ; RV64SFB-NEXT: bnez a3, .LBB36_2
1551 ; RV64SFB-NEXT: # %bb.1: # %entry
1552 ; RV64SFB-NEXT: andn a2, a0, a1
1553 ; RV64SFB-NEXT: .LBB36_2: # %entry
1554 ; RV64SFB-NEXT: mv a0, a2
1557 ; ZICOND-LABEL: select_andn:
1558 ; ZICOND: # %bb.0: # %entry
1559 ; ZICOND-NEXT: bnez a3, .LBB36_2
1560 ; ZICOND-NEXT: # %bb.1: # %entry
1561 ; ZICOND-NEXT: andn a2, a0, a1
1562 ; ZICOND-NEXT: .LBB36_2: # %entry
1563 ; ZICOND-NEXT: mv a0, a2
1566 ; RV32SFB-LABEL: select_andn:
1567 ; RV32SFB: # %bb.0: # %entry
1568 ; RV32SFB-NEXT: bnez a6, .LBB36_2
1569 ; RV32SFB-NEXT: # %bb.1: # %entry
1570 ; RV32SFB-NEXT: andn a5, a1, a3
1571 ; RV32SFB-NEXT: .LBB36_2: # %entry
1572 ; RV32SFB-NEXT: bnez a6, .LBB36_4
1573 ; RV32SFB-NEXT: # %bb.3: # %entry
1574 ; RV32SFB-NEXT: andn a4, a0, a2
1575 ; RV32SFB-NEXT: .LBB36_4: # %entry
1576 ; RV32SFB-NEXT: mv a0, a4
1577 ; RV32SFB-NEXT: mv a1, a5
1582 %2 = select i1 %cond, i64 %C, i64 %1
1586 define i64 @select_orn(i64 %A, i64 %B, i64 %C, i1 zeroext %cond) {
1587 ; NOSFB-LABEL: select_orn:
1588 ; NOSFB: # %bb.0: # %entry
1589 ; NOSFB-NEXT: bnez a3, .LBB37_2
1590 ; NOSFB-NEXT: # %bb.1: # %entry
1591 ; NOSFB-NEXT: orn a2, a0, a1
1592 ; NOSFB-NEXT: .LBB37_2: # %entry
1593 ; NOSFB-NEXT: mv a0, a2
1596 ; RV64SFB-LABEL: select_orn:
1597 ; RV64SFB: # %bb.0: # %entry
1598 ; RV64SFB-NEXT: bnez a3, .LBB37_2
1599 ; RV64SFB-NEXT: # %bb.1: # %entry
1600 ; RV64SFB-NEXT: orn a2, a0, a1
1601 ; RV64SFB-NEXT: .LBB37_2: # %entry
1602 ; RV64SFB-NEXT: mv a0, a2
1605 ; ZICOND-LABEL: select_orn:
1606 ; ZICOND: # %bb.0: # %entry
1607 ; ZICOND-NEXT: bnez a3, .LBB37_2
1608 ; ZICOND-NEXT: # %bb.1: # %entry
1609 ; ZICOND-NEXT: orn a2, a0, a1
1610 ; ZICOND-NEXT: .LBB37_2: # %entry
1611 ; ZICOND-NEXT: mv a0, a2
1614 ; RV32SFB-LABEL: select_orn:
1615 ; RV32SFB: # %bb.0: # %entry
1616 ; RV32SFB-NEXT: bnez a6, .LBB37_2
1617 ; RV32SFB-NEXT: # %bb.1: # %entry
1618 ; RV32SFB-NEXT: orn a5, a1, a3
1619 ; RV32SFB-NEXT: .LBB37_2: # %entry
1620 ; RV32SFB-NEXT: bnez a6, .LBB37_4
1621 ; RV32SFB-NEXT: # %bb.3: # %entry
1622 ; RV32SFB-NEXT: orn a4, a0, a2
1623 ; RV32SFB-NEXT: .LBB37_4: # %entry
1624 ; RV32SFB-NEXT: mv a0, a4
1625 ; RV32SFB-NEXT: mv a1, a5
1630 %2 = select i1 %cond, i64 %C, i64 %1
1634 define i64 @select_xnor(i64 %A, i64 %B, i64 %C, i1 zeroext %cond) {
1635 ; NOSFB-LABEL: select_xnor:
1636 ; NOSFB: # %bb.0: # %entry
1637 ; NOSFB-NEXT: bnez a3, .LBB38_2
1638 ; NOSFB-NEXT: # %bb.1: # %entry
1639 ; NOSFB-NEXT: xnor a2, a0, a1
1640 ; NOSFB-NEXT: .LBB38_2: # %entry
1641 ; NOSFB-NEXT: mv a0, a2
1644 ; RV64SFB-LABEL: select_xnor:
1645 ; RV64SFB: # %bb.0: # %entry
1646 ; RV64SFB-NEXT: bnez a3, .LBB38_2
1647 ; RV64SFB-NEXT: # %bb.1: # %entry
1648 ; RV64SFB-NEXT: xnor a2, a0, a1
1649 ; RV64SFB-NEXT: .LBB38_2: # %entry
1650 ; RV64SFB-NEXT: mv a0, a2
1653 ; ZICOND-LABEL: select_xnor:
1654 ; ZICOND: # %bb.0: # %entry
1655 ; ZICOND-NEXT: bnez a3, .LBB38_2
1656 ; ZICOND-NEXT: # %bb.1: # %entry
1657 ; ZICOND-NEXT: xnor a2, a0, a1
1658 ; ZICOND-NEXT: .LBB38_2: # %entry
1659 ; ZICOND-NEXT: mv a0, a2
1662 ; RV32SFB-LABEL: select_xnor:
1663 ; RV32SFB: # %bb.0: # %entry
1664 ; RV32SFB-NEXT: bnez a6, .LBB38_2
1665 ; RV32SFB-NEXT: # %bb.1: # %entry
1666 ; RV32SFB-NEXT: xnor a5, a1, a3
1667 ; RV32SFB-NEXT: .LBB38_2: # %entry
1668 ; RV32SFB-NEXT: bnez a6, .LBB38_4
1669 ; RV32SFB-NEXT: # %bb.3: # %entry
1670 ; RV32SFB-NEXT: xnor a4, a0, a2
1671 ; RV32SFB-NEXT: .LBB38_4: # %entry
1672 ; RV32SFB-NEXT: mv a0, a4
1673 ; RV32SFB-NEXT: mv a1, a5
1678 %2 = select i1 %cond, i64 %C, i64 %1