[llvm] [RISCV] SFB with Immediates to QC.MVccI (PR #186555)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 6 07:19:54 PDT 2026


================
@@ -15,10 +15,7 @@ define i32 @branch_with_immSFB_mv(i32 %a, i32 %c, i32 %d) {
 ;
 ; RV32I-SFB-WITH-IMM-LABEL: branch_with_immSFB_mv:
 ; RV32I-SFB-WITH-IMM:       # %bb.0: # %entry
-; RV32I-SFB-WITH-IMM-NEXT:    qc.beqi a2, 2, .LBB0_2
-; RV32I-SFB-WITH-IMM-NEXT:  # %bb.1: # %entry
-; RV32I-SFB-WITH-IMM-NEXT:    mv a0, a1
-; RV32I-SFB-WITH-IMM-NEXT:  .LBB0_2: # %entry
+; RV32I-SFB-WITH-IMM-NEXT:    qc.mveqi a0, a2, 2, a1
----------------
nikic wrote:

Shouldn't this be mvnei (and similar for others)?

If I understand correctly, what this instruction does is:
```
if (d == 2) {
  a = c;
}
```
Which is the opposite of what the select does.

https://github.com/llvm/llvm-project/pull/186555


More information about the llvm-commits mailing list