Add number of spilled registers statistic.

llvm-svn: 11759
This commit is contained in:
Alkis Evlogimenos 2004-02-23 18:45:32 +00:00
parent 91a7dc0a6e
commit 52de9e214c
1 changed files with 2 additions and 0 deletions

View File

@ -34,6 +34,7 @@ using namespace llvm;
namespace { namespace {
Statistic<> numStores("ra-linearscan", "Number of stores added"); Statistic<> numStores("ra-linearscan", "Number of stores added");
Statistic<> numLoads ("ra-linearscan", "Number of loads added"); Statistic<> numLoads ("ra-linearscan", "Number of loads added");
Statistic<> numSpills("ra-linearscan", "Number of register spills");
class RA : public MachineFunctionPass { class RA : public MachineFunctionPass {
private: private:
@ -737,6 +738,7 @@ int RA::assignVirt2StackSlot(unsigned virtReg)
bool inserted = v2ssMap_.insert(std::make_pair(virtReg, frameIndex)).second; bool inserted = v2ssMap_.insert(std::make_pair(virtReg, frameIndex)).second;
assert(inserted && "attempt to assign stack slot to spilled register!"); assert(inserted && "attempt to assign stack slot to spilled register!");
++numSpills;
return frameIndex; return frameIndex;
} }