[LLVMdev] Vectors in structures

Renato Golin rengolin at systemcall.org
Tue Sep 21 10:33:45 PDT 2010


On 21 September 2010 18:24, Bob Wilson <bob.wilson at apple.com> wrote:
> 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.

I see your point, and I'm not concerned with compilation time. All
that code is reused by casting structures to vectors or something like
that and gets optimized away automatically.

However, Clang is already doing a lot of work in the front-end, since
the operations are correct (adds, intinsics) where in arm_neon.h the
function calls are transformed into a series of similar functions with
slightly different parameters.

It means that Clang is, at least, recognizing the correct functions
and transforming into the appropriate instructions. Why not go a step
further and minimize what needs optimizing in the back-end?

But as you said, in GCC compatibility mode it's pure vector, so it's
good enough. And I agree that it's not necessary, I was just
curious... Thanks! ;)

-- 
cheers,
--renato

http://systemcall.org/

Reclaim your digital rights, eliminate DRM, learn more at
http://www.defectivebydesign.org/what_is_drm




More information about the llvm-dev mailing list