[llvm-commits] [regalloc_linearscan] CVS: llvm/lib/CodeGen/LiveIntervals.cpp
Alkis Evlogimenos
alkis at cs.uiuc.edu
Wed Nov 5 01:28:09 PST 2003
Changes in directory llvm/lib/CodeGen:
LiveIntervals.cpp updated: 1.1.2.5 -> 1.1.2.6
---
Log message:
Add and expose auxiliary data structures for use with the linear scan
register allocator.
---
Diffs of the changes: (+13 -6)
Index: llvm/lib/CodeGen/LiveIntervals.cpp
diff -u llvm/lib/CodeGen/LiveIntervals.cpp:1.1.2.5 llvm/lib/CodeGen/LiveIntervals.cpp:1.1.2.6
--- llvm/lib/CodeGen/LiveIntervals.cpp:1.1.2.5 Tue Nov 4 01:57:28 2003
+++ llvm/lib/CodeGen/LiveIntervals.cpp Wed Nov 5 01:27:16 2003
@@ -64,14 +64,20 @@
mbb != mbbEnd; ++mbb) {
const std::pair<MachineBasicBlock*, unsigned>& entry =
lv_->getMachineBasicBlockInfo(&*mbb);
- bool inserted = i2mbbMap_.insert(std::make_pair(entry.second,
- entry.first)).second;
+ bool inserted = mbbi2mbbMap_.insert(std::make_pair(entry.second,
+ entry.first)).second;
assert(inserted && "multiple index -> MachineBasicBlock");
+ inserted = mbb2miiMap_.insert(std::make_pair(&*mbb, miIndex)).second;
+ assert(inserted && "multiple MachineBasicBlock -> index mappings");
for (MachineBasicBlock::iterator mi = mbb->begin(), miEnd = mbb->end();
mi != miEnd; ++mi) {
- inserted = mi2iMap_.insert(std::make_pair(*mi, miIndex++)).second;
+ inserted = mi2iMap_.insert(std::make_pair(*mi, miIndex)).second;
assert(inserted && "multiple MachineInstr -> index mappings");
+ inserted =
+ mii2mbbMap_.insert(std::make_pair(miIndex, &*mbb)).second;
+ assert(inserted && "multiple index -> MachineBasicBlock mappings");
+ ++miIndex;
}
}
@@ -121,8 +127,8 @@
interval.addRange(start, end);
}
- for (Index2MbbMap::iterator
- it = i2mbbMap_.begin(), itEnd = i2mbbMap_.end();
+ for (MbbIndex2MbbMap::iterator
+ it = mbbi2mbbMap_.begin(), itEnd = mbbi2mbbMap_.end();
it != itEnd; ++it) {
unsigned mbbIndex = it->first;
MachineBasicBlock* mbb2 = it->second;
@@ -158,7 +164,8 @@
{
DEBUG(std::cerr << "computing live intervals:\n");
- for (Index2MbbMap::iterator it = i2mbbMap_.begin(), itEnd = i2mbbMap_.end();
+ for (MbbIndex2MbbMap::iterator
+ it = mbbi2mbbMap_.begin(), itEnd = mbbi2mbbMap_.end();
it != itEnd; ++it) {
MachineBasicBlock* mbb = it->second;
DEBUG(std::cerr << "machine basic block: "
More information about the llvm-commits
mailing list