This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

How to force gcc to vectorize the loop with particular vectorization width


Hello!

I have a hot inner loop which was vectorized by gcc, but I also want
compiler to unroll this loop by some factor.
It can be controled in clang with this pragma:
#pragma clang loop vectorize(enable) vectorize_width(8)
Please see example here:
https://godbolt.org/g/UJoUJn

So I want to tell gcc something like this:
"I want you to vectorize the loop. After that I want you to unroll
this vectorized loop by some defined factor."

I was playing with #pragma omp simd with the safelen clause, and
#pragma GCC optimize("unroll-loops") with no success. Compiler option
-fmax-unroll-times is not suitable for me, because it will affect
other parts of the code.

Is it possible to achieve this somehow?

-- 
Best regards,
Denis.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]