Displaying 1 result from an estimated 1 matches for "23define".
2017 Nov 18
2
Is llvm capable of doing loop interchange optimization?
...like this:
#define N 100
void foo(int** __restrict__ a,
int** __restrict__ b)
{
for (int i = 0; i < N; ++i)
for (int j = 0; j < N; ++j)
a[j][i] += b[j][i];
}
link to compiler explorer:
https://gcc.godbolt.org/#g:!((g:!((g:!((h:codeEditor,i:(j:1,source:'%23define+N+100%0A%0Avoid+foo(int**+__restrict__+a,+%0A+++++++++int**+__restrict__+b)%0A%7B%0A++++for+(int+i+%3D+0%3B+i+%3C+N%3B+%2B%2Bi)%0A++++++++for+(int+j+%3D+0%3B+j+%3C+N%3B+%2B%2Bj)%0A++++++++++++a%5Bj%5D%5Bi%5D+%2B%3D+b%5Bj%5D%5Bi%5D%3B%0A%7D%0A%0Avoid+bar(int**+__restrict__+a,+%0A+++++++++int**+__res...