Skip to content

Commit

Permalink
[LiveRangeEdit] Add a statistic variable for rematerialization
Browse files Browse the repository at this point in the history
Add a statistic variable for rematerialization.

Differential Revision: https://reviews.llvm.org/D134907
  • Loading branch information
weiguozhi committed Sep 30, 2022
1 parent 0caa9d4 commit feea3b9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions llvm/lib/CodeGen/LiveRangeEdit.cpp
Expand Up @@ -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() { }

Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit feea3b9

Please sign in to comment.