diff options
author | Cameron Zwarich <zwarich@apple.com> | 2011-02-14 02:09:18 +0000 |
---|---|---|
committer | Cameron Zwarich <zwarich@apple.com> | 2011-02-14 02:09:18 +0000 |
commit | 1a73cedca0a83d64149ee03577991a196338a9c5 (patch) | |
tree | 5847e9edfa4a2087291bb6976cd0da67b3b7cc92 | |
parent | 117be03cc6cfb91d385938ed94a3cf877bd8c12a (diff) | |
download | external_llvm-1a73cedca0a83d64149ee03577991a196338a9c5.zip external_llvm-1a73cedca0a83d64149ee03577991a196338a9c5.tar.gz external_llvm-1a73cedca0a83d64149ee03577991a196338a9c5.tar.bz2 |
Add some statistics to StrongPHIElimination.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125477 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/StrongPHIElimination.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/CodeGen/StrongPHIElimination.cpp b/lib/CodeGen/StrongPHIElimination.cpp index 17bd2cf..ec7829e 100644 --- a/lib/CodeGen/StrongPHIElimination.cpp +++ b/lib/CodeGen/StrongPHIElimination.cpp @@ -47,6 +47,7 @@ #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineRegisterInfo.h" #include "llvm/Target/TargetInstrInfo.h" +#include "llvm/ADT/Statistic.h" #include "llvm/Support/Debug.h" using namespace llvm; @@ -187,6 +188,10 @@ namespace { }; } // namespace +STATISTIC(NumPHIsLowered, "Number of PHIs lowered"); +STATISTIC(NumDestCopiesInserted, "Number of destination copies inserted"); +STATISTIC(NumSrcCopiesInserted, "Number of source copies inserted"); + char StrongPHIElimination::ID = 0; INITIALIZE_PASS_BEGIN(StrongPHIElimination, "strong-phi-node-elimination", "Eliminate PHI nodes for register allocation, intelligently", false, false) @@ -645,6 +650,7 @@ StrongPHIElimination::SplitInterferencesForBasicBlock( void StrongPHIElimination::InsertCopiesForPHI(MachineInstr *PHI, MachineBasicBlock *MBB) { assert(PHI->isPHI()); + ++NumPHIsLowered; unsigned PHIColor = getPHIColor(PHI); for (unsigned i = 1; i < PHI->getNumOperands(); i += 2) { @@ -694,6 +700,7 @@ void StrongPHIElimination::InsertCopiesForPHI(MachineInstr *PHI, TII->get(TargetOpcode::COPY), CopyReg).addReg(SrcReg, 0, SrcSubReg); LI->InsertMachineInstrInMaps(CopyInstr); + ++NumSrcCopiesInserted; // addLiveRangeToEndOfBlock() also adds the phikill flag to the VNInfo for // the newly added range. @@ -763,6 +770,7 @@ void StrongPHIElimination::InsertCopiesForPHI(MachineInstr *PHI, DestReg).addReg(CopyReg); LI->InsertMachineInstrInMaps(CopyInstr); PHI->getOperand(0).setReg(CopyReg); + ++NumDestCopiesInserted; // Add the region from the beginning of MBB to the copy instruction to // CopyReg's live interval, and give the VNInfo the phidef flag. |