[llvm-dev] Does OpenMP hints bypass the vectorisation legality check in llvm
Tom Sun via llvm-dev
llvm-dev at lists.llvm.org
Fri Jan 19 00:38:36 PST 2018
I am currently looking into how "#pragma omp for simd" is actually
recognized in llvm. To my knowledge, clang will parse it and set
metadata in IR to indicate this force-vectorization hint and later
optimization passes would read it and vectorize the marked loop.
Therefore, the loop should be vectorized even the compiler think it
might not be safe to do so?
So my assumption is that such force-vectorization hints should bypass
both the vectorization legality and cost model check. However, in
LoopVectorize.cpp, I can't see how this is done. All loops will be sent
to a legality check of LVL.canVectorize() and, if this condition does
not fit, it return to false directly without actually reaching the
Is there anything wrong with my assumption made on the use of
Thanks in advance,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev