1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -mattr=+zbb -verify-machineinstrs < %s \
3 ; RUN: | FileCheck %s -check-prefix=RV32ZBB
5 declare i32 @llvm.riscv.orc.b.i32(i32)
7 define i32 @orcb(i32 %a) nounwind {
10 ; RV32ZBB-NEXT: orc.b a0, a0
12 %tmp = call i32 @llvm.riscv.orc.b.i32(i32 %a)
16 ; Second and+or are redundant with the first, make sure we remove it.
17 define i32 @orcb_knownbits(i32 %a) nounwind {
18 ; RV32ZBB-LABEL: orcb_knownbits:
20 ; RV32ZBB-NEXT: lui a1, 1044480
21 ; RV32ZBB-NEXT: and a0, a0, a1
22 ; RV32ZBB-NEXT: lui a1, 2048
23 ; RV32ZBB-NEXT: addi a1, a1, 1
24 ; RV32ZBB-NEXT: or a0, a0, a1
25 ; RV32ZBB-NEXT: orc.b a0, a0
27 %tmp = and i32 %a, 4278190080 ; 0xFF000000
28 %tmp2 = or i32 %tmp, 8388609 ; 0x800001
29 %tmp3 = call i32 @llvm.riscv.orc.b.i32(i32 %tmp2)
30 %tmp4 = and i32 %tmp3, 4278190080 ; 0xFF000000
31 %tmp5 = or i32 %tmp4, 16711935 ; 0xFF00FF