<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 - Restrict Clause stops vectorization"
href="https://bugs.llvm.org/show_bug.cgi?id=33710">33710</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Restrict Clause stops vectorization
</td>
</tr>
<tr>
<th>Product</th>
<td>libraries
</td>
</tr>
<tr>
<th>Version</th>
<td>4.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</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>Loop Optimizer
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>hahmed2305@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>// This function computes 2D-5 point Jacobi stencil
void stencil(int a[restrict][N], int b[restrict][N])
{
int i, j, k;
for (k = 0; k < N; k++) {
for (i = 1; i <= N-2; i++)
for (j = 1; j <= N-2; j++)
b[i][j] = 0.25 * (a[i][j] + a[i-1][j] + a[i+1][j] + a[i][j-1]
+ a[i][j+1]);
for (i = 1; i <= N-2; i++)
for (j = 1; j <= N-2; j++)
a[i][j] = b[i][j];
}
}
but no vectorization is occurred in IR. Also, when I set vector width
explicitly to 64, it gives the following error:
remark: <unknown>:0:0: loop not vectorized: call instruction cannot be
vectorized
remark: <unknown>:0:0: loop not vectorized: value that could not be identified
as reduction is used outside the loop
It is due to restrict clause. However, when the restrict clause is removed then
get vectorized IR code.</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>