================
@@ -385,6 +385,58 @@ llvm::AMDGPU::CoExecInfo 
llvm::AMDGPU::getMFMACoExecInfo(unsigned Opcode) {
   }
 }
 
+static unsigned getMFMANumPasses(const MachineInstr &MFMA,
+                                 const SIInstrInfo &TII) {
+  unsigned NumPasses = TII.getRepeatRate(MFMA);
+  assert(NumPasses >= 2 && "MFMA has no pass count in the scheduling model");
+  return NumPasses;
+}
+
+static unsigned getMFMASrcSize(const MachineInstr &MFMA, AMDGPU::OpName Name,
+                               const SIInstrInfo &TII) {
+  unsigned Opc = MFMA.getOpcode();
+  return TII.getOpSize(Opc, AMDGPU::getNamedOperandIdx(Opc, Name));
+}
+
+unsigned llvm::AMDGPU::getVALUIssueCycle(const MachineInstr &MFMA,
+                                         const SIInstrInfo &TII) {
+  assert(TII.getSubtarget().hasGFX940Insts() && SIInstrInfo::isMFMA(MFMA) &&
+         "expected a gfx942 or gfx950 MFMA");
+  if (!TII.isXDL(MFMA))
+    return getMFMANumPasses(MFMA, TII) + 2;
+
+  // An XDL holds VALU off for one cycle per 16 bytes of its widest A/B source.
+  unsigned MaxSrcSize = std::max(getMFMASrcSize(MFMA, OpName::src0, TII),
+                                 getMFMASrcSize(MFMA, OpName::src1, TII));
+  return 1 + MaxSrcSize / 16;
----------------
akadutta wrote:

going from the comment above, this will return 2 if MFMASrcSize is 16. 
shouldn't it be 1 instead?

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