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

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



    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


    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



Please help to review the patch





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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>
-------------- 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: <>

More information about the llvm-commits mailing list