summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlkis Evlogimenos <alkis@evlogimenos.com>2003-12-13 11:58:10 +0000
committerAlkis Evlogimenos <alkis@evlogimenos.com>2003-12-13 11:58:10 +0000
commit4f7f017ab563337267dff6c87e201b67d3533e58 (patch)
treeb0cc5e19a90944b34e1c4bc8bd7555c3bc01938c
parent7dbdf3839c538613d3f4d7a88539f7c7ec0eea1a (diff)
downloadbcm5719-llvm-4f7f017ab563337267dff6c87e201b67d3533e58.tar.gz
bcm5719-llvm-4f7f017ab563337267dff6c87e201b67d3533e58.zip
When reserving a preallocated register spill the aliases of this
register too. llvm-svn: 10450
-rw-r--r--llvm/lib/CodeGen/RegAllocLinearScan.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/RegAllocLinearScan.cpp b/llvm/lib/CodeGen/RegAllocLinearScan.cpp
index 8645a2b0448..dd94ad31c1f 100644
--- a/llvm/lib/CodeGen/RegAllocLinearScan.cpp
+++ b/llvm/lib/CodeGen/RegAllocLinearScan.cpp
@@ -628,6 +628,22 @@ void RA::reservePhysReg(unsigned physReg)
assignVirt2StackSlot(virtReg);
}
p2vMap_[physReg] = physReg; // this denotes a reserved physical register
+
+ // if it also aliases any other registers with values spill them too
+ for (const unsigned* as = mri_->getAliasSet(physReg); *as; ++as) {
+ unsigned virtReg = p2vMap_[*as];
+ if (virtReg != 0 && virtReg != *as) {
+ // remove interval from active
+ for (IntervalPtrs::iterator i = active_.begin(), e = active_.end();
+ i != e; ++i) {
+ if ((*i)->reg == virtReg) {
+ active_.erase(i);
+ break;
+ }
+ }
+ assignVirt2StackSlot(virtReg);
+ }
+ }
}
void RA::clearReservedPhysReg(unsigned physReg)
OpenPOWER on IntegriCloud