[Mlir-commits] [mlir] [mlir][memref.expand_shape] Add verifier check to ensure correct output_shape is provided by user (PR #91245)

Wenyi Zhao llvmlistbot at llvm.org
Mon May 6 18:22:25 PDT 2024


================
@@ -2353,6 +2353,16 @@ LogicalResult ExpandShapeOp::verify() {
            << " dynamic dims while output_shape has " << getOutputShape().size()
            << " values";
 
+  // Verify if provided output shapes are in agreement with output type.
+  DenseI64ArrayAttr staticOutputShapes = getStaticOutputShapeAttr();
+  ArrayRef<int64_t> resShape = getResult().getType().getShape();
----------------
wyzero wrote:

Do we need to check the rank of `resShape` match the rank of   `staticOutputShapes`?

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


More information about the Mlir-commits mailing list