<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 - Assertion failed: `NumElements > 0 && "#Elements of a VectorType must be greater than 0"'"
   href="https://bugs.llvm.org/show_bug.cgi?id=39893">39893</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion failed: `NumElements > 0 && "#Elements of a VectorType must be greater than 0"'
          </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>russell_gallop@sn.scee.net
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>$ cat test.cpp
typedef int __attribute__((ext_vector_type(2))) d;
typedef char __attribute__((ext_vector_type(2))) e;
typedef char __attribute__((ext_vector_type(8))) f;
typedef union {
  d a;
  f b;
} g;
f h;
d j;
void k() {
  g l;
  l.a = - j;
  volatile e m = __builtin_shufflevector(h, l.b, 10, 4);
}
$ clang -c -O1 test.cpp
clang-8: .../llvm/lib/IR/Type.cpp:607: static llvm::VectorType*
llvm::VectorType::get(llvm::Type*, unsigned int): Assertion `NumElements > 0 &&
"#Elements of a VectorType must be greater than 0"' failed.

Introduced at r345602.

Author: Sanjay Patel <<a href="mailto:spatel@rotateright.com">spatel@rotateright.com</a>>
Date:   Tue Oct 30 14:14:34 2018 +0000

[DAGCombiner] narrow vector binops when extraction is cheap

    Narrowing vector binops came up in the demanded bits discussion in D52912.

    I don't think we're going to be able to do this transform in IR as a
canonicalization
    because of the risk of creating unsupported widths for vector ops, but we
already have
    a DAG TLI hook to allow what I was hoping for: isExtractSubvectorCheap().
This is
    currently enabled for x86, ARM, and AArch64 (although only x86 has existing
regression
    test diffs).

    This is artificially limited to not look through bitcasts because there are
so many
    test diffs already, but that's marked with a TODO and is a small follow-up.

    Differential Revision: <a href="https://reviews.llvm.org/D53784">https://reviews.llvm.org/D53784</a></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>