mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-01 01:30:36 +00:00
Add efficiency statistic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14590 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3b94a5142c
commit
d55b2b1067
@ -21,6 +21,7 @@
|
|||||||
#include "llvm/Target/MRegisterInfo.h"
|
#include "llvm/Target/MRegisterInfo.h"
|
||||||
#include "llvm/Target/TargetMachine.h"
|
#include "llvm/Target/TargetMachine.h"
|
||||||
#include "Support/Debug.h"
|
#include "Support/Debug.h"
|
||||||
|
#include "Support/Statistic.h"
|
||||||
#include "Support/STLExtras.h"
|
#include "Support/STLExtras.h"
|
||||||
#include "LiveIntervals.h"
|
#include "LiveIntervals.h"
|
||||||
#include "PhysRegTracker.h"
|
#include "PhysRegTracker.h"
|
||||||
@ -33,6 +34,10 @@
|
|||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
Statistic<double> efficiency
|
||||||
|
("regalloc", "Ratio of intervals processed over total intervals");
|
||||||
|
|
||||||
class RA : public MachineFunctionPass {
|
class RA : public MachineFunctionPass {
|
||||||
private:
|
private:
|
||||||
MachineFunction* mf_;
|
MachineFunction* mf_;
|
||||||
@ -178,7 +183,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;
|
||||||
DEBUG(std::cerr << "\n*** CURRENT ***: " << *cur << '\n');
|
DEBUG(std::cerr << "\n*** CURRENT ***: " << *cur << '\n');
|
||||||
|
|
||||||
processActiveIntervals(cur);
|
processActiveIntervals(cur);
|
||||||
@ -201,6 +206,7 @@ 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();
|
||||||
|
|
||||||
// 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) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user