[llvm-dev] Over-alignment of globals?

Luís Marques via llvm-dev llvm-dev at lists.llvm.org
Wed Jun 24 13:03:52 PDT 2020


Hi,

If we specify an explicit alignment attribute for globals (either at
the Clang or LLVM IR level) we get asm alignment directives with
values that seem to be `max(natural_alignment, specified_alignment)`.
This seems to happen for multiple archs. GCC instead just emits the
asked-for alignment. Is there a good reason for this LLVM behavior?

Example:
https://godbolt.org/z/B5ZcN_ (Clang)
https://godbolt.org/z/qpV7PV (GCC)

Thanks,
Luís


More information about the llvm-dev mailing list