diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-02-14 23:15:38 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-02-14 23:15:38 +0000 |
commit | eb9f040f0d07e2fa9b3b5ef46d5ee32511d28811 (patch) | |
tree | e77cb754983e5b09c8b79a17de979b916cae617c /lib/CodeGen/CalcSpillWeights.cpp | |
parent | 3fc178ffdad0c3359f8e4bad084556a3054e1ed2 (diff) | |
download | llvm-eb9f040f0d07e2fa9b3b5ef46d5ee32511d28811.tar.gz llvm-eb9f040f0d07e2fa9b3b5ef46d5ee32511d28811.tar.bz2 llvm-eb9f040f0d07e2fa9b3b5ef46d5ee32511d28811.tar.xz |
Move more fragments of spill weight calculation into CalcSpillWeights.h
Simplify the spill weight calculation a bit by bypassing
getApproximateInstructionCount() and using LiveInterval::getSize() directly.
This changes the computed spill weights, but only by a constant factor in each
function. It should not affect how spill weights compare against each other, and
so it shouldn't affect code generation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125530 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CalcSpillWeights.cpp')
-rw-r--r-- | lib/CodeGen/CalcSpillWeights.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/CodeGen/CalcSpillWeights.cpp b/lib/CodeGen/CalcSpillWeights.cpp index 6b57a07500..76bb3d148b 100644 --- a/lib/CodeGen/CalcSpillWeights.cpp +++ b/lib/CodeGen/CalcSpillWeights.cpp @@ -174,8 +174,7 @@ void VirtRegAuxInfo::CalculateWeightAndHint(LiveInterval &li) { totalWeight *= 0.5F; } - li.weight = totalWeight; - lis_.normalizeSpillWeight(li); + li.weight = normalizeSpillWeight(totalWeight, li.getSize()); } void VirtRegAuxInfo::CalculateRegClass(unsigned reg) { |