[PATCH] D99565: [X86] Support replacing aligned vector moves with unaligned moves when avx is enabled.

LiuChen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 29 23:52:26 PDT 2021


LiuChen3 created this revision.
Herald added subscribers: jansvoboda11, dang, pengfei, hiraditya.
LiuChen3 requested review of this revision.
Herald added projects: clang, LLVM.
Herald added subscribers: llvm-commits, cfe-commits.

With AVX the performance for aligned vector move and unaligned vector move on X86
are the same if the address is aligned. In this case we prefer to use unaligned
move because it can avoid some run time exceptions.
"-fuse-unaligned-vector-move" and "-fno-use-unaligned-vector-move" are added to
enable this preference. This transform is disabled as default.
Doing the transform in assembly because we want to avoid doing any change of IR
and flags.

This patch is a replacement of D88396 <https://reviews.llvm.org/D88396>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D99565

Files:
  clang/include/clang/Driver/Options.td
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/lib/Driver/ToolChains/CommonArgs.cpp
  clang/lib/Driver/ToolChains/CommonArgs.h
  clang/test/Driver/x86-unaligned-vector-move.c
  llvm/lib/Target/X86/X86MCInstLower.cpp
  llvm/test/CodeGen/X86/avx-unaligned-load-store.ll
  llvm/test/CodeGen/X86/avx512-unaligned-load-store.ll
  llvm/test/CodeGen/X86/avx512vl-unaligned-load-store.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99565.334059.patch
Type: text/x-patch
Size: 75525 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210330/bb559c60/attachment-0001.bin>


More information about the cfe-commits mailing list