<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - bracket vs. vector-cast precedence for OpenCL"
href="https://bugs.llvm.org/show_bug.cgi?id=39062">39062</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>bracket vs. vector-cast precedence for OpenCL
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>OpenCL
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>pjcoup@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=20911" name="attach_20911" title=".cl precedence difference">attachment 20911</a> <a href="attachment.cgi?id=20911&action=edit" title=".cl precedence difference">[details]</a></span>
.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?</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>