summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2010-09-01 21:23:03 +0000
committerJim Grosbach <grosbach@apple.com>2010-09-01 21:23:03 +0000
commit269354e57024ab815bdb74f06cc6309a879d1f9f (patch)
tree58e8664e890e9968ba30c34c9f8ebe981f5614d1
parent067a648599a99dc5a499e0241a85436fe6037c5a (diff)
downloadllvm-269354e57024ab815bdb74f06cc6309a879d1f9f.tar.gz
llvm-269354e57024ab815bdb74f06cc6309a879d1f9f.tar.bz2
llvm-269354e57024ab815bdb74f06cc6309a879d1f9f.tar.xz
The register allocator shouldn't consider allocating reserved registers. PBQP version.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112742 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/RegAllocPBQP.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/CodeGen/RegAllocPBQP.cpp b/lib/CodeGen/RegAllocPBQP.cpp
index 0dd9214826..c6fdf04c7a 100644
--- a/lib/CodeGen/RegAllocPBQP.cpp
+++ b/lib/CodeGen/RegAllocPBQP.cpp
@@ -587,6 +587,8 @@ PBQP::Graph PBQPRegAlloc::constructPBQPProblem() {
// Resize allowedSets container appropriately.
allowedSets.resize(vregIntervalsToAlloc.size());
+ BitVector ReservedRegs = tri->getReservedRegs(*mf);
+
// Iterate over virtual register intervals to compute allowed sets...
for (unsigned node = 0; node < node2LI.size(); ++node) {
@@ -595,8 +597,12 @@ PBQP::Graph PBQPRegAlloc::constructPBQPProblem() {
const TargetRegisterClass *liRC = mri->getRegClass(li->reg);
// Start by assuming all allocable registers in the class are allowed...
- RegVector liAllowed(liRC->allocation_order_begin(*mf),
- liRC->allocation_order_end(*mf));
+ RegVector liAllowed;
+ TargetRegisterClass::iterator aob = liRC->allocation_order_begin(*mf);
+ TargetRegisterClass::iterator aoe = liRC->allocation_order_end(*mf);
+ for (TargetRegisterClass::iterator it = aob; it != aoe; ++it)
+ if (!ReservedRegs.test(*it))
+ liAllowed.push_back(*it);
// Eliminate the physical registers which overlap with this range, along
// with all their aliases.