[Mlir-commits] [mlir] fe07d9a - [mlir][vector] Switch to using `getNumScalableDims` (nfc) (#100806)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Sat Jul 27 00:11:04 PDT 2024
Author: Andrzej WarzyĆski
Date: 2024-07-27T08:11:00+01:00
New Revision: fe07d9aa410518c5b631a065ddc5782a623af030
URL: https://github.com/llvm/llvm-project/commit/fe07d9aa410518c5b631a065ddc5782a623af030
DIFF: https://github.com/llvm/llvm-project/commit/fe07d9aa410518c5b631a065ddc5782a623af030.diff
LOG: [mlir][vector] Switch to using `getNumScalableDims` (nfc) (#100806)
Added:
Modified:
mlir/lib/Dialect/ArmSME/Transforms/OuterProductFusion.cpp
mlir/lib/Dialect/ArmSME/Transforms/VectorLegalization.cpp
mlir/lib/Dialect/Vector/Utils/VectorUtils.cpp
Removed:
################################################################################
diff --git a/mlir/lib/Dialect/ArmSME/Transforms/OuterProductFusion.cpp b/mlir/lib/Dialect/ArmSME/Transforms/OuterProductFusion.cpp
index 39292c4533d69..1e711678dc9ab 100644
--- a/mlir/lib/Dialect/ArmSME/Transforms/OuterProductFusion.cpp
+++ b/mlir/lib/Dialect/ArmSME/Transforms/OuterProductFusion.cpp
@@ -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");
diff --git a/mlir/lib/Dialect/ArmSME/Transforms/VectorLegalization.cpp b/mlir/lib/Dialect/ArmSME/Transforms/VectorLegalization.cpp
index c76d489e28119..53df7af00aee8 100644
--- a/mlir/lib/Dialect/ArmSME/Transforms/VectorLegalization.cpp
+++ b/mlir/lib/Dialect/ArmSME/Transforms/VectorLegalization.cpp
@@ -548,7 +548,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");
diff --git a/mlir/lib/Dialect/Vector/Utils/VectorUtils.cpp b/mlir/lib/Dialect/Vector/Utils/VectorUtils.cpp
index 4ed5a8bac20d1..e590d8c43c44b 100644
--- a/mlir/lib/Dialect/Vector/Utils/VectorUtils.cpp
+++ b/mlir/lib/Dialect/Vector/Utils/VectorUtils.cpp
@@ -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,
More information about the Mlir-commits
mailing list