<html>
    <head>
      <base href="https://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 --- - Bugs in handling of i1 vectors + memory"
   href="https://llvm.org/bugs/show_bug.cgi?id=27600">27600</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Bugs in handling of i1 vectors + memory
          </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>Linux
          </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>Common Code Generator Code
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>fraser@codeplay.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I've come across several problems in the treatment of i1 vectors in expansion
and DAG combining code.

They, so far, all concern the assumption that vector element types are of size
<span class="quote">> 1 byte.</span >

The first few are in the expansion of build/extract/insert vector when
expanding through the stack:


SDValue SelectionDAGLegalize::ExpandVectorBuildThroughStack(SDNode* Node) {
  unsigned TypeByteSize = EltVT.getSizeInBits() / 8; -- Zero

  for (unsigned i = 0, e = Node->getNumOperands(); i != e; ++i) {
    unsigned Offset = TypeByteSize*i; // Always zero!


This means the offset from the stack is always 0, hence it'll load the wrong
element.

Same goes with ExpandExtractFromVectorThroughStack and
ExpandInsertToVectorThroughStack, from what I can see by reading the code.

Also buggy is DAGCombiner::ReplaceExtractVectorEltOfLoadWithNarrowedLoad. Same
problem - offsets of zero, combining to incorrect DAG result.

I haven't seen any more just yet, but I'll update this issue tracker if I find
more.</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>