<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:spatel+llvm@rotateright.com" title="Sanjay Patel <spatel+llvm@rotateright.com>"> <span class="fn">Sanjay Patel</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - Missed optimisation - horizontal max for vectors is not optimised."
   href="https://bugs.llvm.org/show_bug.cgi?id=23116">bug 23116</a>
          <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>FIXED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - Missed optimisation - horizontal max for vectors is not optimised."
   href="https://bugs.llvm.org/show_bug.cgi?id=23116#c11">Comment # 11</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - Missed optimisation - horizontal max for vectors is not optimised."
   href="https://bugs.llvm.org/show_bug.cgi?id=23116">bug 23116</a>
              from <span class="vcard"><a class="email" href="mailto:spatel+llvm@rotateright.com" title="Sanjay Patel <spatel+llvm@rotateright.com>"> <span class="fn">Sanjay Patel</span></a>
</span></b>
        <pre>After:
<a href="https://reviews.llvm.org/rG056d31dd2a04">https://reviews.llvm.org/rG056d31dd2a04</a> (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</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>