<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 - Add EXTRACT/INSERT_SUBVECTOR support to TTI::getShuffleCost"
   href="https://bugs.llvm.org/show_bug.cgi?id=39368">39368</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Add EXTRACT/INSERT_SUBVECTOR support to TTI::getShuffleCost
          </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>Common Code Generator Code
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>llvm-dev@redking.me.uk
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>a.bataev@hotmail.com, llvm-bugs@lists.llvm.org, spatel+llvm@rotateright.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The default horizontal reduction costs depend on EXTRACT_SUBVECTOR shuffle
costs, but we barely have support for these in the TTIs.

Several issues need to be addressed:

1 - correct identification of EXTRACT/INSERT_SUBVECTOR shufflevector patterns
in ShuffleVectorInst - we've ignored length changing shuffles so far.

EXTRACT is easy, just look for an unary sequential shuffle (I don't think we
need it to be subvector aligned - just include it in the getShuffleCost index
argument).

INSERT is trickier as we need to determine what the size of the subvector was,
so we need to search the IR for the source.

2 - Fix use of Index and SubTy in getShuffleCost calls - AFAICT the Index
should indicate the extraction/insertion point of the subvector and SubTy
should always refer to the subvector type (and Ty should refer to the larger
vector type - which for EXTRACT isn't the destination type).

3 - Add SK_InsertSubvector/SK_ExtractSubvector support to
BasicTTIImpl::getShuffleCosts similar to getPermuteShuffleOverhead.

4 - Add SK_InsertSubvector/SK_ExtractSubvector support to targets - X86 in
particular as the XMM/YMM/ZMM instructions have the most use for them.</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>