Skip to content

Commit 6343ee7

Browse files
authored
[mlir] Fix handling of "no rank reduction" case in two Patterns (#71293)
This patch fixes two checks where a `SmallBitVector` containing the potential dropped dims of a SubView/ExtractSlice operation was queried via `empty()` instead of `none()`.
1 parent 557b064 commit 6343ee7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3099,7 +3099,7 @@ struct SubViewReturnTypeCanonicalizer {
30993099

31003100
// Directly return the non-rank reduced type if there are no dropped dims.
31013101
llvm::SmallBitVector droppedDims = op.getDroppedDims();
3102-
if (droppedDims.empty())
3102+
if (droppedDims.none())
31033103
return nonReducedType;
31043104

31053105
// Take the strides and offset from the non-rank reduced type.

mlir/lib/Dialect/Tensor/Transforms/MergeConsecutiveInsertExtractSlicePatterns.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ struct DropRedundantInsertSliceRankExpansion
9191
PatternRewriter &rewriter) const override {
9292
// Nothing to do if no dims are dropped.
9393
llvm::SmallBitVector droppedDims = extractSliceOp.getDroppedDims();
94-
if (droppedDims.empty())
94+
if (droppedDims.none())
9595
return failure();
9696

9797
// Look for tensor.insert_slice op that has an inverse rank expansion.

0 commit comments

Comments
 (0)