[Mlir-commits] [mlir] aa58281 - [mlir] Fix bug in TransferOpReduceRank when all dims are broadcasts
Matthias Springer
llvmlistbot at llvm.org
Mon May 3 19:21:59 PDT 2021
Author: Matthias Springer
Date: 2021-05-04T11:21:44+09:00
New Revision: aa58281979710a1cee6f1635dc1074c4dfc44650
URL: https://github.com/llvm/llvm-project/commit/aa58281979710a1cee6f1635dc1074c4dfc44650
DIFF: https://github.com/llvm/llvm-project/commit/aa58281979710a1cee6f1635dc1074c4dfc44650.diff
LOG: [mlir] Fix bug in TransferOpReduceRank when all dims are broadcasts
TransferReadOps that are a scalar read + broadcast are handled by TransferReadToVectorLoadLowering.
Differential Revision: https://reviews.llvm.org/D101808
Added:
Modified:
mlir/lib/Dialect/Vector/VectorTransforms.cpp
Removed:
################################################################################
diff --git a/mlir/lib/Dialect/Vector/VectorTransforms.cpp b/mlir/lib/Dialect/Vector/VectorTransforms.cpp
index 2c8b33795de44..38042958018a9 100644
--- a/mlir/lib/Dialect/Vector/VectorTransforms.cpp
+++ b/mlir/lib/Dialect/Vector/VectorTransforms.cpp
@@ -2970,6 +2970,9 @@ struct TransferOpReduceRank : public OpRewritePattern<vector::TransferReadOp> {
return failure();
SmallVector<int64_t> newShape = llvm::to_vector<4>(
originalVecType.getShape().take_back(reducedShapeRank));
+ // Vector rank cannot be zero. Handled by TransferReadToVectorLoadLowering.
+ if (newShape.empty())
+ return failure();
VectorType newReadType =
VectorType::get(newShape, originalVecType.getElementType());
ArrayAttr newInBounds =
More information about the Mlir-commits
mailing list