<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 --- - Assertion failed: isValidElementType(ElementType) && "Elements of a VectorType must be a primitive type""
   href="http://llvm.org/bugs/show_bug.cgi?id=19271">19271</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion failed: isValidElementType(ElementType) && "Elements of a VectorType must be a primitive type"
          </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>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Core LLVM classes
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>greg_bedwell@sn.scee.net
          </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>I found this issue doing some random code generation testing on trunk.  Here's
a reduced IR example:

---------------- >8 ---------------- 
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-win32"

@"\01?id2710@@3U__m128d@@A" = global <2 x double> zeroinitializer, align 16
@"\01?id2729@@3U__m128d@@A" = global <2 x double> zeroinitializer, align 16

; Function Attrs: nounwind readnone
define <2 x i32> @"\01?test80@@YAT__clang_vec2_J@@XZ"() #0 {
entry:
  %id2709 = alloca i32, align 4
  %id2718 = alloca i32, align 4
  %id2708 = alloca <2 x i32>, align 8
  %0 = load <2 x double>* @"\01?id2710@@3U__m128d@@A", align 16
  %1 = load <2 x double>* @"\01?id2710@@3U__m128d@@A", align 16
  %2 = call i32 @llvm.x86.sse2.comilt.sd(<2 x double> %0, <2 x double> %1)
  store i32 %2, i32* %id2709, align 4
  %3 = load <2 x double>* @"\01?id2710@@3U__m128d@@A", align 16
  %4 = load <2 x double>* @"\01?id2729@@3U__m128d@@A", align 16
  %5 = call i32 @llvm.x86.sse2.comilt.sd(<2 x double> %3, <2 x double> %4)
  store i32 %5, i32* %id2718, align 4
  %6 = load i32* %id2709, align 4
  %7 = load i32* %id2718, align 4
  %8 = insertelement <2 x i32> undef, i32 %6, i32 0
  %9 = insertelement <2 x i32> %8, i32 %7, i32 1
  %10 = bitcast <2 x i32> %9 to x86_mmx
  %11 = bitcast x86_mmx %10 to <2 x i32>
  store <2 x i32> %11, <2 x i32>* %id2708, align 8
  %12 = load <2 x i32>* %id2708, align 8
  ret <2 x i32> %12
}

; Function Attrs: nounwind readnone
declare i32 @llvm.x86.sse2.comilt.sd(<2 x double>, <2 x double>) #0

attributes #0 = { nounwind readnone }
---------------- >8 ---------------- 

$ opt --version
LLVM (<a href="http://llvm.org/">http://llvm.org/</a>):
  LLVM version 3.5.0svn
  DEBUG build with assertions.
  Built Mar 27 2014 (12:43:39).
  Default target: x86_64-pc-win32
  Host CPU: corei7-avx

$ opt reduced.ll -instcombine -slp-vectorizer -S
Assertion failed: isValidElementType(ElementType) && "Elements of a VectorType
must be a primitive type", file C:\work\public_svn\llvm\lib\IR\Type.cpp, line
707


and for reference here is the original C++ testcase:

---------------- >8 ---------------- 
typedef long __m64 __attribute__((__vector_size__(8)));
typedef long __m128d __attribute__((__vector_size__(16)));
__m128d id2710;
__m128d id2729;
__m64 test80() {
  int id2709 = __builtin_ia32_comisdlt(id2710, id2710);
  int id2718 = __builtin_ia32_comisdlt(id2710, id2729);
  __m64 id2708 = __builtin_ia32_vec_init_v2si(id2709, id2718);
  return id2708;
}
---------------- >8 ---------------- 

$ clang --version
clang version 3.5.0 (204962)
Target: x86_64-pc-win32
Thread model: posix

$ clang -S -O2 repro.cpp
Assertion failed: isValidElementType(ElementType) && "Elements of a VectorType
must be a primitive type", file C:\work\public_svn\llvm\lib\IR\Type.cpp, line
707
clang.exe: error: clang frontend command failed with exit code 3 (use -v to see
invocation)</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>