summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorAlkis Evlogimenos <alkis@evlogimenos.com>2004-07-04 07:59:06 +0000
committerAlkis Evlogimenos <alkis@evlogimenos.com>2004-07-04 07:59:06 +0000
commit8f3cc0316c6c1be5074d07cfae6ecb64110db923 (patch)
treea54d6b56f120ce3a0e745614241ac71ff457c49a /llvm/lib/CodeGen
parentef72a7e963cdb618fc2b46ad12f06938d7d2ff2a (diff)
downloadbcm5719-llvm-8f3cc0316c6c1be5074d07cfae6ecb64110db923.tar.gz
bcm5719-llvm-8f3cc0316c6c1be5074d07cfae6ecb64110db923.zip
Add efficiency statistic.
llvm-svn: 14590
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/RegAllocLinearScan.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/RegAllocLinearScan.cpp b/llvm/lib/CodeGen/RegAllocLinearScan.cpp
index 285f493fff3..0e52f46c6f2 100644
--- a/llvm/lib/CodeGen/RegAllocLinearScan.cpp
+++ b/llvm/lib/CodeGen/RegAllocLinearScan.cpp
@@ -21,6 +21,7 @@
#include "llvm/Target/MRegisterInfo.h"
#include "llvm/Target/TargetMachine.h"
#include "Support/Debug.h"
+#include "Support/Statistic.h"
#include "Support/STLExtras.h"
#include "LiveIntervals.h"
#include "PhysRegTracker.h"
@@ -33,6 +34,10 @@
using namespace llvm;
namespace {
+
+ Statistic<double> efficiency
+ ("regalloc", "Ratio of intervals processed over total intervals");
+
class RA : public MachineFunctionPass {
private:
MachineFunction* mf_;
@@ -178,7 +183,7 @@ void RA::linearScan()
// pick the interval with the earliest start point
IntervalPtrs::value_type cur = unhandled_.front();
unhandled_.pop_front();
-
+ ++efficiency;
DEBUG(std::cerr << "\n*** CURRENT ***: " << *cur << '\n');
processActiveIntervals(cur);
@@ -201,6 +206,7 @@ void RA::linearScan()
DEBUG(printIntervals("inactive", inactive_.begin(), inactive_.end()));
// DEBUG(verifyAssignment());
}
+ efficiency /= li_->getIntervals().size();
// expire any remaining active intervals
for (IntervalPtrs::iterator i = active_.begin(); i != active_.end(); ++i) {
OpenPOWER on IntegriCloud