[llvm-commits] [llvm] r96613 - in /llvm/trunk: 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

Chris Lattner clattner at apple.com
Thu Feb 18 13:40:44 PST 2010


On Feb 18, 2010, at 1:39 PM, Evan Cheng wrote:

>> 
>> +    // After summing the spill weights of all defs and uses, the final weight
>> +    // should be normalized, dividing the weight of the interval by its size.
>> +    // This encourages spilling of intervals that are large and have few uses,
>> +    // and discourages spilling of small intervals with many uses.
>> +    void normalizeSpillWeight(LiveInterval &li) {
>> +      li.weight /= getApproximateInstructionCount(li) + 25;
>> +    }
>> +
> 
> Why 25? The new meaning of life? :-)

Is 25 "scientific"? :)

-Chris



More information about the llvm-commits mailing list