[PATCH] D86310: [X86] Align i128 to 16 bytes in x86-64 datalayout

Harald van Dijk via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 14 09:04:24 PDT 2023


hvdijk added a comment.

In D86310#4501240 <https://reviews.llvm.org/D86310#4501240>, @rnk wrote:

> In D86310#4501170 <https://reviews.llvm.org/D86310#4501170>, @hvdijk wrote:
>
>> For example, it would generally be better if long double were 8-byte-aligned, but the x86 32-bit ABI specifies that it is 4-byte-aligned, and that is set in stone. I would be against any change in LLVM's ABI that changed their alignment, even if it would speed up code.
>
> That may be your view, but other users rely on the `-malign-double` flag (D19734 <https://reviews.llvm.org/D19734>) to get the new behavior, despite the ABI concerns. Specifically, it mattered for users passing structs from CPU to GPU, because the GPU doesn't tolerate misaligned doubles well. With that in mind, I wouldn't describe this ABI rule as being "set in stone", but I understand your perspective.

As long as it is an option, it is fine, that will not cause compatibility issues.

> Returning to the patch at hand, it sounds like we have consensus that the next step is to teach auto-upgrade to traverse the module looking for uses of a particular type in structs and IR. That logic could be reused in the future to solve similar problems when we need to adjust the layout of exotic types.

That is not my understanding of the consensus that we have, that is something that you asked for, then asked who asked for it, and are now again asking for. I do not see anyone else having asked for this, and I repeat that I think it is an unreasonable amount of work.


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

https://reviews.llvm.org/D86310



More information about the cfe-commits mailing list