[PATCH] LSR: Account for 2 foldable register in addressing mode if the target allows that.

Quentin Colombet qcolombet at apple.com
Wed May 29 12:48:10 PDT 2013


Hi,

Here is a patch that modifies how the formulae are rated in Loop Strength Reduce.
Namely, this patch checks if the target allows to fold more that one register in the addressing mode and if yes, adjusts the cost accordingly.

Prior to this patch, reg1 + scale * reg2 accesses were artificially preferred to reg1 + reg2 accesses. Indeed, the cost model wrongly assumed that reg1 + reg2 needs a temporary register for the computation, whereas it was correctly estimated for reg1 + scale * reg2.

This patch fixes that.

Thanks for the reviews.

-Quentin

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130529/326d07d3/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lsr_2_reg_fold.svndiff
Type: application/octet-stream
Size: 10962 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130529/326d07d3/attachment.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130529/326d07d3/attachment-0001.html>


More information about the llvm-commits mailing list