[llvm] [AMDGPU] Make dead SGPR to not depend on exec in `isIgnorableUse` (PR #218942)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 26 08:12:31 PDT 2026


================
@@ -267,10 +267,10 @@ bool SIInstrInfo::resultDependsOnExec(const MachineInstr &MI) const {
   if (MI.isConvergent())
     return true;
 
-  // If it defines SGPR it depends on EXEC
+  // If it defines an SGPR it depends on EXEC, unless it's dead.
   const MachineRegisterInfo &MRI = MI.getMF()->getRegInfo();
   for (const MachineOperand &Def : MI.defs()) {
-    if (!Def.isReg())
+    if (!Def.isReg() || Def.isDead())
----------------
jayfoad wrote:

All `defs` are registers so you can remove that part of the check.

https://github.com/llvm/llvm-project/pull/218942


More information about the llvm-commits mailing list