[llvm] [AMDGPU] IGLP: Fixes for VMEM load detection and unsigned int handling (PR #135090)

Robert Imschweiler via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 12 12:15:31 PDT 2025


================
@@ -2079,6 +2083,9 @@ class MFMASmallGemmSingleWaveOpt final : public IGLPStrategy {
 static unsigned DSWCount = 0;
 static unsigned DSWWithPermCount = 0;
 static unsigned DSWWithSharedVMEMCount = 0;
+static void resetDSWCounters() {
+  DSWCount = DSWWithPermCount = DSWWithSharedVMEMCount = 0;
+}
----------------
ro-i wrote:

So you're saying that we should make `DSWCount`, `DSWWithPermCount` and `DSWWithSharedVMEMCount` static variables of `MFMASmallGemmSingleWaveOpt::applyIGLPStrategy()` because they are only used in that function?

However, this wouldn't work for these class-level static members, for example:
https://github.com/llvm/llvm-project/blob/ae0aa2dea2dee3af01326e5ff96ab436628f7e2b/llvm/lib/Target/AMDGPU/AMDGPUIGroupLP.cpp#L891-L914
Because e.g. `TransPipeCount` is used in `MFMAExpInterleaveOpt::applyIGLPStrategy()` as well as in `MFMAExpInterleaveOpt::analyzeDAG()`.  I mean, `MFMAExpInterleaveOpt` hasn't bothered me / the fuzzer (yet?) and maybe there is no problem, but we might as well fix it while we're at it... (?)

https://github.com/llvm/llvm-project/pull/135090


More information about the llvm-commits mailing list