aboutsummaryrefslogtreecommitdiff
path: root/mlir/lib/Dialect/Arith/IR/ArithOps.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mlir/lib/Dialect/Arith/IR/ArithOps.cpp')
-rw-r--r--mlir/lib/Dialect/Arith/IR/ArithOps.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/mlir/lib/Dialect/Arith/IR/ArithOps.cpp b/mlir/lib/Dialect/Arith/IR/ArithOps.cpp
index 1d68a4f..efc4bfe 100644
--- a/mlir/lib/Dialect/Arith/IR/ArithOps.cpp
+++ b/mlir/lib/Dialect/Arith/IR/ArithOps.cpp
@@ -213,6 +213,12 @@ LogicalResult arith::ConstantOp::verify() {
return emitOpError(
"value must be an integer, float, or elements attribute");
}
+
+ auto vecType = dyn_cast<VectorType>(type);
+ if (vecType && vecType.isScalable() && !isa<SplatElementsAttr>(getValue()))
+ return emitOpError(
+ "intializing scalable vectors with elements attribute is not supported"
+ " unless it's a vector splat");
return success();
}