[llvm-dev] Loop vectorizer doesn't try to align vectors on preferred vector alignment

Benoit Meister via llvm-dev llvm-dev at lists.llvm.org
Wed Apr 11 15:24:33 PDT 2018


Hello,

I'm playing around with vectorization in LLVM 6.0.0, and I noticed that
when creating a vector load out of a scalar load, the  alignment for the
vector load is defined to be the one of the scalar load. For instance,
16-bit vectors get aligned on 2 bytes. This does not correspond to the
preferred alignment for vectors that I specified in the data layout (which
is bigger).

Inspecting lib/Transforms/Vectorize/LoopVectorizer.cpp, there doesn't seem
to be an intent of doing so.
I looked at this method in particular:

void InnerLoopVectorizer::vectorizeMemoryInstruction

Is there a way (that I missed) to make this happen, or would it require a
code change ? Or did I miss anything obvious ?

Thanks in advance,
- Benoit
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180411/a6fc5a6d/attachment.html>


More information about the llvm-dev mailing list