[Mlir-commits] [mlir] Fix `memref.expand_shape` verifier (PR #91501)
Benoit Jacob
llvmlistbot at llvm.org
Wed May 8 09:38:51 PDT 2024
================
@@ -2356,12 +2356,11 @@ LogicalResult ExpandShapeOp::verify() {
// Verify if provided output shapes are in agreement with output type.
DenseI64ArrayAttr staticOutputShapes = getStaticOutputShapeAttr();
ArrayRef<int64_t> resShape = getResult().getType().getShape();
- unsigned staticShapeNum = 0;
-
- for (auto [pos, shape] : llvm::enumerate(resShape))
- if (!ShapedType::isDynamic(shape) &&
- shape != staticOutputShapes[staticShapeNum++])
+ for (auto [pos, shape] : llvm::enumerate(resShape)) {
+ if (!ShapedType::isDynamic(shape) && shape != staticOutputShapes[pos]) {
emitOpError("invalid output shape provided at pos ") << pos;
+ }
----------------
bjacob wrote:
this occurred to me but I thought "if *that* is broken then this is basically unusable". maybe it is... will try.
https://github.com/llvm/llvm-project/pull/91501
More information about the Mlir-commits
mailing list