summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveIntervalUnion.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-12-14 19:38:49 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-12-14 19:38:49 +0000
commit5c3ad0d51e671c2e13b9641d798ab62085150899 (patch)
tree81dbbcc2087b0c7c613753d67acb8cb9ceab13d7 /llvm/lib/CodeGen/LiveIntervalUnion.cpp
parent94f928b83f8c8ffda1e1315a3af33487a748ef8b (diff)
downloadbcm5719-llvm-5c3ad0d51e671c2e13b9641d798ab62085150899.tar.gz
bcm5719-llvm-5c3ad0d51e671c2e13b9641d798ab62085150899.zip
Add LiveIntervalUnion print methods, RegAllocGreedy::trySplit debug spew.
llvm-svn: 121783
Diffstat (limited to 'llvm/lib/CodeGen/LiveIntervalUnion.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveIntervalUnion.cpp27
1 files changed, 24 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalUnion.cpp b/llvm/lib/CodeGen/LiveIntervalUnion.cpp
index e8b39914ca8..d18044a099d 100644
--- a/llvm/lib/CodeGen/LiveIntervalUnion.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud