================
@@ -371,6 +371,25 @@ inline CoExecInfo CoExecInfo::build(unsigned UnitOccupancy,
/// Get co-execution info for a gfx950 MFMA instruction.
CoExecInfo getMFMACoExecInfo(unsigned Opcode);
+/// Get the first cycle, counted from \p MFMA issuing at cycle 0, at which a
+/// VALU can issue on gfx942 (MI300X, or MI308X with the peak TOPS limiter
+/// enabled) or on gfx950. With the limiter disabled, MI308X holds VALU until
+/// an XDL's passes end. A scaled MFMA is assumed to issue behind another MFMA;
+/// issued into an idle MFMA pipe, it takes one more cycle.
+unsigned getVALUIssueCycle(const MachineInstr &MFMA, const SIInstrInfo &TII);
+
+/// Same as getVALUIssueCycle, for a packed VALU or a DOT with opcode
+/// \p PackedVALUOpc.
+unsigned getPackedVALUIssueCycle(const MachineInstr &MFMA,
+ unsigned PackedVALUOpc,
+ const SIInstrInfo &TII);
+
+/// Same as getVALUIssueCycle, for a packed VALU that is FMA-like
+/// (V_PK_{ADD,FMA,MUL}_F32 or V_PK_MOV_B32) if \p IsFMALike, or for a DOT if
+/// \p IsDOTLike.
+unsigned getPackedVALUIssueCycle(const MachineInstr &MFMA, bool IsFMALike,
----------------
lijinpei-amd wrote:
Agreed, the three entry points are an artifact of how SIPreEmitPeephole uses
them, not of the model. The bool overload only exists because the pass asks for
the window before it has a specific candidate, and every opcode it unpacks is
PK_F32 (`v_pk_{fma,mul,add}_f32`, `v_pk_mov_b32`), so it can just pass that
opcode. I'll collapse them into a single query, roughly `unsigned
getCoIssueCycle(const MachineInstr &MFMA, unsigned Opc)`. Where the data behind
it should live is under discussion in the top-level review thread.
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