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

            Bug ID: 39062
           Summary: bracket vs. vector-cast precedence for OpenCL
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: OpenCL
          Assignee: unassignedclangb...@nondot.org
          Reporter: pjc...@gmail.com
                CC: llvm-bugs@lists.llvm.org

Created attachment 20911
  --> https://bugs.llvm.org/attachment.cgi?id=20911&action=edit
.cl precedence difference

We ran into the following difference.  The behavior here seemed to change
between LLVM 4 and LLVM 5.
On the attached, there is a difference in compiling:
typedef int int4 __attribute__((ext_vector_type(4)));
void s(int4 *x, const int* y) {
  x[0] = (int4)(y)[0];
}

with clang -x c vs. clang -x cl

clang -O2 -x c -S -emit-llvm gives:
  %3 = load i32, i32* %1, align 4, !tbaa !3
  %4 = insertelement <4 x i32> undef, i32 %3, i32 0
  %5 = shufflevector <4 x i32> %4, <4 x i32> undef, <4 x i32> zeroinitializer

while clang -O2 -x cl -S -emit-llvm gives:
  %3 = ptrtoint i32* %1 to i32
  %4 = insertelement <4 x i32> undef, i32 %3, i32 0
  %5 = shufflevector <4 x i32> %4, <4 x i32> undef, <4 x i32> zeroinitializer

Is this intentional?

-- 
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