Skip to content

Commit ce8d2ec

Browse files
committed
AMDGPU: Add statistic for number of MFMAs moved to AGPR form
1 parent 2a2778f commit ce8d2ec

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

llvm/lib/Target/AMDGPU/AMDGPURewriteAGPRCopyMFMA.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "GCNSubtarget.h"
2727
#include "SIMachineFunctionInfo.h"
2828
#include "SIRegisterInfo.h"
29+
#include "llvm/ADT/Statistic.h"
2930
#include "llvm/CodeGen/LiveIntervals.h"
3031
#include "llvm/CodeGen/LiveRegMatrix.h"
3132
#include "llvm/CodeGen/MachineFunctionPass.h"
@@ -38,6 +39,9 @@ using namespace llvm;
3839

3940
namespace {
4041

42+
STATISTIC(NumMFMAsRewrittenToAGPR,
43+
"Number of MFMA instructions rewritten to use AGPR form");
44+
4145
class AMDGPURewriteAGPRCopyMFMAImpl {
4246
MachineFunction &MF;
4347
const GCNSubtarget &ST;
@@ -263,6 +267,7 @@ bool AMDGPURewriteAGPRCopyMFMAImpl::tryReassigningMFMAChain(
263267
int NewMFMAOp =
264268
AMDGPU::getMFMASrcCVDstAGPROp(RewriteCandidate->getOpcode());
265269
RewriteCandidate->setDesc(TII.get(NewMFMAOp));
270+
++NumMFMAsRewrittenToAGPR;
266271
}
267272

268273
return true;

0 commit comments

Comments
 (0)