<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] try harder to shuffle lower to vpermi2pd"
   href="https://bugs.llvm.org/show_bug.cgi?id=40500">40500</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[x86] try harder to shuffle lower to vpermi2pd
          </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>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>spatel+llvm@rotateright.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>craig.topper@gmail.com, llvm-bugs@lists.llvm.org, llvm-dev@redking.me.uk, spatel+llvm@rotateright.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Filing this based on a regression seen in the proposed D57336:
<a href="https://reviews.llvm.org/D57336">https://reviews.llvm.org/D57336</a>

This example is based on
"test/CodeGen/X86/avx512-shuffles/partial_permute.ll::test_8xdouble_to_4xdouble_perm_mask3()"

define <4 x double> @extract_splat(<8 x double> %x) {
  %x0123 = shufflevector <8 x double> %x, <8 x double> undef, <4 x i32> <i32 0,
i32 1, i32 2, i32 3>
  %x4567 = shufflevector <8 x double> %x, <8 x double> undef, <4 x i32> <i32 4,
i32 5, i32 6, i32 7>
  %x45 = shufflevector <4 x double> %x4567, <4 x double> undef, <2 x i32> <i32
0, i32 1>
  %x4444 = shufflevector <2 x double> %x45, <2 x double> undef, <4 x i32> <i32
0, i32 0, i32 0, i32 0>
  %x0214 = shufflevector <4 x double> %x0123, <4 x double> %x4444, <4 x i32>
<i32 0, i32 2, i32 1, i32 4>
  ret <4 x double> %x0214
}

$ llc -o - extractsplat.ll -mattr=avx512f
        vextractf64x4   $1, %zmm0, %ymm1
        vpermpd $216, %ymm0, %ymm0      # ymm0 = ymm0[0,2,1,3]
        vbroadcastsd    %xmm1, %ymm1
        vblendps        $192, %ymm1, %ymm0, %ymm0 # ymm0 =
ymm0[0,1,2,3,4,5],ymm1[6,7]
        retq

If I got the shuffles right, that's the same as:
vextractf64x4 $1, %zmm0, %ymm2
vmovapd {{.*#+}} ymm1 = [0,2,1,4]
vpermi2pd %ymm2, %ymm0, %ymm1
vmovapd %ymm1, %ymm0


So the more general "vpermi2pd" with constant-loaded permute op can be used to
replace the permpd+broadcast+blend.</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>