chf...@pathscale:~/gcc$ cat foo.c float a[100][100], b[100][100]; void foo(int n) { int i, j; for(j=0; j<n; j++) for(i=0; i< n; i++) a[i][j] = a[i][j] + b[i][j]; } chf...@pathscale:~/gcc$ gcc -O3 -ftree-vectorizer-verbose=2 -c foo.c
foo.c:6: note: not vectorized: can't create epilog loop 2. foo.c:7: note: not vectorized: complicated access pattern. foo.c:3: note: vectorized 0 loops in function. Information from open64: chf...@pathscale:~/gcc$ opencc -O3 -LNO:simd_verbose=on -c foo.c (foo.c:0) LOOP WAS VECTORIZED. (foo.c:0) LOOP WAS VECTORIZED. chf...@pathscale:~/gcc$ opencc -O3 -LNO:simd_verbose=on:interchange=0 -c foo.c (foo.c:0) Non-contiguous array "a" reference exists. Loop was not vectorized. (foo.c:0) Non-contiguous array "a" reference exists. Loop was not vectorized. Graphite may be able to do this basic loop interchange. -- Summary: The loop is not interchanged and thus could not be vectorized. Product: gcc Version: 4.5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: changpeng dot fang at amd dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43427