diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-12-14 19:38:49 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-12-14 19:38:49 +0000 |
commit | bfce678de7b509a497ac6d91f29e749adab7e40c (patch) | |
tree | cdea6d834a1ae18a565f3954e01ba409330486f7 /lib/CodeGen/LiveIntervalUnion.cpp | |
parent | 4a84cce3ed0008baf72ccc6831a046215addd2d7 (diff) |
Add LiveIntervalUnion print methods, RegAllocGreedy::trySplit debug spew.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121783 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveIntervalUnion.cpp')
-rw-r--r-- | lib/CodeGen/LiveIntervalUnion.cpp | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/lib/CodeGen/LiveIntervalUnion.cpp b/lib/CodeGen/LiveIntervalUnion.cpp index e8b39914ca..d18044a099 100644 --- a/lib/CodeGen/LiveIntervalUnion.cpp +++ b/lib/CodeGen/LiveIntervalUnion.cpp @@ -20,8 +20,6 @@ #include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetRegisterInfo.h" -#include <algorithm> - using namespace llvm; @@ -72,11 +70,34 @@ void LiveIntervalUnion::print(raw_ostream &OS, const TargetRegisterInfo *TRI) const { OS << "LIU "; TRI->printReg(RepReg, OS); + if (empty()) { + OS << " empty\n"; + return; + } for (LiveSegments::const_iterator SI = Segments.begin(); SI.valid(); ++SI) { OS << " [" << SI.start() << ' ' << SI.stop() << "):"; TRI->printReg(SI.value()->reg, OS); } - OS << "\n"; + OS << '\n'; +} + +void LiveIntervalUnion::InterferenceResult::print(raw_ostream &OS, + const TargetRegisterInfo *TRI) const { + OS << '[' << start() << ';' << stop() << ")\t"; + interference()->print(OS, TRI); +} + +void LiveIntervalUnion::Query::print(raw_ostream &OS, + const TargetRegisterInfo *TRI) { + OS << "Interferences with "; + LiveUnion->print(OS, TRI); + InterferenceResult IR = firstInterference(); + while (isInterference(IR)) { + OS << " "; + IR.print(OS, TRI); + OS << '\n'; + nextInterference(IR); + } } #ifndef NDEBUG |