Some more statistics improvements.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11676 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Alkis Evlogimenos 2004-02-20 20:53:26 +00:00
parent df158c7e3f
commit 007726ca6f

View File

@ -41,15 +41,21 @@ namespace {
RegisterAnalysis<LiveIntervals> X("liveintervals", RegisterAnalysis<LiveIntervals> X("liveintervals",
"Live Interval Analysis"); "Live Interval Analysis");
Statistic<> numIntervals("liveintervals", "Number of original intervals"); Statistic<> numIntervals
Statistic<> numJoined ("liveintervals", "Number of intervals after " ("liveintervals", "Number of original intervals");
"coalescing");
Statistic<> numJoins ("liveintervals", "Number of interval joins " Statistic<> numIntervalsAfter
"performed"); ("liveintervals", "Number of intervals after coalescing");
Statistic<> numPeep ("liveintervals", "Number of identity moves "
"eliminated after coalescing"); Statistic<> numJoins
Statistic<> numFolded ("liveintervals", "Number of register operands " ("liveintervals", "Number of interval joins performed");
"folded");
Statistic<> numPeep
("liveintervals", "Number of identity moves eliminated after coalescing");
Statistic<> numFolded
("liveintervals", "Number of register operands folded");
cl::opt<bool> cl::opt<bool>
join("join-liveintervals", join("join-liveintervals",
cl::desc("Join compatible live intervals"), cl::desc("Join compatible live intervals"),
@ -112,6 +118,8 @@ bool LiveIntervals::runOnMachineFunction(MachineFunction &fn) {
// join intervals if requested // join intervals if requested
if (join) joinIntervals(); if (join) joinIntervals();
numIntervalsAfter += intervals_.size();
// perform a final pass over the instructions and compute spill // perform a final pass over the instructions and compute spill
// weights, coalesce virtual registers and remove identity moves // weights, coalesce virtual registers and remove identity moves
const LoopInfo& loopInfo = getAnalysis<LoopInfo>(); const LoopInfo& loopInfo = getAnalysis<LoopInfo>();
@ -483,7 +491,6 @@ void LiveIntervals::joinIntervals()
r2iB->second = r2iA->second; r2iB->second = r2iA->second;
r2rMap_.insert(std::make_pair(intB->reg, intA->reg)); r2rMap_.insert(std::make_pair(intB->reg, intA->reg));
intervals_.erase(intB); intervals_.erase(intB);
++numJoined;
} }
} }
else if (MRegisterInfo::isPhysicalRegister(intA->reg) ^ else if (MRegisterInfo::isPhysicalRegister(intA->reg) ^
@ -504,7 +511,6 @@ void LiveIntervals::joinIntervals()
r2iB->second = r2iA->second; r2iB->second = r2iA->second;
r2rMap_.insert(std::make_pair(intB->reg, intA->reg)); r2rMap_.insert(std::make_pair(intB->reg, intA->reg));
intervals_.erase(intB); intervals_.erase(intB);
++numJoined;
} }
} }
} }