[LLVMdev] Converting a i32 pointer to a vector of i32 ( C array to LLVM vector)

Renato Golin renato.golin at linaro.org
Fri Oct 11 10:40:09 PDT 2013


On 11 October 2013 18:27, Matthieu Dubet <maattdd at gmail.com> wrote:

> How can I tell LLVM to consider this i32* as an <10 x i32> (and thus get
> the performance improvements thanks to SIMD ..etc..) ?
>

Hi Matthieu,

You shouldn't need to do anything, the vectorizer should spot that for you,
if the machine you're compiling to has support for vector instructions. Any
kind of vector operations that you may want to hard-code will make it not
work on anything other than the intrinsics/inline asm you're using, which
is not a good idea.

If your code didn't get vectorized, it's possible that it is not clear
enough that that pointer is being iterated in a way that it's easy for the
vectorizer to spot, so maybe you need to make it clearer, and that depends
on the code in question. If you could share the code (or a similar example)
with the list, people could help you spot the pattern and make it vectorize.

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


More information about the llvm-dev mailing list