[llvm] [RISCV] Don't convert virtual register Register to MCRegister in isCompressibleInst. (PR #122843)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 13 19:31:28 PST 2025
================
@@ -773,13 +773,18 @@ void CompressInstEmitter::emitCompressInstEmitter(raw_ostream &OS,
// This is a register operand. Check the register class.
// Don't check register class if this is a tied operand, it was done
// for the operand its tied to.
- if (DestOperand.getTiedRegister() == -1)
+ if (DestOperand.getTiedRegister() == -1) {
CondStream.indent(6)
- << "(MI.getOperand(" << OpIdx << ").isReg()) &&\n"
- << " (" << TargetName << "MCRegisterClasses[" << TargetName
+ << "MI.getOperand(" << OpIdx << ").isReg()";
+ if (EType == EmitterType::CheckCompress)
+ CondStream
+ << " && MI.getOperand(" << OpIdx << ").getReg().isPhysical()";
----------------
topperc wrote:
We don't have a test for isCompressibleInst. The only .td test if is for compressInst which operates on MCInst so its natively MCRegister, and MCRegister doesn't have isPhysical().
https://github.com/llvm/llvm-project/pull/122843
More information about the llvm-commits
mailing list