Skip to content

Commit bae8252

Browse files
committed
fix-expand-verifier
1 parent 50b45b2 commit bae8252

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2356,12 +2356,11 @@ LogicalResult ExpandShapeOp::verify() {
23562356
// Verify if provided output shapes are in agreement with output type.
23572357
DenseI64ArrayAttr staticOutputShapes = getStaticOutputShapeAttr();
23582358
ArrayRef<int64_t> resShape = getResult().getType().getShape();
2359-
unsigned staticShapeNum = 0;
2360-
2361-
for (auto [pos, shape] : llvm::enumerate(resShape))
2362-
if (!ShapedType::isDynamic(shape) &&
2363-
shape != staticOutputShapes[staticShapeNum++])
2359+
for (auto [pos, shape] : llvm::enumerate(resShape)) {
2360+
if (!ShapedType::isDynamic(shape) && shape != staticOutputShapes[pos]) {
23642361
emitOpError("invalid output shape provided at pos ") << pos;
2362+
}
2363+
}
23652364

23662365
return success();
23672366
}

0 commit comments

Comments
 (0)