[X86][AVX] Ensure vector non-temporal load/store intrinsics force pointer alignment...
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 29 Jul 2017 15:33:34 +0000 (15:33 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 29 Jul 2017 15:33:34 +0000 (15:33 +0000)
commitc14865c0c5e3fb3625954f92b5b207ff95376e01
treee7da85e02d9f57a60f7b697ead59cc54092f378e
parent40d01f3cb52f5044988e8df3a85137110a691476
[X86][AVX] Ensure vector non-temporal load/store intrinsics force pointer alignment (PR33830)

Clang specifies a max type alignment of 16 bytes on darwin targets (annoyingly in the driver not via cc1), meaning that the builtin nontemporal stores don't correctly align the loads/stores to 32 or 64 bytes when required, resulting in lowering to temporal unaligned loads/stores.

This patch casts the vectors to explicitly aligned types prior to the load/store to ensure that the require alignment is respected.

Differential Revision: https://reviews.llvm.org/D35996

llvm-svn: 309488
clang/lib/Headers/avx2intrin.h
clang/lib/Headers/avx512fintrin.h
clang/lib/Headers/avxintrin.h
clang/test/CodeGen/x86-nontemporal.c