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

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 24 21:17:06 PDT 2018


rjmccall created this revision.
Herald added a reviewer: javed.absar.
Herald added subscribers: cfe-commits, kristof.beyls.

This fixes two major problems:

- We were not capping vector alignment as desired on 32-bit ARM.
- We were using different alignments based on the AVX settings on Intel, so we did not have a consistent ABI.

This is an ABI break, but we think we can get away with it because vectors tend to be used mostly in inline code (which is why not having a consistent ABI has not proven disastrous on Intel).

Intel's AVX types are specified as having 32-byte / 64-byte alignment, so align them explicitly instead of relying on the base ABI rule.  Note that this sort of attribute is stripped from template arguments in template substitution, so there's a possibility that code templated over vectors will produce inadequately-aligned objects.


Repository:
  rC Clang

https://reviews.llvm.org/D46042

Files:
  lib/Basic/Targets/OSTargets.h
  lib/Basic/Targets/X86.h
  lib/CodeGen/CGBuiltin.cpp
  lib/Headers/avx512fintrin.h
  lib/Headers/avxintrin.h
  test/CodeGen/arm-swiftcall.c
  test/CodeGen/vector-alignment.c
  test/CodeGenCXX/align-avx-complete-objects.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46042.143862.patch
Type: text/x-patch
Size: 20091 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180425/a20c86be/attachment-0001.bin>


More information about the cfe-commits mailing list