From: Jim Grosbach Date: Wed, 1 Sep 2010 22:48:34 +0000 (+0000) Subject: Tweak to ignoring reserved regs. The allocator was occasionally still looking X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=188da252ab1b20bdb368e8f64a97c0fa4d5f5d66;p=oota-llvm.git 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 --- diff --git a/lib/CodeGen/RegAllocLinearScan.cpp b/lib/CodeGen/RegAllocLinearScan.cpp index 32dda273d08..5c62354a887 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)); }