[llvm] [AMDGPU] Account for existing SDWA selections (PR #123221)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 26 01:11:11 PST 2025


================
@@ -372,7 +416,9 @@ MachineInstr *SDWASrcOperand::potentialToConvert(const SIInstrInfo *TII,
   if (!PotentialMO)
     return nullptr;
 
-  return PotentialMO->getParent();
+  auto parent = PotentialMO->getParent();
+
+  return canCombineSelections(*parent, TII) ? parent : nullptr;
----------------
arsenm wrote:

```suggestion
  MachineInstr *Parent = PotentialMO->getParent();

  return canCombineSelections(*Parent, TII) ? Parent : nullptr;
```

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


More information about the llvm-commits mailing list