[PATCH] Loop Strength Reduce: Scaling factor cost.

Andrew Trick atrick at apple.com
Fri May 31 13:55:15 PDT 2013


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/55c6568e/attachment.html>


More information about the llvm-commits mailing list