mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 04:24:00 +00:00
Correctly compute the ration of iterations/#intervals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14626 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -38,6 +38,9 @@ namespace {
|
|||||||
Statistic<double> efficiency
|
Statistic<double> efficiency
|
||||||
("regalloc", "Ratio of intervals processed over total intervals");
|
("regalloc", "Ratio of intervals processed over total intervals");
|
||||||
|
|
||||||
|
static unsigned numIterations = 0;
|
||||||
|
static unsigned numIntervals = 0;
|
||||||
|
|
||||||
class RA : public MachineFunctionPass {
|
class RA : public MachineFunctionPass {
|
||||||
private:
|
private:
|
||||||
MachineFunction* mf_;
|
MachineFunction* mf_;
|
||||||
@ -183,7 +186,7 @@ void RA::linearScan()
|
|||||||
// pick the interval with the earliest start point
|
// pick the interval with the earliest start point
|
||||||
IntervalPtrs::value_type cur = unhandled_.front();
|
IntervalPtrs::value_type cur = unhandled_.front();
|
||||||
unhandled_.pop_front();
|
unhandled_.pop_front();
|
||||||
++efficiency;
|
++numIterations;
|
||||||
DEBUG(std::cerr << "\n*** CURRENT ***: " << *cur << '\n');
|
DEBUG(std::cerr << "\n*** CURRENT ***: " << *cur << '\n');
|
||||||
|
|
||||||
processActiveIntervals(cur);
|
processActiveIntervals(cur);
|
||||||
@ -206,7 +209,8 @@ void RA::linearScan()
|
|||||||
DEBUG(printIntervals("inactive", inactive_.begin(), inactive_.end()));
|
DEBUG(printIntervals("inactive", inactive_.begin(), inactive_.end()));
|
||||||
// DEBUG(verifyAssignment());
|
// DEBUG(verifyAssignment());
|
||||||
}
|
}
|
||||||
efficiency /= li_->getIntervals().size();
|
numIntervals += li_->getIntervals().size();
|
||||||
|
efficiency = double(numIterations) / double(numIntervals);
|
||||||
|
|
||||||
// expire any remaining active intervals
|
// expire any remaining active intervals
|
||||||
for (IntervalPtrs::iterator i = active_.begin(); i != active_.end(); ++i) {
|
for (IntervalPtrs::iterator i = active_.begin(); i != active_.end(); ++i) {
|
||||||
|
Reference in New Issue
Block a user