[LLVMdev] Vectors in structures

Bob Wilson bob.wilson at apple.com
Tue Sep 21 10:24:03 PDT 2010


On Sep 21, 2010, at 10:14 AM, Renato Golin wrote:

> On 21 September 2010 18:03, Bob Wilson <bob.wilson at apple.com> wrote:
>> Because that is what ARM has specified?  They define the vector types that are used with their NEON intrinsics as "containerized vectors".  Perhaps someone on the list from ARM can explain why they did it that way.
> 
> That's ok, but why do you need to do that in the IR? I mean, in the
> end, the boilerplate will be optimized away and all that's left will
> be the vector instruction, either compiled or JITed.

The intrinsics are defined as ordinary C functions in <arm_neon.h>.  They use the containerized vector types.  So, you've got C code using structures, and at some point we want to remove those structures and expose the underlying vector types.  We rely on llvm's SROA optimizations to do that.  If you're suggesting that the front-end should optimize away the structures before even generating the llvm IR, that is definitely possible.  It would require more code in the front-end.  As long as SROA succeeds in optimizing away the cruft, why does it matter?  I suppose there might be some effect on compile-time, but I'd be surprised if it is significant.



More information about the llvm-dev mailing list