When folding a COPY of exec into another COPY, the call to
TII->isOperandLegal would crash because COPYs don't have defined
register classes for their operands.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp | ||
---|---|---|
425 ↗ | (On Diff #419162) | I was wondering about that. How do all the existing callers of isOperandLegal manage not to hit this assertion? llc: lib/Target/AMDGPU/SIInstrInfo.cpp:5013: bool llvm::SIInstrInfo::isOperandLegal(const llvm::MachineInstr &, unsigned int, const llvm::MachineOperand *) const: Assertion `DefinedRC' failed. |
llvm/lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp | ||
---|---|---|
425 ↗ | (On Diff #419162) | In fact, the operand always legal in COPY. So, SIInstrInfo::isOperandLegal may just return true for the case where no defined RC and the instruction opcode is COPY |
Comment Actions
LGTM if we do not want to change the COPY processing in the SIInstrInfo::isOperandLegal
Comment Actions
How about this? As @arsenm pointed out this can happen for other instructions, not just COPY, so I handle them all the same way.