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

Anadi Mishra reachanadi at gmail.com
Wed Apr 17 09:29:45 PDT 2013


On Wed, Apr 17, 2013 at 8:08 AM, Tobias Grosser <tobias at grosser.es> wrote:
> On 04/17/2013 04:55 AM, Anadi Mishra wrote:
>>
>> Hello,
>>
>> I am trying to vectorize the following loop but the vectorizer says:
>> "Found a possible write-write reorder" and does not vectorize.
>> Why?
>
>
> To my knowledge, the dependence analysis in the loop vectorizer is not yet
> able to prove the absence of dependences here.

While that is true, the debug message printed by the vectorizer is
misleading, which should not be.

>>
>> Another question is regarding the isannotatedparallel() check. Is
>> there a way to make clang (or any other frontend) to generate parallel
>> annotated IR?
>
>
> Did you try to put '#pragma ivdep' before the loop.

Thanks for the suggestion, it worked using the latest llvm from svn.
Thanks Pekka and Paul for your inputs.

>
> Tobias
>
> P.S.: Please attach a full C file as test case. The way the different data
> structures are declared my influence the analysis.

PFA the example.

-Best,
Anadi.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: example.c
Type: text/x-csrc
Size: 611 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130417/a101a71e/attachment.c>


More information about the llvm-dev mailing list