[PATCH] D46042: Cap vector alignment at 16 for all Darwin platforms

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 4 16:05:14 PDT 2018


rnk added a comment.

In https://reviews.llvm.org/D46042#1121674, @rjmccall wrote:

> > I think we should revert this for now. Adding the alignment attribute to all Intel vector typedefs is a bigger change than it seems.
>
> Ugh.  That is just an awful language rule.   Would it be reasonable to restrict it to only attributes spelled with `__declspec(align(N))` rather than `__attribute__((aligned(N)))`, or is that too invasive in the alignment computation?


When we were working on the record layout code, I didn't want to do that because users often structure their portability headers to check for `__clang__` first because clang also defines `_MSC_VER` and `__GNUC__`. I felt it would be best if the alignment attributes were as interchangeable as possible. They are very common.

Maybe checking the spelling of the packing attribute would work better. The GCC `__attribute__` spelling would ignore what we called "required alignment", meaning alignment required by explicit attributes and not the normal `alignof`.


Repository:
  rC Clang

https://reviews.llvm.org/D46042





More information about the cfe-commits mailing list