[llvm] 79cb3ba - [AMDGPU] SIWholeQuadMode: don't add duplicate implicit $exec operands
Jay Foad via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 22 01:19:54 PDT 2021
Author: Jay Foad
Date: 2021-04-22T09:19:47+01:00
New Revision: 79cb3ba08f8022ad1bb664bb0d0cd3cfe5111001
URL: https://github.com/llvm/llvm-project/commit/79cb3ba08f8022ad1bb664bb0d0cd3cfe5111001
DIFF: https://github.com/llvm/llvm-project/commit/79cb3ba08f8022ad1bb664bb0d0cd3cfe5111001.diff
LOG: [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
Added:
Modified:
llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp b/llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp
index ac9a504520e7..51a019bb9d2a 100644
--- a/llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp
+++ b/llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp
@@ -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.
More information about the llvm-commits
mailing list