From 52de9e214cdb5a3628879fe6691aaa1ae48f355b Mon Sep 17 00:00:00 2001 From: Alkis Evlogimenos Date: Mon, 23 Feb 2004 18:45:32 +0000 Subject: [PATCH] Add number of spilled registers statistic. llvm-svn: 11759 --- llvm/lib/CodeGen/RegAllocLinearScan.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/llvm/lib/CodeGen/RegAllocLinearScan.cpp b/llvm/lib/CodeGen/RegAllocLinearScan.cpp index d4b258d1fc53..fb780206693f 100644 --- a/llvm/lib/CodeGen/RegAllocLinearScan.cpp +++ b/llvm/lib/CodeGen/RegAllocLinearScan.cpp @@ -34,6 +34,7 @@ using namespace llvm; namespace { Statistic<> numStores("ra-linearscan", "Number of stores added"); Statistic<> numLoads ("ra-linearscan", "Number of loads added"); + Statistic<> numSpills("ra-linearscan", "Number of register spills"); class RA : public MachineFunctionPass { private: @@ -737,6 +738,7 @@ int RA::assignVirt2StackSlot(unsigned virtReg) bool inserted = v2ssMap_.insert(std::make_pair(virtReg, frameIndex)).second; assert(inserted && "attempt to assign stack slot to spilled register!"); + ++numSpills; return frameIndex; }