Dear all,
I have just created a couple of differential reviews to enable the
vectorisation of loops that have function calls to routines marked with
“#pragma omp declare simd”.
They can be (re)viewed here:
* https://reviews.llvm.org/D27249
* https://reviews.llvm.org/D27250
The current implementation allows the loop vectorizer to generate vector
code for source file as:
#pragma omp declare simd
double f(double x);
void aaa(double *x, double *y, int N) {
for (int i = 0; i < N; ++i) {
x[i] = f(y[i]);
}
}
by invoking clang with arguments:
$> clang -fopenmp -c -O3 file.c […]
Such functionality should provide a nice interface for vector libraries
developers that can be used to inform the loop vectorizer of the
availability of an external library with the vector implementation of the
scalar functions in the loops. For this, all is needed to do is to mark
with “#pragma omp declare simd” the function declaration in the header
file of the library and generate the associated symbols in the object file
of the library according to the name scheme of the vector ABI (see notes
below).
I am interested in any feedback/suggestion/review the community might have
regarding this behaviour.
Below you find a description of the implementation and some notes.
Thanks,
Francesco