summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/RegAllocLinearScan.cpp
diff options
context:
space:
mode:
authorAlkis Evlogimenos <alkis@evlogimenos.com>2004-01-16 20:29:42 +0000
committerAlkis Evlogimenos <alkis@evlogimenos.com>2004-01-16 20:29:42 +0000
commit8672af1cc88245193bc8bd385d47bc63e4ea7ad8 (patch)
treea99c1a14db826aebdf4eca30daa351f8229b6164 /llvm/lib/CodeGen/RegAllocLinearScan.cpp
parentd86933d21df4af1daa02f66c4ba877683318d95d (diff)
downloadbcm5719-llvm-8672af1cc88245193bc8bd385d47bc63e4ea7ad8.tar.gz
bcm5719-llvm-8672af1cc88245193bc8bd385d47bc63e4ea7ad8.zip
Handle printing of intervals that are not assign to any physical
register yet. llvm-svn: 10895
Diffstat (limited to 'llvm/lib/CodeGen/RegAllocLinearScan.cpp')
-rw-r--r--llvm/lib/CodeGen/RegAllocLinearScan.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/RegAllocLinearScan.cpp b/llvm/lib/CodeGen/RegAllocLinearScan.cpp
index abd13900931..8712e98d850 100644
--- a/llvm/lib/CodeGen/RegAllocLinearScan.cpp
+++ b/llvm/lib/CodeGen/RegAllocLinearScan.cpp
@@ -161,21 +161,22 @@ namespace {
}
std::cerr << '\n';
}
+
void printIntervals(const char* const str,
RA::IntervalPtrs::const_iterator i,
RA::IntervalPtrs::const_iterator e) const {
if (str) std::cerr << str << " intervals:\n";
for (; i != e; ++i) {
std::cerr << "\t\t" << **i << " -> ";
- if ((*i)->reg < MRegisterInfo::FirstVirtualRegister) {
- std::cerr << mri_->getName((*i)->reg);
- }
- else {
- std::cerr << mri_->getName(v2pMap_.find((*i)->reg)->second);
+ unsigned reg = (*i)->reg;
+ if (reg >= MRegisterInfo::FirstVirtualRegister) {
+ Virt2PhysMap::const_iterator it = v2pMap_.find(reg);
+ reg = (it == v2pMap_.end() ? 0 : it->second);
}
- std::cerr << '\n';
+ std::cerr << mri_->getName((*i)->reg) << '\n';
}
}
+
void printFreeRegs(const char* const str,
const TargetRegisterClass* rc) const {
if (str) std::cerr << str << ':';
OpenPOWER on IntegriCloud