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

            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: [email protected]
          Reporter: [email protected]
                CC: [email protected]

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

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to