[NFC] Add the stats for load/store cluster
authorQingShan Zhang <qshanz@cn.ibm.com>
Fri, 7 Aug 2020 07:09:48 +0000 (07:09 +0000)
committerQingShan Zhang <qshanz@cn.ibm.com>
Fri, 7 Aug 2020 07:09:48 +0000 (07:09 +0000)
We have the stats for MacroFusion but miss it for load/store cluster.

llvm/lib/CodeGen/MachineScheduler.cpp

index fe4ceb2..a8ccf26 100644 (file)
@@ -18,6 +18,7 @@
 #include "llvm/ADT/PriorityQueue.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/Statistic.h"
 #include "llvm/ADT/iterator_range.h"
 #include "llvm/Analysis/AliasAnalysis.h"
 #include "llvm/CodeGen/LiveInterval.h"
@@ -73,6 +74,8 @@ using namespace llvm;
 
 #define DEBUG_TYPE "machine-scheduler"
 
+STATISTIC(NumClustered, "Number of load/store pairs clustered");
+
 namespace llvm {
 
 cl::opt<bool> ForceTopDown("misched-topdown", cl::Hidden,
@@ -1623,6 +1626,7 @@ void BaseMemOpClusterMutation::clusterNeighboringMemOps(
 
     LLVM_DEBUG(dbgs() << "Cluster ld/st SU(" << SUa->NodeNum << ") - SU("
                       << SUb->NodeNum << ")\n");
+    ++NumClustered;
 
     if (IsLoad) {
       // Copy successor edges from SUa to SUb. Interleaving computation