diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst --- a/llvm/docs/LangRef.rst +++ b/llvm/docs/LangRef.rst @@ -6391,10 +6391,10 @@ ``range`` metadata may be attached only to ``load``, ``call`` and ``invoke`` of integer types. It expresses the possible ranges the loaded value or the value returned by the called function at this call site is in. If the loaded or -returned value is not in the specified range, the behavior is undefined. The -ranges are represented with a flattened list of integers. The loaded value or -the value returned is known to be in the union of the ranges defined by each -consecutive pair. Each pair has the following properties: +returned value is not in the specified range, a poison value is returned +instead. The ranges are represented with a flattened list of integers. The +loaded value or the value returned is known to be in the union of the ranges +defined by each consecutive pair. Each pair has the following properties: - The type must match the type loaded by the instruction. - The pair ``a,b`` represents the range ``[a,b)``. @@ -10198,9 +10198,9 @@ metadata name ```` corresponding to a metadata node with no entries. The existence of the ``!nonnull`` metadata on the instruction tells the optimizer that the value loaded is known to -never be null. If the value is null at runtime, the behavior is undefined. -This is analogous to the ``nonnull`` attribute on parameters and return -values. This metadata can only be applied to loads of a pointer type. +never be null. If the value is null at runtime, a poison value is returned +instead. This is analogous to the ``nonnull`` attribute on parameters and +return values. This metadata can only be applied to loads of a pointer type. The optional ``!dereferenceable`` metadata must reference a single metadata name ```` corresponding to a metadata node with one ``i64`` @@ -10220,13 +10220,16 @@ by the integer value in the metadata node. The alignment must be a power of 2. This is analogous to the ''align'' attribute on parameters and return values. This metadata can only be applied to loads of a pointer type. If the returned -value is not appropriately aligned at runtime, the behavior is undefined. +value is not appropriately aligned at runtime, a poison value is returned +instead. The optional ``!noundef`` metadata must reference a single metadata name ```` corresponding to a node with no entries. The existence of ``!noundef`` metadata on the instruction tells the optimizer that the value loaded is known to be :ref:`well defined `. -If the value isn't well defined, the behavior is undefined. +If the value isn't well defined, the behavior is undefined. If the ``!noundef`` +metadata is combined with poison-generating metadata like ``!nonnull``, +violation of that metadata constraint will also result in undefined behavior. Semantics: """"""""""