Does OpenMP hints bypass the vectorisation legality check in llvm

Tom,

Let me go a little deeper. Xinmin's answer is correct but a bit over-simplified.

There are parts of "legality" and "cost model" that OpenMP SIMD code has to go through, and current LV is rather unclear about it
---- due to historical reasons ---- and I'm trying to resolve them one small step at a time.
See http://lists.llvm.org/pipermail/llvm-dev/2018-January/120164.html.

For example, load/store masking is part of "legality" we have to enforce even for OpenMP SIMD code. Whether we run LVL.canVectorize()
or not, we still have to record such information so that correct vector code will be generated. Also, unless programmer specifies all "cost model
decisions", we still have to run cost model to fill the gap. There are many OpenMP SIMD loops w/o SIMDLEN clause ---- vectorizer needs to
decide the optimal VF for the loop.

Thanks,
Hideki

Hi Hideki,

Thanks for the info. That is extremely useful.

Cheers,

Tom