From 63a8eaf5599e2898a813a9c4b0e87fd6057c21c4 Mon Sep 17 00:00:00 2001 From: Jim Grosbach Date: Wed, 1 Sep 2010 22:48:34 +0000 Subject: 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 --- llvm/lib/CodeGen/RegAllocLinearScan.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'llvm/lib/CodeGen/RegAllocLinearScan.cpp') 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)); } -- cgit v1.2.3