[llvm] feea3b9 - [LiveRangeEdit] Add a statistic variable for rematerialization

Guozhi Wei via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 30 12:41:26 PDT 2022


Author: Guozhi Wei
Date: 2022-09-30T19:39:51Z
New Revision: feea3b990e2ba3b4c687402dd30b92595b90d084

URL: https://github.com/llvm/llvm-project/commit/feea3b990e2ba3b4c687402dd30b92595b90d084
DIFF: https://github.com/llvm/llvm-project/commit/feea3b990e2ba3b4c687402dd30b92595b90d084.diff

LOG: [LiveRangeEdit] Add a statistic variable for rematerialization

Add a statistic variable for rematerialization.

Differential Revision: https://reviews.llvm.org/D134907

Added: 
    

Modified: 
    llvm/lib/CodeGen/LiveRangeEdit.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/LiveRangeEdit.cpp b/llvm/lib/CodeGen/LiveRangeEdit.cpp
index c955c582059c..afc04f0045c2 100644
--- a/llvm/lib/CodeGen/LiveRangeEdit.cpp
+++ b/llvm/lib/CodeGen/LiveRangeEdit.cpp
@@ -24,9 +24,10 @@ using namespace llvm;
 
 #define DEBUG_TYPE "regalloc"
 
-STATISTIC(NumDCEDeleted,     "Number of instructions deleted by DCE");
-STATISTIC(NumDCEFoldedLoads, "Number of single use loads folded after DCE");
-STATISTIC(NumFracRanges,     "Number of live ranges fractured by DCE");
+STATISTIC(NumDCEDeleted,        "Number of instructions deleted by DCE");
+STATISTIC(NumDCEFoldedLoads,    "Number of single use loads folded after DCE");
+STATISTIC(NumFracRanges,        "Number of live ranges fractured by DCE");
+STATISTIC(NumReMaterialization, "Number of instructions rematerialized");
 
 void LiveRangeEdit::Delegate::anchor() { }
 
@@ -193,6 +194,8 @@ SlotIndex LiveRangeEdit::rematerializeAt(MachineBasicBlock &MBB,
   // is true.
   (*--MI).getOperand(0).setIsDead(false);
   Rematted.insert(RM.ParentVNI);
+  ++NumReMaterialization;
+
   if (ReplaceIndexMI)
     return LIS.ReplaceMachineInstrInMaps(*ReplaceIndexMI, *MI).getRegSlot();
   return LIS.getSlotIndexes()->insertMachineInstrInMaps(*MI, Late).getRegSlot();


        


More information about the llvm-commits mailing list