In some rare cases, the register allocator can spill registers but end up not utilizi...
authorEvan Cheng <evan.cheng@apple.com>
Sun, 3 May 2009 18:32:42 +0000 (18:32 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Sun, 3 May 2009 18:32:42 +0000 (18:32 +0000)
commitc781a243a3d17e7e763515794168d8fa6043f565
treedcaf1b9201cdb221cb2206858891575d2b241bbb
parent87e3caf81939db20d2359bd38df2ed206040026d
In some rare cases, the register allocator can spill registers but end up not utilizing registers at all. The fundamental problem is linearscan's backtracking can end up freeing more than one allocated registers. However,  reloads and restores might be folded into uses / defs and freed registers might not be used at all.

VirtRegMap keeps track of allocations so it knows what's not used. As a horrible hack, the stack coloring can color spill slots with *free* registers. That is, it replace reload and spills with copies from and to the free register. It unfold instructions that load and store the spill slot and replace them with register using variants.

Not yet enabled. This is part 1. More coming.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70787 91177308-0d34-0410-b5e6-96231b3b80d8
12 files changed:
include/llvm/CodeGen/LiveIntervalAnalysis.h
include/llvm/CodeGen/LiveStackAnalysis.h
include/llvm/Target/TargetInstrInfo.h
include/llvm/Target/TargetRegisterInfo.h
lib/CodeGen/LiveIntervalAnalysis.cpp
lib/CodeGen/LiveStackAnalysis.cpp
lib/CodeGen/PreAllocSplitting.cpp
lib/CodeGen/RegAllocLinearScan.cpp
lib/CodeGen/RegAllocPBQP.cpp
lib/CodeGen/StackSlotColoring.cpp
lib/CodeGen/VirtRegMap.cpp
lib/CodeGen/VirtRegMap.h