[LLVMdev] loop vectorizer misses opportunity, exploit

Renato Golin renato.golin at linaro.org
Thu Oct 31 09:35:23 PDT 2013


On 31 October 2013 08:01, Frank Winter <fwinter at jlab.org> wrote:

>  With current trunk I tried the following on the above example:
>
> clang++ -emit-llvm -S loop_minimal.cc -std=c++11
> opt -O3 -vectorize-slp -S loop_minimal.ll
> opt -O3 -loop-vectorize -S loop_minimal.ll
> opt -O3 -bb-vectorize -S loop_minimal.ll
>
> All optimization passes miss the opportunity. It seems the SCEV AA pass doesn't understand modulo arithmetic.
>
>
Hi Frank,

IIRC, opt -O3 will already pass all three, so you don't have to add it to
the command line.


How can the SCEV AA pass be extended to handle this type of arithmetic?
>
>
I'm not an SCEV expert, so it might be possible that it does understand,
but the loop vectorizer is not understanding the evolution info, or
whatever.

What I recommend is to step through the loop vectorizer (canVectorize) and
see what the SCEV returns to the vectorizer. If the info is there, but not
accounted for, it's a vectorizer bug. If the SCEV gets lost, than you need
to add it into the SCEV logic.

cheers,
--renato
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131031/0427103a/attachment.html>


More information about the llvm-dev mailing list