[PATCH] Loop Strength Reduce: Scaling factor cost.

Quentin Colombet qcolombet at apple.com
Fri May 31 14:30:09 PDT 2013


Thanks.

Committed in r183045.

-Quentin

On May 31, 2013, at 1:55 PM, Andrew Trick <atrick at apple.com> wrote:

> 
> On May 31, 2013, at 11:11 AM, Quentin Colombet <qcolombet at apple.com> wrote:
> 
>> Hi,
>> 
>> Scaling factor are often used within loops to access cells of an array.
>> When applying a scaling factor is not free, the scaling factor should be part of the induction variable, i.e., hoisted outside the loop.
>> 
>> I have attached a patch that accounts for the cost of scaling factor in Loop Strength Reduce when rating the formulae (with the proper target hook).
>> 
>> The default implementation of the hook is: if the addressing mode is legal, the scaling factor is free.
>> This keeps the current behavior of LSR. We can then improve this, target by target, by overloading the target hook accordingly.
>> 
>> Thanks for the review,
>> 
>> -Quentin
> 
> LGTM.
> -Andy

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130531/4fdfcfa1/attachment.html>


More information about the llvm-commits mailing list