[PATCH] D88396: [X86] Replace movaps with movups when avx is enabled.

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 30 00:05:33 PDT 2020


lebedev.ri added a comment.

In D88396#2302469 <https://reviews.llvm.org/D88396#2302469>, @LuoYuanke wrote:

> If the address is random, during validation the address is aligned and sanitizers tool doesn't notice it. When run in real time, it crashes randomly. There is no harm to replace movaps with movups, and it can avoid some crash issue. Is it doable to add an option to let user choose movups or movaps?

If you change `void*` to `char*`, you get clang diagnostic:

  <source>:4:38: warning: cast from 'char *' to '__m128 *' increases required alignment from 1 to 16 [-Wcast-align]
      __m128 value = _mm_add_ps(value,*(__m128*)pointer);
                                       ^~~~~~~~~~~~~~~~

So this should in principle not require sanitizers.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88396



More information about the llvm-commits mailing list