diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-06-05 22:51:54 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-06-05 22:51:54 +0000 |
commit | f3f7d6f6e21afdf2481bffdba9e10bb19d60cdd0 (patch) | |
tree | c336d3d87d625b5e0083f4c8bf077379c092230a /llvm/lib/CodeGen/LiveIntervalAnalysis.cpp | |
parent | 12e03dae448b32e7d43d6c40021cbc596cddebdd (diff) | |
download | bcm5719-llvm-f3f7d6f6e21afdf2481bffdba9e10bb19d60cdd0.tar.gz bcm5719-llvm-f3f7d6f6e21afdf2481bffdba9e10bb19d60cdd0.zip |
Simplify LiveInterval::print().
Don't print out the register number and spill weight, making the TRI
argument unnecessary.
This allows callers to interpret the reg field. It can currently be a
virtual register, a physical register, a spill slot, or a register unit.
llvm-svn: 158031
Diffstat (limited to 'llvm/lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LiveIntervalAnalysis.cpp | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp index 1265dc31fc3..1431ba4cd2a 100644 --- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -138,10 +138,8 @@ void LiveIntervals::print(raw_ostream &OS, const Module* ) const { // Dump the physregs. for (unsigned Reg = 1, RegE = TRI->getNumRegs(); Reg != RegE; ++Reg) - if (const LiveInterval *LI = R2IMap.lookup(Reg)) { - LI->print(OS, TRI); - OS << '\n'; - } + if (const LiveInterval *LI = R2IMap.lookup(Reg)) + OS << PrintReg(Reg, TRI) << '\t' << *LI << '\n'; // Dump the regunits. for (unsigned i = 0, e = RegUnitIntervals.size(); i != e; ++i) @@ -151,10 +149,8 @@ void LiveIntervals::print(raw_ostream &OS, const Module* ) const { // Dump the virtregs. for (unsigned Reg = 0, RegE = MRI->getNumVirtRegs(); Reg != RegE; ++Reg) if (const LiveInterval *LI = - R2IMap.lookup(TargetRegisterInfo::index2VirtReg(Reg))) { - LI->print(OS, TRI); - OS << '\n'; - } + R2IMap.lookup(TargetRegisterInfo::index2VirtReg(Reg))) + OS << PrintReg(LI->reg) << '\t' << *LI << '\n'; printInstrs(OS); } @@ -352,10 +348,7 @@ void LiveIntervals::handleVirtualRegisterDef(MachineBasicBlock *mbb, interval.addRange(LiveRange(RedefIndex, RedefIndex.getDeadSlot(), OldValNo)); - DEBUG({ - dbgs() << " RESULT: "; - interval.print(dbgs(), TRI); - }); + DEBUG(dbgs() << " RESULT: " << interval); } else if (LV->isPHIJoin(interval.reg)) { // In the case of PHI elimination, each variable definition is only // live until the end of the block. We've already taken care of the |