[LLVMbugs] [Bug 19271] New: Assertion failed: isValidElementType(ElementType) && "Elements of a VectorType must be a primitive type"

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Mar 27 23:53:18 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=19271

            Bug ID: 19271
           Summary: Assertion failed: isValidElementType(ElementType) &&
                    "Elements of a VectorType must be a primitive type"
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Core LLVM classes
          Assignee: unassignedbugs at nondot.org
          Reporter: greg_bedwell at sn.scee.net
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

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 (http://llvm.org/):
  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)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140328/e532ebfa/attachment.html>


More information about the llvm-bugs mailing list