diff options
author | Jonas Paulsson <paulsson@linux.vnet.ibm.com> | 2023-02-08 19:37:47 +0100 |
---|---|---|
committer | Jonas Paulsson <paulsson@linux.vnet.ibm.com> | 2023-03-15 12:46:06 +0100 |
commit | 7501e53b8d6d7563b047a34d0141630d5afc86c5 (patch) | |
tree | f831360dbea921b733bdfa3a7cf107e572cc62e3 /clang/unittests/libclang/LibclangTest.cpp | |
parent | 36278b735fa193c954bf38c82ca81a5608bc5187 (diff) | |
download | llvm-7501e53b8d6d7563b047a34d0141630d5afc86c5.zip llvm-7501e53b8d6d7563b047a34d0141630d5afc86c5.tar.gz llvm-7501e53b8d6d7563b047a34d0141630d5afc86c5.tar.bz2 |
[Clang] Give warning for an underaligned 128-bit __sync library call.
On SystemZ, int128 values are generally aligned to only 8 bytes per the ABI
while 128 bit atomic ISA instructions exist with a full 16 byte alignment
requirement.
__sync builtins are emitted as atomicrmw instructions which always require
the natural alignment (16 bytes in this case), and they always get it
regardless of the alignment of the value being addressed.
This patch improves this situation by giving a warning if the alignment is
not known to be sufficient. This check is done in CodeGen instead of in Sema
as this is currently the only place where the alignment can be computed. This
could/should be moved into Sema in case the alignment computation could be
made there eventually.
Reviewed By: efriedma, jyknight, uweigand
Differential Revision: https://reviews.llvm.org/D143813
Diffstat (limited to 'clang/unittests/libclang/LibclangTest.cpp')
0 files changed, 0 insertions, 0 deletions