diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst --- a/llvm/docs/LangRef.rst +++ b/llvm/docs/LangRef.rst @@ -3553,10 +3553,6 @@ To ensure all uses of a given register observe the same value (even if '``undef``'), the :ref:`freeze instruction ` can be used. -A value is frozen if its uses see the same value. -An aggregate value or vector is frozen if its elements are frozen. -The padding of an aggregate isn't considered, since it isn't visible -without storing it into memory and loading it with a different type. .. code-block:: llvm @@ -3729,6 +3725,14 @@ end: +A value is well-defined, or *frozen*, if the value never has undef bit +and is never poison. +If a variable has a frozen value, its uses should always see the same +defined value. +An aggregate value or vector is frozen if its elements are frozen. +The padding of an aggregate isn't considered, since it isn't visible +without storing it into memory and loading it with a different type. + .. _blockaddress: Addresses of Basic Blocks @@ -9233,7 +9237,13 @@ Semantics: """""""""" -The location of memory pointed to is loaded. If the value being loaded +The location of memory pointed to is loaded. +The pointer should be well-defined. For example, one cannot load a pointer +to an array of type ``[16 x i8]`` with offset ``undef & 16``, even if +``undef & 16`` is always less than 16. If the pointer isn't well-defined, +the behavior is undefined. + +If the value being loaded is of scalar type then the number of bytes read does not exceed the minimum number of bytes needed to hold all bits of the type. For example, loading an ``i24`` reads at most three bytes. When loading a @@ -9325,7 +9335,13 @@ """""""""" The contents of memory are updated to contain ```` at the -location specified by the ```` operand. If ```` is +location specified by the ```` operand. +```` should be well-defined. For example, one cannot store a value to +a pointer to an array of type ``[16 x i8]`` with offset ``undef & 16``, even if +``undef & 16`` is always less than 16. If ```` isn't well-defined, +the behavior is undefined. + +If ```` is of scalar type then the number of bytes written does not exceed the minimum number of bytes needed to hold all bits of the type. For example, storing an ``i24`` writes at most three bytes. When writing a @@ -12485,8 +12501,10 @@ to be aligned to some boundary, this can be specified as an attribute on the argument. +"len" should be well-defined, otherwise the behavior is undefined. If "len" is 0, the pointers may be NULL, dangling, ``undef``, or ``poison`` pointers. However, they must still be appropriately aligned. +If "len" is not 0, the pointers should be well-defined. .. _int_memcpy_inline: @@ -12602,8 +12620,10 @@ aligned to some boundary, this can be specified as an attribute on the argument. +"len" should be well-defined, otherwise the behavior is undefined. If "len" is 0, the pointers may be NULL, dangling, ``undef``, or ``poison`` pointers. However, they must still be appropriately aligned. +If "len" is not 0, the pointers should be well-defined. .. _int_memset: @@ -12657,8 +12677,10 @@ aligned to some boundary, this can be specified as an attribute on the argument. +"len" should be well-defined, otherwise the behavior is undefined. If "len" is 0, the pointer may be NULL, dangling, ``undef``, or ``poison`` pointer. However, it must still be appropriately aligned. +If "len" is not 0, the pointer should be well-defined. '``llvm.sqrt.*``' Intrinsic ^^^^^^^^^^^^^^^^^^^^^^^^^^^