<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </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 --- - New vector shuffle legality: turns blendp+permp to permp+permilp+blendp."
   href="http://llvm.org/bugs/show_bug.cgi?id=22412">22412</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>New vector shuffle legality: turns blendp+permp to permp+permilp+blendp.
          </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>normal
          </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>ahmed.bougacha@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=13784" name="attach_13784" title="IR testcase">attachment 13784</a> <a href="attachment.cgi?id=13784&action=edit" title="IR testcase">[details]</a></span>
IR testcase

For the attached IR, we used to generate (targeting core-avx2):

    vblendpd    $1, %ymm0, %ymm1, %ymm0 ## ymm0 = ymm0[0],ymm1[1,2,3]
    vmovaps    LCPI0_0(%rip), %ymm1    ## ymm1 = [1,0,7,6,5,4,3,2]
    vpermps    %ymm0, %ymm1, %ymm0

With the new all-shuffles-are-legal lowering, we now generate:

    vmovaps    LCPI0_0(%rip), %ymm2    ## ymm2 = <u,u,7,6,5,4,3,2>
    vpermps    %ymm1, %ymm2, %ymm1
    vpermilps    $225, %ymm0, %ymm0 ## ymm0 = ymm0[1,0,2,3,5,4,6,7]
    vblendpd    $1, %ymm0, %ymm1, %ymm0 ## ymm0 = ymm0[0],ymm1[1,2,3]</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>