diff options
| author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-02-17 22:53:48 +0000 |
|---|---|---|
| committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-02-17 22:53:48 +0000 |
| commit | 99827e861f8b2407778154ab582bdcd9bb88ead0 (patch) | |
| tree | a287159fc73ab9cd77df65c0191fc094cdb0c324 /llvm/lib/CodeGen/RegAllocBasic.cpp | |
| parent | 34dd9ba9c76a7558521435e2933b79a370eb3ccc (diff) | |
| download | bcm5719-llvm-99827e861f8b2407778154ab582bdcd9bb88ead0.tar.gz bcm5719-llvm-99827e861f8b2407778154ab582bdcd9bb88ead0.zip | |
Add basic register allocator statistics.
llvm-svn: 125789
Diffstat (limited to 'llvm/lib/CodeGen/RegAllocBasic.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/RegAllocBasic.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/RegAllocBasic.cpp b/llvm/lib/CodeGen/RegAllocBasic.cpp index 7fbb035ed61..c0d4d8146a8 100644 --- a/llvm/lib/CodeGen/RegAllocBasic.cpp +++ b/llvm/lib/CodeGen/RegAllocBasic.cpp @@ -20,6 +20,7 @@ #include "VirtRegMap.h" #include "VirtRegRewriter.h" #include "llvm/ADT/OwningPtr.h" +#include "llvm/ADT/Statistic.h" #include "llvm/Analysis/AliasAnalysis.h" #include "llvm/Function.h" #include "llvm/PassAnalysisSupport.h" @@ -48,6 +49,10 @@ using namespace llvm; +STATISTIC(NumAssigned , "Number of registers assigned"); +STATISTIC(NumUnassigned , "Number of registers unassigned"); +STATISTIC(NumNewQueued , "Number of new live ranges queued"); + static RegisterRegAlloc basicRegAlloc("basic", "basic register allocator", createBasicRegisterAllocator); @@ -242,12 +247,14 @@ void RegAllocBase::assign(LiveInterval &VirtReg, unsigned PhysReg) { assert(!VRM->hasPhys(VirtReg.reg) && "Duplicate VirtReg assignment"); VRM->assignVirt2Phys(VirtReg.reg, PhysReg); PhysReg2LiveUnion[PhysReg].unify(VirtReg); + ++NumAssigned; } void RegAllocBase::unassign(LiveInterval &VirtReg, unsigned PhysReg) { assert(VRM->getPhys(VirtReg.reg) == PhysReg && "Inconsistent unassign"); PhysReg2LiveUnion[PhysReg].extract(VirtReg); VRM->clearVirt(VirtReg.reg); + ++NumUnassigned; } // Top-level driver to manage the queue of unassigned VirtRegs and call the @@ -287,6 +294,7 @@ void RegAllocBase::allocatePhysRegs() { "expect split value in virtual register"); VirtRegQ.push(std::make_pair(getPriority(SplitVirtReg), SplitVirtReg->reg)); + ++NumNewQueued; } } } |

