For most DPP instructions, the old operand stores the value that was in
the current lane before the DPP operation, and is tied to the
destination. For VOPC DPP, this is unnecessary and incorrect.
There appears to have been a latent bug related to D122737 with
SIInstrInfo::isOperandLegal. If you checked if a register operand was legal
when the InstructionDesc expected an immediate, it reported that is valid.
Its fix is necessary for and tested in this patch.
I guess we want to return "true" here for a case like COPY, where the source operand should be a register but has no defined RC, but "false" for operands that should be immediates. Can we distinguish these cases by looking at the OpInfo?
Having said that, I guess returning false is OK for now. It's more conservative, just prevents some folding, and in the D122737 test case that does not matter because the unfolded copy get optimized away by register allocation anyway.