[llvm-bugs] [Bug 33710] New: Restrict Clause stops vectorization

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jul 7 05:44:36 PDT 2017


            Bug ID: 33710
           Summary: Restrict Clause stops vectorization
           Product: libraries
           Version: 4.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Loop Optimizer
          Assignee: unassignedbugs at nondot.org
          Reporter: hahmed2305 at gmail.com
                CC: llvm-bugs at lists.llvm.org

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

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/20170707/d4ba4c10/attachment.html>

More information about the llvm-bugs mailing list