https://llvm.org/bugs/show_bug.cgi?id=23800

            Bug ID: 23800
           Summary: Invalid shufflevector operands
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Created attachment 14452
  --> https://llvm.org/bugs/attachment.cgi?id=14452&action=edit
Test-case with produces the wrong code

The following (OpenCL) code results in undef operands of a shufflevector LLVM
IR instruction when compiled with clang.

$ clang -S -emit-llvm -O0 -o - input.c

Clang and LLVM have been built from trunk. The bug does not occur with "Apple
LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)".

Test-case:

typedef unsigned int uint16 __attribute((ext_vector_type(16)));
typedef unsigned int uint8 __attribute((ext_vector_type(8)));

void test1(void) {
    (uint16)(((uint16)0).s0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
}

Part of LLVM IR:

%5 = shufflevector <16 x i32> %3, <16 x i32> undef, <16 x i64> <i64 0, i64
undef, i64 undef, i64 undef, i64 undef, i64 undef, i64 undef, i64 undef, i64
undef, i64 undef, i64 undef, i64 undef, i64 undef, i64 undef, i64 undef, i64
undef>

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to