<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - AVX-512: Horizontal add pattern match does not work on <16 x i32> vectors"
   href="https://bugs.llvm.org/show_bug.cgi?id=33758">33758</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>AVX-512: Horizontal add pattern match does not work on <16 x i32> vectors
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Backend: X86
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>elena.demikhovsky@intel.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=18782" name="attach_18782" title="Hadd example for <8 x i32> and <16 x i32> cases">attachment 18782</a> <a href="attachment.cgi?id=18782&action=edit" title="Hadd example for <8 x i32> and <16 x i32> cases">[details]</a></span>
Hadd example for <8 x i32> and <16 x i32> cases

The phadd instruction is not chosen from <16 x i32> shuffles+add combination.
This affects reduction tail code.

The same pattern generates better sequence on <8 x i32> code and on AVX2
target.

        vpshufd $238, %zmm0, %zmm1
        vpaddd  %zmm1, %zmm0, %zmm0
        vpshufd $229, %zmm0, %zmm1 
        vpaddd  %zmm1, %zmm0, %zmm0
        vmovd   %xmm0, %eax

better sequence:

        vpshufd $238, %zmm0, %zmm1
        vpaddd  %zmm1, %zmm0, %zmm0
        vphadd  %zmm0, %zmm0, %zmm0
        vmovd   %xmm0, %eax

run llc -skx < hadd.ll to reproduce</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>