Skip to content

Commit def5a8b

Browse files
committed
[mlir][vector] Add a check to ensure bailing out when reducing to a scalar, as ExtractStridedSliceOp does not support handling scalars
1 parent 370d34f commit def5a8b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

mlir/lib/Dialect/Vector/Transforms/VectorUnroll.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,11 @@ struct UnrollMultiReductionPattern
355355

356356
LogicalResult matchAndRewrite(vector::MultiDimReductionOp reductionOp,
357357
PatternRewriter &rewriter) const override {
358+
auto resultType = reductionOp->getResult(0).getType();
359+
if (mlir::isa<mlir::FloatType>(resultType) ||
360+
mlir::isa<mlir::IntegerType>(resultType)) {
361+
return failure();
362+
}
358363
std::optional<SmallVector<int64_t>> targetShape =
359364
getTargetShape(options, reductionOp);
360365
if (!targetShape)

0 commit comments

Comments
 (0)