From a86595e06ba527ba35216665e143c1fdac79a5be Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Sat, 12 Mar 2011 04:17:20 +0000 Subject: Spill multiple registers at once. Live range splitting can create a number of small live ranges containing only a single real use. Spill these small live ranges along with the large range they are connected to with copies. This enables memory operand folding and maximizes the spill to fill distance. Work in progress with known bugs. llvm-svn: 127529 --- llvm/lib/CodeGen/RegAllocBasic.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'llvm/lib/CodeGen/RegAllocBasic.cpp') diff --git a/llvm/lib/CodeGen/RegAllocBasic.cpp b/llvm/lib/CodeGen/RegAllocBasic.cpp index 9df2047a666..d51be520279 100644 --- a/llvm/lib/CodeGen/RegAllocBasic.cpp +++ b/llvm/lib/CodeGen/RegAllocBasic.cpp @@ -289,6 +289,13 @@ void RegAllocBase::allocatePhysRegs() { // Continue assigning vregs one at a time to available physical registers. while (LiveInterval *VirtReg = dequeue()) { + // Unused registers can appear when the spiller coalesces snippets. + if (MRI->reg_nodbg_empty(VirtReg->reg)) { + DEBUG(dbgs() << "Dropping unused " << *VirtReg << '\n'); + LIS->removeInterval(VirtReg->reg); + continue; + } + // selectOrSplit requests the allocator to return an available physical // register if possible and populate a list of new live intervals that // result from splitting. -- cgit v1.2.3