summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/RegAllocLinearScan.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2008-08-13 21:49:13 +0000
committerOwen Anderson <resistor@mac.com>2008-08-13 21:49:13 +0000
commit51f689a6521ad68aa10c1ad238d6f3a6b6a60120 (patch)
tree22d1fae0f92a0efa19e44ab98313c90be9b67752 /llvm/lib/CodeGen/RegAllocLinearScan.cpp
parent16306107cf7d7678f27ae583fb1967d440fe0737 (diff)
downloadbcm5719-llvm-51f689a6521ad68aa10c1ad238d6f3a6b6a60120.tar.gz
bcm5719-llvm-51f689a6521ad68aa10c1ad238d6f3a6b6a60120.zip
Make the allocation of LiveIntervals explicit, rather than holding them in the r2iMap_ by value. This will prevent references to them from being invalidated
if the map is changed. llvm-svn: 54763
Diffstat (limited to 'llvm/lib/CodeGen/RegAllocLinearScan.cpp')
-rw-r--r--llvm/lib/CodeGen/RegAllocLinearScan.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/RegAllocLinearScan.cpp b/llvm/lib/CodeGen/RegAllocLinearScan.cpp
index ad830b25352..9e5087b4a68 100644
--- a/llvm/lib/CodeGen/RegAllocLinearScan.cpp
+++ b/llvm/lib/CodeGen/RegAllocLinearScan.cpp
@@ -323,11 +323,11 @@ void RALinScan::initIntervalSets()
"interval sets should be empty on initialization");
for (LiveIntervals::iterator i = li_->begin(), e = li_->end(); i != e; ++i) {
- if (TargetRegisterInfo::isPhysicalRegister(i->second.reg)) {
- reginfo_->setPhysRegUsed(i->second.reg);
- fixed_.push_back(std::make_pair(&i->second, i->second.begin()));
+ if (TargetRegisterInfo::isPhysicalRegister(i->second->reg)) {
+ reginfo_->setPhysRegUsed(i->second->reg);
+ fixed_.push_back(std::make_pair(i->second, i->second->begin()));
} else
- unhandled_.push(&i->second);
+ unhandled_.push(i->second);
}
}
@@ -385,11 +385,11 @@ void RALinScan::linearScan()
MachineFunction::iterator EntryMBB = mf_->begin();
SmallVector<MachineBasicBlock*, 8> LiveInMBBs;
for (LiveIntervals::iterator i = li_->begin(), e = li_->end(); i != e; ++i) {
- LiveInterval &cur = i->second;
+ LiveInterval &cur = *i->second;
unsigned Reg = 0;
bool isPhys = TargetRegisterInfo::isPhysicalRegister(cur.reg);
if (isPhys)
- Reg = i->second.reg;
+ Reg = cur.reg;
else if (vrm_->isAssignedReg(cur.reg))
Reg = attemptTrivialCoalescing(cur, vrm_->getPhys(cur.reg));
if (!Reg)
OpenPOWER on IntegriCloud