jhuber6 wrote:

> Deferencing a pointer, __builtin_memcpy, and most other operations that 
> involve accessing pointers, currently assume pointers are naturally aligned. 
> The exact representation of this in LLVM IR varies, but the fundamental 
> assumption is that you're following normal C/C++ standard rules for pointer 
> alignment.
> 
> My concern here is mostly consistency: I don't want to have this small 
> cluster of vector intrinsics to have different rules from everything else.
> 
> The reason I mentioned changing the interface before is related to this: if 
> the masked load/store intrinsics take a pointer to the element type, instead 
> of the vector type, that naturally reduces the required alignment. The 
> element pointer will have smaller alignment.

I see, it's certainly possible to just make the pointer to a scalar type and 
then use the mask's width to infer the overall size. I ended up doing that in 
https://github.com/llvm/llvm-project/pull/157895 and could apply it here if 
needed. That would lower the alignment to just the element type I suppose. I'm 
mostly worried about making this builtin too restrictive by increasing it 
beyond the 'standard' alignment you get on most platforms (16 AFAIK). Would it 
be reasonable to do that here? We haven't made a release yet so all this stuff 
is still able to be changed fortunately.

https://github.com/llvm/llvm-project/pull/156063
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to