From 188da252ab1b20bdb368e8f64a97c0fa4d5f5d66 Mon Sep 17 00:00:00 2001 From: Jim Grosbach Date: Wed, 1 Sep 2010 22:48:34 +0000 Subject: [PATCH] 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 --- lib/CodeGen/RegAllocLinearScan.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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)); } -- 2.34.1