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 | b77ec7d26405125fa5685370af5f17fcc9edbecd (patch) | |
tree | f22609d0c912c4629d98f79ef81f0a1e1c4a5174 /lib/CodeGen/LiveIntervalAnalysis.cpp | |
parent | 34c6f9803499c11ed2dc8479ec768d47370a2d3a (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158031 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r-- | lib/CodeGen/LiveIntervalAnalysis.cpp | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index 1265dc31fc..1431ba4cd2 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/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 |