Always normalize spill weights, also for intervals created by spilling.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Thu, 18 Feb 2010 21:33:05 +0000 (21:33 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Thu, 18 Feb 2010 21:33:05 +0000 (21:33 +0000)
commit352d352c023ed411d9e4357ea01f3ec468ff87dc
tree39c68041361c761a8290d6c452c02ea0dc9366ea
parent49d7f8d341a7b4137c674ce0f08f5b18e8195f4a
Always normalize spill weights, also for intervals created by spilling.

Moderate the weight given to very small intervals.

The spill weight given to new intervals created when spilling was not
normalized in the same way as the original spill weights calculated by
CalcSpillWeights. That meant that restored registers would tend to hang around
because they had a much higher spill weight that unspilled registers.

This improves the runtime of a few tests by up to 10%, and there are no
significant regressions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96613 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/LiveIntervalAnalysis.h
lib/CodeGen/CalcSpillWeights.cpp
lib/CodeGen/LiveIntervalAnalysis.cpp
test/CodeGen/X86/2008-02-22-ReMatBug.ll
test/CodeGen/X86/pr3495-2.ll