================
@@ -914,16 +916,17 @@ bool SIPreEmitPeephole::run(MachineFunction &MF, 
MachineLoopInfo *LoopInfo) {
   for (MachineBasicBlock &MBB : MF) {
     // Unpack packed instructions overlapped by MFMAs. This allows the
     // compiler to co-issue unpacked instructions with MFMA
-    const TargetSchedModel &SchedModel = TII->getSchedModel();
     SetVector<MachineInstr *> InstrsToUnpack;
     for (auto &MI : make_early_inc_range(MBB.instrs())) {
-      if (!SIInstrInfo::isMFMA(MI))
+      // SGEMM/DGEMM hold every VALU back, so only XDL benefits.
+      if (!SIInstrInfo::isMFMA(MI) || !TII->isXDL(MI))
         continue;
-      const MCSchedClassDesc *SchedClassDesc =
-          SchedModel.resolveSchedClass(&MI);
-      uint16_t NumMFMACycles =
-          SchedModel.getWriteProcResBegin(SchedClassDesc)->ReleaseAtCycle;
-      collectUnpackingCandidates(MI, InstrsToUnpack, NumMFMACycles);
+      unsigned PackedCycle =
+          AMDGPU::getPackedVALUIssueCycle(MI, AMDGPU::V_PK_FMA_F32, *TII);
----------------
lijinpei-amd wrote:

Done. `getPackedVALUIssueCycle` now has an overload that takes 
`IsFMALike`/`IsDOTLike`, and the opcode version maps the opcode to those flags. 
The pass calls a new `getMaxPackedVALUIssueCycle`, next to 
`mapToUnpackedOpcode`, which asks for the FMA-like cycle because every opcode 
the pass unpacks is FMA-like.

https://github.com/llvm/llvm-project/pull/233721
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to