diff options
Diffstat (limited to 'clang/docs/UsersManual.rst')
-rw-r--r-- | clang/docs/UsersManual.rst | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/clang/docs/UsersManual.rst b/clang/docs/UsersManual.rst index 9c64b046377..6f66c4d04d9 100644 --- a/clang/docs/UsersManual.rst +++ b/clang/docs/UsersManual.rst @@ -1111,6 +1111,37 @@ are listed below. This option restricts the generated code to use general registers only. This only applies to the AArch64 architecture. +**-f[no-]max-unknown-pointer-align=[number]** + Instruct the code generator to not enforce a higher alignment than the given + number (of bytes) when accessing memory via an opaque pointer or reference. + This cap is ignored when directly accessing a variable or when the pointee + type has an explicit “aligned” attribute. + + The value should usually be determined by the properties of the system allocator. + Some builtin types, especially vector types, have very high natural alignments; + when working with values of those types, Clang usually wants to use instructions + that take advantage of that alignment. However, many system allocators do + not promise to return memory that is more than 8-byte or 16-byte-aligned. Use + this option to limit the alignment that the compiler can assume for an arbitrary + pointer, which may point onto the heap. + + This option does not affect the ABI alignment of types; the layout of structs and + unions and the value returned by the alignof operator remain the same. + + This option can be overridden on a case-by-case basis by putting an explicit + “aligned” alignment on a struct, union, or typedef. For example: + + .. code-block:: console + + #include <immintrin.h> + // Make an aligned typedef of the AVX-512 16-int vector type. + typedef __v16si __aligned_v16si __attribute__((aligned(64))); + + void initialize_vector(__aligned_v16si *v) { + // The compiler may assume that ‘v’ is 64-byte aligned, regardless of the + // value of -fmax-unknown-pointer-align. + } + Profile Guided Optimization --------------------------- |