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

            Bug ID: 26460
           Summary: int3 __builtin_astype(x, short8) asserts for OpenCL
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangb...@nondot.org
          Reporter: pjc...@gmail.com
                CC: llvm-bugs@lists.llvm.org
    Classification: Unclassified

For this file:

typedef int int3 __attribute__((ext_vector_type(3)));
typedef short short8 __attribute((ext_vector_type(8)));

int get(short8 x) {
  int3 y = __builtin_astype(x, int3);
  return y[0];
}

clang -S -emit-llvm -x cl hits the following assert:
 /home/peter/llvm/llvm-trunk-git/llvm/lib/IR/Instructions.cpp:2572: static
llvm::CastInst* llvm::CastInst::Create(llvm::Instruction::CastOps,
llvm::Value*, llvm::Type*, const llvm::Twine&, llvm::Instruction*): Assertion
`castIsValid(op, S, Ty) && "Invalid cast!"' failed.

int3 <-> int4 __builtin_astype works, as does short8 <-> int4.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to