[llvm-commits] [PATCH][Instcombine, FAST-MATH] Some enhancement to Fmul

Chandler Carruth chandlerc at google.com
Wed Jan 2 17:53:36 PST 2013


On Wed, Jan 2, 2013 at 5:48 PM, Shuxin Yang <shuxin.llvm at gmail.com> wrote:

> Canonicalization will help if one of the operands is constant.
>

And in both of these patches, the optimizations only trigger when one of
the operands is constant.


> Otherwise, its meaning is pretty vague.  Consider the the case "(select c
> ? v1 : v2) * (m + n)", which form is canonical?
>    (select ...) * (.. + ... ) or "(..+...) * (select ...)?
>

Even here, I think it is fundamentally the right architecture to pick a
canonical form and rewrite to that form. If we get it wrong, it is easy to
fix. The codegen layer should reorder things however is best on the
architecture regardless of the particular ordering we canonicalize to in
the IR. The point of canonicalization is not that one form is "better" than
another, but merely to constrain the search space and improve our ability
to match patterns consistently.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130102/f71da34f/attachment.html>


More information about the llvm-commits mailing list