Skip to content

Commit 59216f2

Browse files
toppercHoney Goyal
authored andcommitted
[RISCV] Correct the register class for the VL op check in RISCVInstrInfo::verifyInstruction. (llvm#170751)
The VL operand cannot be X0. We represent VLMAX with -1.
1 parent 33ba791 commit 59216f2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Target/RISCV/RISCVInstrInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3063,7 +3063,7 @@ bool RISCVInstrInfo::verifyInstruction(const MachineInstr &MI,
30633063
if (Op.isReg() && Op.getReg().isValid()) {
30643064
const MachineRegisterInfo &MRI = MI.getParent()->getParent()->getRegInfo();
30653065
auto *RC = MRI.getRegClass(Op.getReg());
3066-
if (!RISCV::GPRRegClass.hasSubClassEq(RC)) {
3066+
if (!RISCV::GPRNoX0RegClass.hasSubClassEq(RC)) {
30673067
ErrInfo = "Invalid register class for VL operand";
30683068
return false;
30693069
}

0 commit comments

Comments
 (0)