Transpose the calculation of spill weights such that we are calculating one
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 10 Aug 2010 00:02:26 +0000 (00:02 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 10 Aug 2010 00:02:26 +0000 (00:02 +0000)
commitdf30cf9e61e6586b45b74d1312bef1ee758ef94f
tree3360bcfa05c755a40a8d29fb846c45c498ac260a
parent533a7df02d8493978a76f001f5560e1569f024c0
Transpose the calculation of spill weights such that we are calculating one
register at a time. This turns out to be slightly faster than iterating over
instructions, but more importantly, it allows us to compute spill weights for
new registers created after the spill weight pass has run.

Also compute the allocation hint at the same time as the spill weight. This
allows us to use the spill weight as a cost metric for copies, and choose the
most profitable hint if there is more than one possibility.

The new hints provide a very small (< 0.1%) but universal code size improvement.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110631 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/CalcSpillWeights.h
include/llvm/CodeGen/LiveInterval.h
include/llvm/CodeGen/LiveIntervalAnalysis.h
lib/CodeGen/CalcSpillWeights.cpp
lib/CodeGen/LiveInterval.cpp
lib/CodeGen/SimpleRegisterCoalescing.cpp
lib/CodeGen/SimpleRegisterCoalescing.h