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

Matthieu Dubet maattdd at gmail.com
Thu Oct 17 07:15:42 PDT 2013


Even if I know the size of the array, I'm not always iterating through it
entirely so the loop count has to be a variable, but the vectorizer works
fine even with a loop limit not constant when compiling C code from Clang
for example so I should be able to do the same for this code .. (hopefully
:) )

Matthieu


On Thu, Oct 17, 2013 at 4:53 AM, James Courtier-Dutton <
james.dutton at gmail.com> wrote:

> If what you are saying is that you know the array of i32 will always be 10
> entries, make the function use a constant limit=10 to the loop.
> I.e Make the loop limit a constant and not a variable.
>
>
>
> On 11 October 2013 18:27, Matthieu Dubet <maattdd at gmail.com> wrote:
>
>> Hi,
>>
>> I'm creating a small function in LLVM which gets as a parameter an i32*
>> (this function is called from C code) .
>>
>> However I know that this pointer is actually a C array of size 10 (
>> int[10] ).
>>
>> How can I tell LLVM to consider this i32* as an <10 x i32> (and thus get
>> the performance improvements thanks to SIMD ..etc..) ?
>>
>> Thanks,
>> Matthieu
>>
>> _______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131017/dbdadfa0/attachment.html>


More information about the llvm-dev mailing list