diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst --- a/llvm/docs/LangRef.rst +++ b/llvm/docs/LangRef.rst @@ -3683,11 +3683,19 @@ The number of elements is a constant integer value larger than 0; elementtype may be any integer, floating-point or pointer type. Vectors of size zero are not allowed. For scalable vectors, the total number of -elements is a constant multiple (called vscale) of the specified number -of elements; vscale is a positive integer that is unknown at compile time -and the same hardware-dependent constant for all scalable vectors at run -time. The size of a specific scalable vector type is thus constant within -IR, even if the exact size in bytes cannot be determined until run time. +elements is a multiple (called ``vscale``) of the specified number of elements; + +.. _vscale + +``vscale`` is a positive integer that is unknown at compile time but has the +same hardware-dependent value for all scalable vectors in a function. ``vscale`` +can change at function call boundaries but such a change is tightly controlled +by function attributes and should not be observable to the calling function. + +The size of a specific scalable vector type is thus constant within a function, +even if the exact size in bytes cannot be determined until run time. However, +care must be taken to limit cross function optimisations if ``vscale`` might +change. :Examples: @@ -24745,11 +24753,9 @@ Semantics: """""""""" -``vscale`` is a positive value that is constant throughout program -execution, but is unknown at compile time. -If the result value does not fit in the result type, then the result is -a :ref:`poison value `. - +:ref:`vscale ` is a positive value that is constant throughout the +calling function. If the result value does not fit in the result type, then the +result is a :ref:`poison value `. Stack Map Intrinsics --------------------