diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp b/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp index 795dc04587a14..a98bd5acf8961 100644 --- a/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp +++ b/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp @@ -1127,8 +1127,7 @@ RISCVInstrInfo::isCopyInstrImpl(const MachineInstr &MI) const { bool RISCVInstrInfo::verifyInstruction(const MachineInstr &MI, StringRef &ErrInfo) const { - const MCInstrInfo *MCII = STI.getInstrInfo(); - MCInstrDesc const &Desc = MCII->get(MI.getOpcode()); + MCInstrDesc const &Desc = MI.getDesc(); for (auto &OI : enumerate(Desc.operands())) { unsigned OpType = OI.value().OperandType; @@ -1195,17 +1194,14 @@ bool RISCVInstrInfo::verifyInstruction(const MachineInstr &MI, Ok = isShiftedInt<7, 5>(Imm); break; case RISCVOp::OPERAND_UIMMLOG2XLEN: - Ok = STI.getTargetTriple().isArch64Bit() ? isUInt<6>(Imm) - : isUInt<5>(Imm); + Ok = STI.is64Bit() ? isUInt<6>(Imm) : isUInt<5>(Imm); break; case RISCVOp::OPERAND_UIMMLOG2XLEN_NONZERO: - Ok = STI.getTargetTriple().isArch64Bit() ? isUInt<6>(Imm) - : isUInt<5>(Imm); + Ok = STI.is64Bit() ? isUInt<6>(Imm) : isUInt<5>(Imm); Ok = Ok && Imm != 0; break; case RISCVOp::OPERAND_UIMM_SHFL: - Ok = STI.getTargetTriple().isArch64Bit() ? isUInt<5>(Imm) - : isUInt<4>(Imm); + Ok = STI.is64Bit() ? isUInt<5>(Imm) : isUInt<4>(Imm); break; case RISCVOp::OPERAND_RVKRNUM: Ok = Imm >= 0 && Imm <= 10;