[llvm-commits] CVS: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp RegAllocLinearScan.cpp VirtRegMap.cpp VirtRegMap.h
Chris Lattner
clattner at apple.com
Fri Mar 30 15:09:23 PDT 2007
On Mar 30, 2007, at 3:03 PM, Evan Cheng wrote:
>>> unsigned reg = rep(mop.getReg());
>>> mii->getOperand(i).setReg(reg);
>>>
>>> + // If the definition instruction is re-
>>> materializable, its spill
>>> + // weight is zero.
>>> LiveInterval &RegInt = getInterval(reg);
>>> - RegInt.weight +=
>>> - (mop.isUse() + mop.isDef()) * pow(10.0F, (int)
>>> loopDepth);
>>> + if (!RegInt.remat) {
>>> + RegInt.weight +=
>>> + (mop.isUse() + mop.isDef()) * pow(10.0F, (int)
>>> loopDepth);
>>> + }
>>
>> Should it really be zero? It should definitely be lower that a
>> normal value, but zero seems low. The loop depth should still be
>> taken into consideration.
>
> Funny you should mention this. I am re-evaluating this right now.
> My thinking is loads (load from constantpool or stack slots) would
> have the normal weight. The rest will have half the weight.
Why not just make everything half weight? What would be lost?
-Chris
More information about the llvm-commits
mailing list