craig.topper added a comment.

The only use I could really see for this is to prevent a developers code from 
crashing when it’s distributed to someone else. For paranoia because it’s 
possible you have a bug and got lucky with alignment in your internal testing 
before you shipped.

If you need this your code has undefined behavior which should be fixed. You 
should not use this to make a known runtime exception go away.

Your code could still be miscompiled. For example, llvm really likes to replace 
ADD with OR when the bits don’t overlap. So it would be very easy to have your 
pointer arithmetic miscompiled because llvm believes a pointer is aligned but 
really isn’t.

Your code would not be portable to SSE. If your application does dynamic 
dispatch most of your users may get the AVX code path, but the smaller 
percentage on older hardware or cheaper hardware that doesn’t have AVX still 
get the exceptions.

I think you need to be very careful with how this feature is communicated.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99565/new/

https://reviews.llvm.org/D99565

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to