summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit63a8eaf5599e2898a813a9c4b0e87fd6057c21c4 (patch)
treea483c8795c847467de7990a2172a070ed6bd200c /llvm/lib/CodeGen/RegAllocLinearScan.cpp
parent092d3467bca0fe6ac20db65e9c5b5990dd9e31d4 (diff)
downloadbcm5719-llvm-63a8eaf5599e2898a813a9c4b0e87fd6057c21c4.tar.gz
bcm5719-llvm-63a8eaf5599e2898a813a9c4b0e87fd6057c21c4.zip
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. llvm-svn: 112756
Diffstat (limited to 'llvm/lib/CodeGen/RegAllocLinearScan.cpp')
-rw-r--r--llvm/lib/CodeGen/RegAllocLinearScan.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/RegAllocLinearScan.cpp b/llvm/lib/CodeGen/RegAllocLinearScan.cpp
index 32dda273d08..5c62354a887 100644
--- a/llvm/lib/CodeGen/RegAllocLinearScan.cpp
+++ b/llvm/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));
}
OpenPOWER on IntegriCloud