[llvm-dev] [RFC] [X86] Emit unaligned vector moves on avx machine with option control.

Reid Kleckner via llvm-dev llvm-dev at lists.llvm.org
Thu Apr 15 09:58:38 PDT 2021


On Wed, Apr 14, 2021 at 11:58 AM James Y Knight via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> What I suspect you *actually* want here is an option to tell Clang not to
> infer load/store alignments based on object types or alignment attributes
> -- instead treating everything as being potentially aligned to 1 unless the
> allocation is seen (e.g. global/local variables). Clang would still need to
> use the usual alignment computation for variable definitions and structure
> layout, but not memory operations. If clang emits "load ... align 1"
> instructions in LLVM IR, the right thing would then happen in the X86
> backend automatically.
>

This sounds like the -fmax-type-align flag:
https://clang.llvm.org/docs/UsersManual.html#controlling-code-generation
Explicit alignment attributes are still honored, so some aligned vector
instructions may be generated. However, the documentation describes
essentially this exact use case.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210415/fc06a424/attachment.html>


More information about the llvm-dev mailing list