aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorArnaud A. de Grandmaison <arnaud.adegm@gmail.com>2013-11-11 19:56:14 +0000
committerArnaud A. de Grandmaison <arnaud.adegm@gmail.com>2013-11-11 19:56:14 +0000
commitd736763847cee94c40a7f4d106cad91445834b7c (patch)
tree38052fe71edc3b4051fe1ccb5df147d565c5de03 /lib
parentef572e31e210a03c0669e3ed2ed7cf2d789f8599 (diff)
downloadexternal_llvm-d736763847cee94c40a7f4d106cad91445834b7c.zip
external_llvm-d736763847cee94c40a7f4d106cad91445834b7c.tar.gz
external_llvm-d736763847cee94c40a7f4d106cad91445834b7c.tar.bz2
CalcSpillWeights: allow overidding the spill weight normalizing function
This will enable the PBQP register allocator to provide its own normalizing function. No functionnal change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194417 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/CalcSpillWeights.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/CodeGen/CalcSpillWeights.cpp b/lib/CodeGen/CalcSpillWeights.cpp
index 087d737..4925c4d 100644
--- a/lib/CodeGen/CalcSpillWeights.cpp
+++ b/lib/CodeGen/CalcSpillWeights.cpp
@@ -25,12 +25,13 @@ using namespace llvm;
void llvm::calculateSpillWeightsAndHints(LiveIntervals &LIS,
MachineFunction &MF,
const MachineLoopInfo &MLI,
- const MachineBlockFrequencyInfo &MBFI) {
+ const MachineBlockFrequencyInfo &MBFI,
+ VirtRegAuxInfo::NormalizingFn norm) {
DEBUG(dbgs() << "********** Compute Spill Weights **********\n"
<< "********** Function: " << MF.getName() << '\n');
MachineRegisterInfo &MRI = MF.getRegInfo();
- VirtRegAuxInfo VRAI(MF, LIS, MLI, MBFI);
+ VirtRegAuxInfo VRAI(MF, LIS, MLI, MBFI, norm);
for (unsigned i = 0, e = MRI.getNumVirtRegs(); i != e; ++i) {
unsigned Reg = TargetRegisterInfo::index2VirtReg(i);
if (MRI.reg_nodbg_empty(Reg))
@@ -182,5 +183,5 @@ VirtRegAuxInfo::calculateSpillWeightAndHint(LiveInterval &li) {
if (isRematerializable(li, LIS, *MF.getTarget().getInstrInfo()))
totalWeight *= 0.5F;
- li.weight = normalizeSpillWeight(totalWeight, li.getSize());
+ li.weight = normalize(totalWeight, li.getSize());
}