[llvm-bugs] [Bug 23116] Missed optimisation - horizontal max for vectors is not optimised.

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Feb 4 10:58:02 PST 2021


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

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

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

--- Comment #11 from Sanjay Patel <spatel+llvm at rotateright.com> ---
After:
https://reviews.llvm.org/rG056d31dd2a04 (and several other patches as noted)

And with: 
$ clang -O2 23116.c -S -o - -fno-signed-zeros -ffinite-math-only -mavx

We finally have the ideal output with the minimal relaxed FP settings:
        vextractf128    $1, %ymm0, %xmm1
        vmaxps  %xmm1, %xmm0, %xmm0
        vpermilpd       $1, %xmm0, %xmm1        ## xmm1 = xmm0[1,0]
        vmaxps  %xmm1, %xmm0, %xmm0
        vmovshdup       %xmm0, %xmm1            ## xmm1 = xmm0[1,1,3,3]
        vmaxss  %xmm1, %xmm0, %xmm0
        vzeroupper
        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/20210204/d2acd605/attachment.html>


More information about the llvm-bugs mailing list