>>>>> -              (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
_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to