[llvm] [RISCV][NFC] Simplify Imm range checks (PR #170497)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 3 09:14:03 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:
The original code was a direct translation of the name. So that seems a little clearer to me.
https://github.com/llvm/llvm-project/pull/170497
More information about the llvm-commits
mailing list