[llvm] [RISCV][NFC] Simplify Imm range checks (PR #170497)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 3 10:46:39 PST 2025
================
@@ -2898,13 +2898,13 @@ bool RISCVInstrInfo::verifyInstruction(const MachineInstr &MI,
Ok = isShiftedUInt<4, 1>(Imm);
break;
case RISCVOp::OPERAND_UIMM5_NONZERO:
- Ok = isUInt<5>(Imm) && (Imm != 0);
+ Ok = Imm >= 1 && Imm <= 31;
----------------
topperc wrote:
> How about I revert the isXXX && oneCond cases to leave only the plus1/minus1 changed?
That works for me.
https://github.com/llvm/llvm-project/pull/170497
More information about the llvm-commits
mailing list