[llvm-dev] LoopVectorize module - some possible enhancements

Renato Golin via llvm-dev llvm-dev at lists.llvm.org
Tue Aug 23 05:00:15 PDT 2016

Hi Alex,

Intel was doing the scatter/gather support for AVX, so I'm copying
Elena who should know more about this.


On 21 August 2016 at 21:15, Alex Susu via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
>   Hello, Michael,
>     I'd like to ask if we can enhance the LoopVectorize LLVM module (I am
> currently using a version from Jul 2016).
>     More exactly:
>     - do you envision to support in the near future LLVM IR gather and
> scatter intrinsics (as described at
> http://llvm.org/docs/LangRef.html#llvm-masked-gather-intrinsics and
> scatter)?
>       I see you have defined some methods that should use them like:
>         - bool isLegalMaskedGather(Type *DataType);
>         - void InnerLoopVectorizer::vectorizeMemoryInstruction(Instruction
> *Instr) which defines a bool CreateGatherScatter, etc
>       I gave to clang a simple vector add C program with step/stride 2 with
> flag "-avx2", but the resulting vector code does NOT use gather nor scatter.
>     - did you try to consider pathological cases of loops such as:
>       for (int i = 0; i < N; i += 2) {
>           C[i/2] = A[i/2] + B[i/2];
>       }
>      which does NOT get vectorized with my version of LoopVectorize,
> although it's simple to reason it's trivial to vectorize.
>     One more question: how can I obtain an expression for the bounds and the
> step of the original loop? For example, when I print the ScalarEvolution
> object in LoopVectorizationLegality::isConsecutivePtr(), I can get the value
> reported in "Exits" for the indvars.iv instruction which is the upper bound
> for the loop getting vectorized.
>   Thank you,
>     Alex
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

More information about the llvm-dev mailing list