[PATCH] D134907: [LiveRangeEdit] Add a statistic variable for rematerialization

Guozhi Wei via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 29 14:08:20 PDT 2022


Carrot created this revision.
Carrot added reviewers: stoklund, arsenm.
Herald added subscribers: hiraditya, MatzeB.
Herald added a project: All.
Carrot requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

Add a statistic variable for rematerialization.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D134907

Files:
  llvm/lib/CodeGen/LiveRangeEdit.cpp


Index: llvm/lib/CodeGen/LiveRangeEdit.cpp
===================================================================
--- llvm/lib/CodeGen/LiveRangeEdit.cpp
+++ llvm/lib/CodeGen/LiveRangeEdit.cpp
@@ -24,9 +24,10 @@
 
 #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 rematerialization");
 
 void LiveRangeEdit::Delegate::anchor() { }
 
@@ -193,6 +194,8 @@
   // 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();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134907.464029.patch
Type: text/x-patch
Size: 1134 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220929/09f69f82/attachment.bin>


More information about the llvm-commits mailing list