[llvm] unpack packed instructions overlapped by MFMAs post-RA scheduling (PR #157968)
    Jeffrey Byrnes via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Wed Sep 17 12:28:01 PDT 2025
    
    
  
================
@@ -39,6 +47,37 @@ class SIPreEmitPeephole {
                              const MachineBasicBlock &From,
                              const MachineBasicBlock &To) const;
   bool removeExeczBranch(MachineInstr &MI, MachineBasicBlock &SrcMBB);
+  // Check if the machine instruction being processed is a supported packed
+  // instruction
+  bool isUnpackingSupportedInstr(MachineInstr &MI) const;
+  // Creates a list of packed instructions following an MFMA that are suitable
+  // for unpacking.
+  void collectUnpackingCandidates(MachineInstr &BeginMI,
+                                  SetVector<MachineInstr *> &InstrsToUnpack,
+                                  uint16_t NumMFMACycles);
+  // v_pk_fma_f32 v[0:1], v[0:1], v[2:3], v[2:3] op_sel:[1,1,1]
+  // op_sel_hi:[0,0,0]
+  // ==>
+  // v_fma_f32 v0, v1, v3, v3
+  // v_fma_f32 v1, v0, v2, v2
+  // here, we have overwritten v0 before we use it. This function checks if
+  // unpacking can lead to such a situation
----------------
jrbyrnes wrote:
```suggestion
  // unpacking can lead to such a situation.
```
https://github.com/llvm/llvm-project/pull/157968
    
    
More information about the llvm-commits
mailing list