[LLVMdev] Loop vectorizer behaviour for 2D arrays and parallel annotation

Pekka Jääskeläinen
Wed, 17 Apr 2013 10:31:01 -0000

Hi Anadi Mishra,

On 04/17/2013 05:55 AM, Anadi Mishra wrote:
> Another question is regarding the isannotatedparallel() check. Is
> there a way to make clang (or any other frontend) to generate parallel
> annotated IR?

Paul Redmond was adding support for "#pragma ivdep" that would use the
parallel metadata, but I haven't been able to follow its progress lately.

FWIW, pocl's OpenCL kernel compiler adds the metadata to work-item loops.
That is, if your loop body was an OpenCL kernel with each work-item
executing a single iteration, it *might* get "horizontally vectorized"
using the loop vectorizer if you use pocl's 'loopvec' work group
method and
if the memory access pattern is suitable. This is quite fresh code which
I'm still optimizing, but I've already managed to autovectorize some
work
groups using it.

BR,
--
Pekka