[llvm] [AMDGPU] Guard RewriteMFMAFormStage recolor against unsafe def/use (PR #217396)

Romanov Vlad via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 11 06:44:51 PDT 2026


================
@@ -2433,15 +2445,11 @@ bool RewriteMFMAFormStage::initHeuristics(
   // Collect the candidate group, its members share AGPR-form operands
   // post-rewrite, so reaching defs feeding any member don't need bridge copy.
   SmallPtrSet<MachineInstr *, 16> RewriteSet;
-  DenseSet<Register> CandSrc2Regs;
   for (MachineBasicBlock &MBB : MF) {
     for (MachineInstr &MI : MBB) {
       if (!isRewriteCandidate(&MI))
         continue;
       RewriteSet.insert(&MI);
----------------
romanovvlad wrote:

Minor.
```suggestion
if (isRewriteCandidate(&MI))
  RewriteSet.insert(&MI);
```

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


More information about the llvm-commits mailing list