[Mlir-commits] [mlir] [mlir][vector] Restrict vector.insert/vector.extract to disallow 0-d vectors (PR #121458)

Kunwar Grover llvmlistbot at llvm.org
Mon Jun 23 07:47:09 PDT 2025


================
@@ -886,9 +886,10 @@ def Vector_InsertOp :
      AllTypesMatch<["dest", "result"]>]> {
   let summary = "insert operation";
   let description = [{
-    Takes an n-D source vector, an (n+k)-D destination vector and a k-D position
-    and inserts the n-D source into the (n+k)-D destination at the proper
-    position. Degenerates to a scalar or a 0-d vector source type when n = 0.
+    Inserts an n-D source vector (the value to store) into an (n + k)-D
+    destination vector at a specified k-D position. When n = 0, the source
+    degenerates to a scalar element inserted into the (0 + k)-D destination
+    vector.
----------------
Groverkss wrote:

I don't think this was addressed, what i meant was to use same rank for same class of operands:

n-D vector --> source/dest
k-D position
(n-k)-D subvector (valueToStore, result vector), degenerates to a scalar if k = n.

I don't mind the naming scheme, but having consistent rank documentation is easier to read.

https://github.com/llvm/llvm-project/pull/121458


More information about the Mlir-commits mailing list