Skip to content

Commit 37a0e5b

Browse files
committed
Check >=2 dyn for source and result
Signed-off-by: Ian Wood <[email protected]>
1 parent 510f3c7 commit 37a0e5b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mlir/include/mlir/Dialect/Utils/ReshapeOpsUtils.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,8 @@ struct ComposeExpandOfCollapseOp : public OpRewritePattern<ExpandOpTy> {
387387
auto resultSubShape =
388388
resultShape.slice(resultIndices.front(), resultIndices.size());
389389

390-
if (llvm::count_if(srcSubShape, ShapedType::isDynamic) >= 2)
390+
if (llvm::count_if(srcSubShape, ShapedType::isDynamic) >= 2 &&
391+
llvm::count_if(resultSubShape, ShapedType::isDynamic) >= 2)
391392
return std::nullopt;
392393

393394
if (srcSubShape.size() == resultSubShape.size()) {

0 commit comments

Comments
 (0)