[AMDGPU] SIWholeQuadMode: don't add duplicate implicit $exec operands

STRICT_WWM and STRICT_WQM are already defined with Uses = [EXEC], so
there is no need to add another implicit use of $exec when lowering them
to V_MOV_B32 instructions.

Differential Revision: https://reviews.llvm.org/D100969
This commit is contained in:
Jay Foad 2021-04-21 17:38:32 +01:00
parent 740962e5d0
commit 79cb3ba08f
1 changed files with 5 additions and 2 deletions

View File

@ -1436,8 +1436,11 @@ void SIWholeQuadMode::lowerCopyInstrs() {
const unsigned MovOp = TII->getMovOpcode(regClass);
MI->setDesc(TII->get(MovOp));
// And make it implicitly depend on exec (like all VALU movs should do).
MI->addOperand(MachineOperand::CreateReg(AMDGPU::EXEC, false, true));
// Check that it already implicitly depends on exec (like all VALU movs
// should do).
assert(any_of(MI->implicit_operands(), [](const MachineOperand &MO) {
return MO.isUse() && MO.getReg() == AMDGPU::EXEC;
}));
} else {
// Remove early-clobber and exec dependency from simple SGPR copies.
// This allows some to be eliminated during/post RA.