[llvm-bugs] [Bug 39062] New: bracket vs. vector-cast precedence for OpenCL

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Sep 24 11:27:51 PDT 2018


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: unassignedclangbugs at nondot.org
          Reporter: pjcoup at gmail.com
                CC: llvm-bugs at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180924/be62547a/attachment.html>


More information about the llvm-bugs mailing list