diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst --- a/llvm/docs/LangRef.rst +++ b/llvm/docs/LangRef.rst @@ -6472,14 +6472,14 @@ ^^^^^^^^^^^^^^^^^^^^ ``range`` metadata may be attached only to ``load``, ``call`` and ``invoke`` of -integer or vector 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, 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 +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, 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 scalar type of the instruction. +- The type must match the type loaded by the instruction. - The pair ``a,b`` represents the range ``[a,b)``. - Both ``a`` and ``b`` are constants. - The range is allowed to wrap. @@ -6489,8 +6489,6 @@ In addition, the pairs must be in signed order of the lower bound and they must be non-contiguous. -For vector-typed instructions, the range is applied element-wise. - Examples: .. code-block:: llvm @@ -6500,7 +6498,6 @@ %c = call i8 @foo(), !range !2 ; Can only be 0, 1, 3, 4 or 5 %d = invoke i8 @bar() to label %cont unwind label %lpad, !range !3 ; Can only be -2, -1, 3, 4 or 5 - %e = load <2 x i8>, ptr %x, !range 0 ; Can only be <0 or 1, 0 or 1> ... !0 = !{ i8 0, i8 2 } !1 = !{ i8 255, i8 2 } @@ -7459,72 +7456,6 @@ Clang emits ``kcfi_type`` metadata nodes for address-taken functions with ``-fsanitize=kcfi``. -.. _md_memprof: - -'``memprof``' Metadata -^^^^^^^^^^^^^^^^^^^^^^^^ - -The ``memprof`` metadata is used to record memory profile data on heap -allocation calls. Multiple context-sensitive profiles can be represented -with a single ``memprof`` metadata attachment. - -Example: - -.. code-block:: text - - %call = call ptr @_Znam(i64 10), !memprof !0, !callsite !5 - !0 = !{!1, !3} - !1 = !{!2, !"cold"} - !2 = !{i64 4854880825882961848, i64 1905834578520680781} - !3 = !{!4, !"notcold"} - !4 = !{i64 4854880825882961848, i64 -6528110295079665978} - !5 = !{i64 4854880825882961848} - -Each operand in the ``memprof`` metadata attachment describes the profiled -behavior of memory allocated by the associated allocation for a given context. -In the above example, there were 2 profiled contexts, one allocating memory -that was typically cold and one allocating memory that was typically not cold. - -The format of the metadata describing a context specific profile (e.g. -``!1`` and ``!3`` above) requires a first operand that is a metadata node -describing the context, followed by a list of string metadata tags describing -the profile behavior (e.g. ``cold`` and ``notcold``) above. The metadata nodes -describing the context (e.g. ``!2`` and ``!4`` above) are unique ids -corresponding to callsites, which can be matched to associated IR calls via -:ref:`callsite metadata`. In practice these ids are formed via -a hash of the callsite's debug info, and the associated call may be in a -different module. The contexts are listed in order from leaf-most call (the -allocation itself) to the outermost callsite context required for uniquely -identifying the described profile behavior (note this may not be the top of -the profiled call stack). - -.. _md_callsite: - -'``callsite``' Metadata -^^^^^^^^^^^^^^^^^^^^^^^^ - -The ``callsite`` metadata is used to identify callsites involved in memory -profile contexts described in :ref:`memprof metadata`. - -It is attached both to the profile allocation calls (see the example in -:ref:`memprof metadata`), as well as to other callsites -in profiled contexts described in heap allocation ``memprof`` metadata. - -Example: - -.. code-block:: text - - %call = call ptr @_Z1Bb(void), !callsite !0 - !0 = !{i64 -6528110295079665978, i64 5462047985461644151} - -Each operand in the ``callsite`` metadata attachment is a unique id -corresponding to a callsite (possibly inlined). In practice these ids are -formed via a hash of the callsite's debug info. If the call was not inlined -into any callers it will contain a single operand (id). If it was inlined -it will contain a list of ids, including the ids of the callsites in the -full inline sequence, in order from the leaf-most call's id to the outermost -inlined call. - Module Flags Metadata ===================== @@ -9583,7 +9514,9 @@ """"""""" The '``frem``' instruction returns the remainder from the division of -its two operands. +its two operands. On some target, such as X86, the instruction is +implemented as call to '``libm``' '``fmod``' function, but the +output is equivalent to the mathematical remainder. Arguments: """"""""""