[Mlir-commits] [mlir] 59661a2 - [LLVM][LangRef] Restrict vscale to be a signed power-of-two integer. (#183080)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Tue Feb 24 09:41:24 PST 2026
Author: Paul Walker
Date: 2026-02-24T17:41:18Z
New Revision: 59661a295552c7fd766c4a5e81e2ce2ddd723515
URL: https://github.com/llvm/llvm-project/commit/59661a295552c7fd766c4a5e81e2ce2ddd723515
DIFF: https://github.com/llvm/llvm-project/commit/59661a295552c7fd766c4a5e81e2ce2ddd723515.diff
LOG: [LLVM][LangRef] Restrict vscale to be a signed power-of-two integer. (#183080)
There is no known requirement to support non-power-of-two
values of vscale and yet said support is leading to unnecessary
complexity within LLVM.
Added:
Modified:
llvm/docs/LangRef.rst
mlir/docs/Dialects/Vector.md
Removed:
################################################################################
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index 221934c05a547..2f5ba6c22ddab 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -4689,9 +4689,9 @@ elementtype may be any integer, floating-point, pointer type, or a sized
target extension type that has the ``CanBeVectorElement`` property. 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
+of elements; vscale is a positive power-of-two 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.
:Examples:
@@ -31515,8 +31515,8 @@ vectors such as ``<vscale x 16 x i8>``.
Semantics:
""""""""""
-``vscale`` is a positive value that is constant throughout program
-execution, but is unknown at compile time.
+``vscale`` is a positive power-of-two integer 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 <poisonvalues>`.
diff --git a/mlir/docs/Dialects/Vector.md b/mlir/docs/Dialects/Vector.md
index 839dc75ff0214..17c9fd7d818b4 100644
--- a/mlir/docs/Dialects/Vector.md
+++ b/mlir/docs/Dialects/Vector.md
@@ -97,10 +97,11 @@ Finally, MLIR takes the same view on scalable Vectors as LLVM (c.f.
[VectorType](https://llvm.org/docs/LangRef.html#vector-type)):
> 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.
+> power-of-two 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.
### Hardware Vector Ops
More information about the Mlir-commits
mailing list