[LLVMdev] loop vectorizer erroneously finds 256 bit vectors

Renato Golin renato.golin at linaro.org
Sun Nov 10 07:06:11 PST 2013


On 10 November 2013 06:48, Frank Winter <fwinter at jlab.org> wrote:

>  This is still strange: Why is this the only IR where 256 bit vectors are
> found and for all other functions it finds 128 bit vectors. This should be
> independent of the IR, right? So far I have tested a bunch of about 20
> functions generated and vectorized with this method. When processing all
> but this one the loop vectorizer finds 128 bit vectors as the widest. Only
> for this IR the loop vectorizer 'sees' the 256 bit version. Any idea?
>

Hi Frank,

The vectorization factor is computed depending on the type size and the
ability to use instructions on the varying vector sizes, and that depends
not only on the register width, but also on the available instructions on
the target. Furthermore, the cost of operations is taken into account, so
if the cost of shuffling/scattering 8 lanes might be twice as much as 4
lanes, and that might stop/redirect vectorization.

I don't know AVX that well, but it's possible that some operations are not
available on 256-bit width vectors, so the vectorizer uses the least
requirement, which in your other examples, was 128-bit.

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


More information about the llvm-dev mailing list