[Mlir-commits] [mlir] [mlir][vector] Add convenience types for scalable vectors (PR #87986)

Jakub Kuderski llvmlistbot at llvm.org
Mon Apr 8 12:45:50 PDT 2024


================
@@ -213,6 +214,14 @@ LogicalResult arith::ConstantOp::verify() {
     return emitOpError(
         "value must be an integer, float, or elements attribute");
   }
+
+  // Note, we could relax this for vectors with 1 scalable dim, e.g.:
+  //  * arith.constant dense<[[3, 3], [1, 1]]> : vector<2 x [2] x i32>
+  // However, this would most likely require updating the lowerings to LLVM.
+  if (llvm::isa<vector::ScalableVectorType>(type) && !isa<SplatElementsAttr>(getValue()))
----------------
kuhar wrote:

```suggestion
  if (isa<vector::ScalableVectorType>(type) && !isa<SplatElementsAttr>(getValue()))
```

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


More information about the Mlir-commits mailing list