<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 - [X86][AVX512] suboptimal shuffle sequence instead of one vpermps instruction"
   href="https://bugs.llvm.org/show_bug.cgi?id=34370">34370</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[X86][AVX512] suboptimal shuffle sequence instead of one vpermps instruction
          </td>
        </tr>

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

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

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </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>ayman.musa@intel.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>For the following IR:

define <8 x float> @test(<8 x float>* %vp, <8 x float> %vec2) {
   %vec = load <8 x float>, <8 x float>* %vp
   %shuf = shufflevector <8 x float> %vec, <8 x float> undef, <8 x i32> <i32 7,
i32 6, i32 3, i32 0, i32 7, i32 6, i32 3, i32 0>
   %res = select <8 x i1> <i1 1, i1 1, i1 1, i1 0, i1 1, i1 1, i1 0, i1 0>, <8
x float> %shuf, <8 x float> %vec2
   ret <8 x float> %res
 }

<span class="quote">>> llc -mcpu=skx <file-name> -o out.s</span >

LLVM emits (showing 3.00 throughput on IACA tool):
     vpermilps   $59, (%rdi), %ymm1 # ymm1 = mem[3,2,3,0,7,6,7,4]
     vpermpd $102, %ymm1, %ymm1      # ymm1 = ymm1[2,1,2,1]
     movb    $55, %al
     kmovd   %eax, %k1
     vmovaps %ymm1, %ymm0 {%k1}
     retq

While it can be replaced with (showing 2.86 throughput on IACA tool):
     vmovaps .LCPI3327_0(%rip), %ymm1 # ymm1 = [7,6,3,0,7,6,3,0]
     movb $55, %al
     kmovd %eax, %k1
     vpermps (%rdi), %ymm1, %ymm0 {%k1}
     retq


** Throughput results from IACA tool => lower is better.</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>