diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-03-04 18:36:51 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-03-04 18:36:51 +0000 |
commit | bee41501fae5414070a2797e853da15ea29b92a8 (patch) | |
tree | 8bc616a32b1d441ce684070c761178d9243cbad2 /include/llvm/CodeGen/CalcSpillWeights.h | |
parent | e90756d8a095264f6d6ae6b3a660e73c587162cd (diff) | |
download | external_llvm-bee41501fae5414070a2797e853da15ea29b92a8.zip external_llvm-bee41501fae5414070a2797e853da15ea29b92a8.tar.gz external_llvm-bee41501fae5414070a2797e853da15ea29b92a8.tar.bz2 |
Symbolize the default instruction distance.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127013 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/CalcSpillWeights.h')
-rw-r--r-- | include/llvm/CodeGen/CalcSpillWeights.h | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/include/llvm/CodeGen/CalcSpillWeights.h b/include/llvm/CodeGen/CalcSpillWeights.h index 853ebf9..1f5f088 100644 --- a/include/llvm/CodeGen/CalcSpillWeights.h +++ b/include/llvm/CodeGen/CalcSpillWeights.h @@ -11,7 +11,7 @@ #ifndef LLVM_CODEGEN_CALCSPILLWEIGHTS_H #define LLVM_CODEGEN_CALCSPILLWEIGHTS_H -#include "llvm/CodeGen/MachineFunctionPass.h" +#include "llvm/CodeGen/SlotIndexes.h" #include "llvm/ADT/DenseMap.h" namespace llvm { @@ -29,15 +29,12 @@ namespace llvm { /// @param Size Size of live interval as returnexd by getSize() /// static inline float normalizeSpillWeight(float UseDefFreq, unsigned Size) { - // The magic constant 200 corresponds to approx. 25 instructions since - // SlotIndexes allocate 8 slots per instruction. - // - // The constant is added to avoid depending too much on accidental SlotIndex - // gaps for small intervals. The effect is that small intervals have a spill - // weight that is mostly proportional to the number of uses, while large - // intervals get a spill weight that is closer to a use density. - // - return UseDefFreq / (Size + 200); + // The constant 25 instructions is added to avoid depending too much on + // accidental SlotIndex gaps for small intervals. The effect is that small + // intervals have a spill weight that is mostly proportional to the number + // of uses, while large intervals get a spill weight that is closer to a use + // density. + return UseDefFreq / (Size + 25*SlotIndex::InstrDist); } /// VirtRegAuxInfo - Calculate auxiliary information for a virtual |