[Mlir-commits] [llvm] [mlir] [LLVM][LangRef] Restrict vscale to be a signed power-of-two integer. (PR #183080)
Paul Walker
llvmlistbot at llvm.org
Tue Feb 24 08:51:01 PST 2026
https://github.com/paulwalker-arm updated https://github.com/llvm/llvm-project/pull/183080
>From fbb3e4737ca4feddc8f93830bfc0b746fd256461 Mon Sep 17 00:00:00 2001
From: Paul Walker <paul.walker at arm.com>
Date: Tue, 24 Feb 2026 15:33:28 +0000
Subject: [PATCH 1/2] [LLVM][LangRef] Restrict vscale to be a signed
power-of-two integer.
---
llvm/docs/LangRef.rst | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index 50a2515f69189..a7baeb94bc86b 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -4678,9 +4678,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:
@@ -31501,8 +31501,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>`.
>From 284f6af4fef59a29c5a2db2ce392eb136472e89e Mon Sep 17 00:00:00 2001
From: Paul Walker <paul.walker at arm.com>
Date: Tue, 24 Feb 2026 16:50:24 +0000
Subject: [PATCH 2/2] Update MLIR documentation for vscale.
---
mlir/docs/Dialects/Vector.md | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
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