Skip to content

Commit f31cf5a

Browse files
committed
[mlir][linalg] Allow fusing reshapes with parallel operands
Signed-off-by: Ian Wood <[email protected]>
1 parent 7e5821b commit f31cf5a

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

mlir/lib/Dialect/Linalg/Transforms/ElementwiseOpFusion.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,6 @@ static bool isFusableWithReshapeByDimExpansion(LinalgOp linalgOp,
566566
// - All the indexing maps for operands and results are projected
567567
// permutations.
568568
// - The fused tensor is not a scalar.
569-
// - All the loops for the reshaped operand are parallel loops.
570569
SmallVector<utils::IteratorType> iteratorTypes =
571570
linalgOp.getIteratorTypesArray();
572571
AffineMap operandMap = linalgOp.getMatchingIndexingMap(fusableOpOperand);
@@ -577,11 +576,7 @@ static bool isFusableWithReshapeByDimExpansion(LinalgOp linalgOp,
577576
.getValue()
578577
.isProjectedPermutation();
579578
}) &&
580-
operandMap.getNumResults() > 0 &&
581-
llvm::all_of(operandMap.getResults(), [&](AffineExpr expr) {
582-
return isParallelIterator(
583-
iteratorTypes[cast<AffineDimExpr>(expr).getPosition()]);
584-
});
579+
operandMap.getNumResults() > 0;
585580
}
586581

587582
namespace {

0 commit comments

Comments
 (0)