summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorAlkis Evlogimenos <alkis@evlogimenos.com>2004-07-04 17:23:35 +0000
committerAlkis Evlogimenos <alkis@evlogimenos.com>2004-07-04 17:23:35 +0000
commit21b3a5b0de49bf9fdb8c3e8a74c21b59db875ee4 (patch)
tree3596734e3379a52d7d7afa67e87f1084e0f570c7 /llvm/lib
parent0969646d6ed3f5b4a8eb8e529a3e5e9e92646213 (diff)
downloadbcm5719-llvm-21b3a5b0de49bf9fdb8c3e8a74c21b59db875ee4.tar.gz
bcm5719-llvm-21b3a5b0de49bf9fdb8c3e8a74c21b59db875ee4.zip
Correctly compute the ration of iterations/#intervals.
llvm-svn: 14626
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/RegAllocLinearScan.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/RegAllocLinearScan.cpp b/llvm/lib/CodeGen/RegAllocLinearScan.cpp
index 0e52f46c6f2..d5d3459906f 100644
--- a/llvm/lib/CodeGen/RegAllocLinearScan.cpp
+++ b/llvm/lib/CodeGen/RegAllocLinearScan.cpp
@@ -38,6 +38,9 @@ namespace {
Statistic<double> efficiency
("regalloc", "Ratio of intervals processed over total intervals");
+ static unsigned numIterations = 0;
+ static unsigned numIntervals = 0;
+
class RA : public MachineFunctionPass {
private:
MachineFunction* mf_;
@@ -183,7 +186,7 @@ void RA::linearScan()
// pick the interval with the earliest start point
IntervalPtrs::value_type cur = unhandled_.front();
unhandled_.pop_front();
- ++efficiency;
+ ++numIterations;
DEBUG(std::cerr << "\n*** CURRENT ***: " << *cur << '\n');
processActiveIntervals(cur);
@@ -206,7 +209,8 @@ void RA::linearScan()
DEBUG(printIntervals("inactive", inactive_.begin(), inactive_.end()));
// DEBUG(verifyAssignment());
}
- efficiency /= li_->getIntervals().size();
+ numIntervals += li_->getIntervals().size();
+ efficiency = double(numIterations) / double(numIntervals);
// expire any remaining active intervals
for (IntervalPtrs::iterator i = active_.begin(); i != active_.end(); ++i) {
OpenPOWER on IntegriCloud