diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst --- a/llvm/docs/LangRef.rst +++ b/llvm/docs/LangRef.rst @@ -1242,6 +1242,9 @@ array), however ``dereferenceable()`` does imply ``nonnull`` in ``addrspace(0)`` (which is the default address space), except if the ``null_pointer_is_valid`` function attribute is present. + ``n`` should be a positive number. The pointer should be well defined, + otherwise it is undefined behavior. This means ``dereferenceable()`` + implies ``noundef``. ``dereferenceable_or_null()`` This indicates that the parameter or return value isn't both @@ -9434,12 +9437,7 @@ If the value being loaded is of aggregate type, the bytes that correspond to padding may be accessed but are ignored, because it is impossible to observe padding from the loaded aggregate value. - -If the pointer is not a well-defined value, all of its possible representations -should be dereferenceable. For example, loading a byte from a pointer to an -array of type ``[16 x i8]`` with offset ``undef & 31`` is undefined behavior. -Loading a byte at offset ``undef & 15`` nondeterministically reads one of the -bytes. +If ```` is not a well-defined value, the behavior is undefined. Examples: """"""""" @@ -9533,12 +9531,7 @@ belong to the type, but they will typically be overwritten. If ```` is of aggregate type, padding is filled with :ref:`undef `. - -If ```` is not a well-defined value, all of its possible -representations should be dereferenceable. For example, storing a byte to a -pointer to an array of type ``[16 x i8]`` with offset ``undef & 31`` is -undefined behavior. Storing a byte to an offset ``undef & 15`` -nondeterministically stores to one of offsets from 0 to 15. +If ```` is not a well-defined value, the behavior is undefined. Example: """""""" @@ -12703,11 +12696,11 @@ to be aligned to some boundary, this can be specified as an attribute on the argument. -If "len" is 0, the pointers may be NULL, dangling, ``undef``, or ``poison`` -pointers. However, they must still be appropriately aligned. -If "len" isn't a well-defined value, all of its possible representations should -make the behavior of this ``llvm.memcpy`` defined, otherwise the behavior is -undefined. +If ```` is 0, it is no-op modulo the behavior of attributes attached to +the arguments. +If ```` is not a well-defined value, the behavior is undefined. +If ```` is not zero, both ```` and ```` should be well-defined, +otherwise the behavior is undefined. .. _int_memcpy_inline: @@ -12762,11 +12755,9 @@ overlap. It copies "len" bytes of memory over. If the argument is known to be aligned to some boundary, this can be specified as an attribute on the argument. - -If "len" is 0, the pointers may be NULL, dangling, ``undef``, or ``poison`` -pointers. However, they must still be appropriately aligned. - -The generated code is guaranteed not to call any external functions. +The behavior of '``llvm.memcpy.inline.*``' is equivalent to the behavior of +'``llvm.memcpy.*``', but the generated code is guaranteed not to call any +external functions. .. _int_memmove: @@ -12823,11 +12814,11 @@ aligned to some boundary, this can be specified as an attribute on the argument. -If "len" is 0, the pointers may be NULL, dangling, ``undef``, or ``poison`` -pointers. However, they must still be appropriately aligned. -If "len" isn't a well-defined value, all of its possible representations should -make the behavior of this ``llvm.memmove`` defined, otherwise the behavior is -undefined. +If ```` is 0, it is no-op modulo the behavior of attributes attached to +the arguments. +If ```` is not a well-defined value, the behavior is undefined. +If ```` is not zero, both ```` and ```` should be well-defined, +otherwise the behavior is undefined. .. _int_memset: @@ -12881,11 +12872,11 @@ aligned to some boundary, this can be specified as an attribute on the argument. -If "len" is 0, the pointer may be NULL, dangling, ``undef``, or ``poison`` -pointer. However, it must still be appropriately aligned. -If "len" isn't a well-defined value, all of its possible representations should -make the behavior of this ``llvm.memset`` defined, otherwise the behavior is -undefined. +If ```` is 0, it is no-op modulo the behavior of attributes attached to +the arguments. +If ```` is not a well-defined value, the behavior is undefined. +If ```` is not zero, both ```` and ```` should be well-defined, +otherwise the behavior is undefined. '``llvm.sqrt.*``' Intrinsic ^^^^^^^^^^^^^^^^^^^^^^^^^^^