Skip to content

[mlir][vector] Switch to using getNumScalableDims (nfc) #100806

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ struct SwapVectorExtractOfArithExtend
return rewriter.notifyMatchFailure(extractOp,
"extracted type is not a vector type");

auto numScalableDims = llvm::count(resultType.getScalableDims(), true);
auto numScalableDims = resultType.getNumScalableDims();
if (numScalableDims != 1)
return rewriter.notifyMatchFailure(
extractOp, "extracted type is not a 1-D scalable vector type");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ struct FoldExtractFromVectorOfSMELikeCreateMasks
return rewriter.notifyMatchFailure(extractOp,
"extracted type is not a vector type");

auto numScalable = llvm::count(extractedMaskType.getScalableDims(), true);
auto numScalable = extractedMaskType.getNumScalableDims();
if (numScalable != 2)
return rewriter.notifyMatchFailure(
extractOp, "expected extracted type to be an SME-like mask");
Expand Down
3 changes: 1 addition & 2 deletions mlir/lib/Dialect/Vector/Utils/VectorUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,7 @@ SmallVector<OpFoldResult> vector::getMixedSizesXfer(bool hasTensorSemantics,
}

bool vector::isLinearizableVector(VectorType type) {
auto numScalableDims = llvm::count(type.getScalableDims(), true);
return (type.getRank() > 1) && (numScalableDims <= 1);
return (type.getRank() > 1) && (type.getNumScalableDims() <= 1);
}

Value vector::createReadOrMaskedRead(OpBuilder &builder, Location loc,
Expand Down
Loading