[llvm-branch-commits] [llvm] [AMDGPU] Fix the packed F32 unpack window in SIPreEmitPeephole (PR #233721)
Shilei Tian via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Nov 2 20:14:00 PST 2026
================
@@ -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,
----------------
shiltian wrote:
These interfaces are not well designed. They are too ad-hoc. Why do we even need two or three functions just to figure out at which cycle an instruction can be co-issued with a MFMA instruction, one of which has two bool to indicate whether it is FMA or DOT like? We can definitely do a better job here.
https://github.com/llvm/llvm-project/pull/233721
More information about the llvm-branch-commits
mailing list