[llvm-commits] CVS: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp RegAllocLinearScan.cpp VirtRegMap.cpp VirtRegMap.h

Chris Lattner clattner at apple.com
Fri Mar 30 15:38:51 PDT 2007


>>>>> -              (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?
>
> To avoid a common problem. A value live-in to a function and is  
> loaded from stack slot and used in a loop. You do not want to  
> rematerialize this and end up issuing the load in the loop.
>
> This is tricky to get right. I am not sure simple heuristics can  
> cover all the cases.

Okay, so just look to see if the instr has the  TargetInstrInfo::LOAD  
flag on it?

-Chris



More information about the llvm-commits mailing list