Fix PR 17368: disable unnecessary vector multiplication distribution for square of add/sub on ARM

Weiming Zhao weimingz at codeaurora.org
Wed Sep 25 12:13:59 PDT 2013


Hi,

 

    Generally, it is desirable to transform "(a + b) * c" to "a*c + b*c" for

ARM with VMLx Forwarding, where a, b and c are vectors.

 

    However, for (a + b)*(a + b), distribution will result in one extra

    instruction.

    With distribution:

       x = a + b (vadd)

       y = a * x (vmul)

       z = y + b * y (vmla)

    

    Without distribution:

       x = a + b (vadd)

       z = x * x (vmul)

    

    This patch detects if a mul is a square of add/sub. If yes, skip

    distribution.

 

Please help to review the patch

 

Thanks,

Weiming

 

Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by
The Linux Foundation

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130925/2e366d7a/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-PR-17368-disable-vector-multiplication-distribution-.patch
Type: application/octet-stream
Size: 2948 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130925/2e366d7a/attachment.obj>


More information about the llvm-commits mailing list