Skip to content

Conversation

@arsenm
Copy link
Contributor

@arsenm arsenm commented Aug 11, 2025

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Aug 11, 2025

@llvm/pr-subscribers-backend-amdgpu

Author: Matt Arsenault (arsenm)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/153024.diff

1 Files Affected:

  • (modified) llvm/lib/Target/AMDGPU/AMDGPURewriteAGPRCopyMFMA.cpp (+5)
diff --git a/llvm/lib/Target/AMDGPU/AMDGPURewriteAGPRCopyMFMA.cpp b/llvm/lib/Target/AMDGPU/AMDGPURewriteAGPRCopyMFMA.cpp
index b71c70db5e6b3..c4a370225b606 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPURewriteAGPRCopyMFMA.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPURewriteAGPRCopyMFMA.cpp
@@ -26,6 +26,7 @@
 #include "GCNSubtarget.h"
 #include "SIMachineFunctionInfo.h"
 #include "SIRegisterInfo.h"
+#include "llvm/ADT/Statistic.h"
 #include "llvm/CodeGen/LiveIntervals.h"
 #include "llvm/CodeGen/LiveRegMatrix.h"
 #include "llvm/CodeGen/MachineFunctionPass.h"
@@ -38,6 +39,9 @@ using namespace llvm;
 
 namespace {
 
+STATISTIC(NumMFMAsRewrittenToAGPR,
+          "Number of MFMA instructions rewritten to use AGPR form");
+
 class AMDGPURewriteAGPRCopyMFMAImpl {
   MachineFunction &MF;
   const GCNSubtarget &ST;
@@ -261,6 +265,7 @@ bool AMDGPURewriteAGPRCopyMFMAImpl::tryReassigningMFMAChain(
     int NewMFMAOp =
         AMDGPU::getMFMASrcCVDstAGPROp(RewriteCandidate->getOpcode());
     RewriteCandidate->setDesc(TII.get(NewMFMAOp));
+    ++NumMFMAsRewrittenToAGPR;
   }
 
   return true;

@arsenm arsenm force-pushed the users/arsenm/amdgpu/handle-mfma-copy-from-agpr branch from 431cefa to 5d234cc Compare August 12, 2025 01:30
@arsenm arsenm force-pushed the users/arsenm/amdgpu/add-statistic-number-mfmas-moved-to-agpr branch from 0dff243 to 2303793 Compare August 12, 2025 01:30
@arsenm arsenm force-pushed the users/arsenm/amdgpu/add-statistic-number-mfmas-moved-to-agpr branch from 2303793 to d00e587 Compare August 18, 2025 15:31
@arsenm arsenm force-pushed the users/arsenm/amdgpu/handle-mfma-copy-from-agpr branch from 5d234cc to 002114a Compare August 18, 2025 15:31
@arsenm arsenm force-pushed the users/arsenm/amdgpu/handle-mfma-copy-from-agpr branch from 002114a to 87bc565 Compare August 20, 2025 23:23
@arsenm arsenm force-pushed the users/arsenm/amdgpu/add-statistic-number-mfmas-moved-to-agpr branch 2 times, most recently from 09fa401 to ef009cc Compare August 21, 2025 00:11
@arsenm arsenm force-pushed the users/arsenm/amdgpu/handle-mfma-copy-from-agpr branch from 87bc565 to 8a87d16 Compare August 21, 2025 00:11
@arsenm arsenm force-pushed the users/arsenm/amdgpu/add-statistic-number-mfmas-moved-to-agpr branch from ef009cc to ce8d2ec Compare August 21, 2025 00:42
@arsenm arsenm force-pushed the users/arsenm/amdgpu/handle-mfma-copy-from-agpr branch from 8a87d16 to 2a2778f Compare August 21, 2025 00:42
@arsenm arsenm force-pushed the users/arsenm/amdgpu/add-statistic-number-mfmas-moved-to-agpr branch from ce8d2ec to eb8a599 Compare August 21, 2025 01:41
@arsenm arsenm force-pushed the users/arsenm/amdgpu/handle-mfma-copy-from-agpr branch from 2a2778f to f2932c5 Compare August 21, 2025 01:41
@arsenm arsenm force-pushed the users/arsenm/amdgpu/add-statistic-number-mfmas-moved-to-agpr branch from eb8a599 to e9fb980 Compare August 21, 2025 13:43
@arsenm arsenm force-pushed the users/arsenm/amdgpu/handle-mfma-copy-from-agpr branch 2 times, most recently from 5d8dc9b to 968135b Compare August 28, 2025 04:15
@arsenm arsenm force-pushed the users/arsenm/amdgpu/add-statistic-number-mfmas-moved-to-agpr branch from e9fb980 to 0395cea Compare August 28, 2025 04:15
Base automatically changed from users/arsenm/amdgpu/handle-mfma-copy-from-agpr to main September 3, 2025 05:12
@arsenm arsenm force-pushed the users/arsenm/amdgpu/add-statistic-number-mfmas-moved-to-agpr branch from 0395cea to 0abc8f3 Compare September 3, 2025 05:14
@arsenm arsenm enabled auto-merge (squash) September 3, 2025 05:16
@arsenm arsenm merged commit fdede21 into main Sep 3, 2025
9 checks passed
@arsenm arsenm deleted the users/arsenm/amdgpu/add-statistic-number-mfmas-moved-to-agpr branch September 3, 2025 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants