[llvm-bugs] [Bug 45747] [VectorCombine] Generated code no longer uses horizontal add/sub

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jul 28 12:33:02 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=45747

Sanjay Patel <spatel+llvm at rotateright.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #6 from Sanjay Patel <spatel+llvm at rotateright.com> ---
Simon added more x86 codegen combiner magic to clean this up with:
https://github.com/llvm/llvm-project/commit/182111777b4ec215eeebe8ab5cc2a324e2f055ff

And that got backported to the 11.0 release (bug 46869).

So I think it's safe to close this one. The 1st test is improved to a single
hadd (no shuffle), and the 2nd test uses vpermilps which should have the same
perf as vmovshdup.

$ clang 45747.c -S -O2 -S -o - -march=btver2

_add_ps_002:                            ## @add_ps_002
        vhaddps %xmm0, %xmm0, %xmm0
        retq

_add_ps_013:                            ## @add_ps_013
        vhaddps %xmm1, %xmm1, %xmm0
        vpermilps       $231, %xmm0, %xmm0      ## xmm0 = xmm0[3,1,2,3]
        retq

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200728/1b4950cf/attachment.html>


More information about the llvm-bugs mailing list