aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/RegAllocLinearScan.cpp
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2010-09-01 22:48:34 +0000
committerJim Grosbach <grosbach@apple.com>2010-09-01 22:48:34 +0000
commit188da252ab1b20bdb368e8f64a97c0fa4d5f5d66 (patch)
tree0125fd932e61b6ba7cfe8f3b114747e8bcb5aee7 /lib/CodeGen/RegAllocLinearScan.cpp
parent97511ceffa47d71c805b58143a24c78cdba2a5c1 (diff)
Tweak to ignoring reserved regs. The allocator was occasionally still looking
at them since they'd end up in the register weights list. Tell it to stop doing that. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112756 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAllocLinearScan.cpp')
-rw-r--r--lib/CodeGen/RegAllocLinearScan.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/CodeGen/RegAllocLinearScan.cpp b/lib/CodeGen/RegAllocLinearScan.cpp
index 32dda273d0..5c62354a88 100644
--- a/lib/CodeGen/RegAllocLinearScan.cpp
+++ b/lib/CodeGen/RegAllocLinearScan.cpp
@@ -1147,9 +1147,11 @@ void RALinScan::assignRegOrStackSlotAtInterval(LiveInterval* cur) {
e = RC->allocation_order_end(*mf_); i != e; ++i) {
unsigned reg = *i;
float regWeight = SpillWeights[reg];
+ // Don't even consider reserved regs.
+ if (reservedRegs_.test(reg))
+ continue;
// Skip recently allocated registers and reserved registers.
- if (minWeight > regWeight && !isRecentlyUsed(reg) &&
- !reservedRegs_.test(reg))
+ if (minWeight > regWeight && !isRecentlyUsed(reg))
Found = true;
RegsWeights.push_back(std::make_pair(reg, regWeight));
}