[Mlir-commits] [mlir] d76338f - [mlir][vector] Simplify ExtractSliceOp/TransferWriteOp swapping pattern
Matthias Springer
llvmlistbot at llvm.org
Fri Jul 14 06:40:03 PDT 2023
Author: Matthias Springer
Date: 2023-07-14T15:35:03+02:00
New Revision: d76338f6254d0dc729d5341fd0656293635e3fc3
URL: https://github.com/llvm/llvm-project/commit/d76338f6254d0dc729d5341fd0656293635e3fc3
DIFF: https://github.com/llvm/llvm-project/commit/d76338f6254d0dc729d5341fd0656293635e3fc3.diff
LOG: [mlir][vector] Simplify ExtractSliceOp/TransferWriteOp swapping pattern
No need to compute the `in_bounds` attribute. The folder will infer it.
Differential Revision: https://reviews.llvm.org/D155172
Added:
Modified:
mlir/lib/Dialect/Vector/IR/VectorOps.cpp
Removed:
################################################################################
diff --git a/mlir/lib/Dialect/Vector/IR/VectorOps.cpp b/mlir/lib/Dialect/Vector/IR/VectorOps.cpp
index b54ea90642e9e7..623d75407963f2 100644
--- a/mlir/lib/Dialect/Vector/IR/VectorOps.cpp
+++ b/mlir/lib/Dialect/Vector/IR/VectorOps.cpp
@@ -4243,11 +4243,8 @@ struct SwapExtractSliceOfTransferWrite
}
// Swap the tensor::ExtractSliceOp in front of the vector::TransferWriteOp.
- SmallVector<int64_t> newResultShape = applyPermutationMap(
- transferOp.getPermutationMap(), insertOp.getSourceType().getShape());
- SmallVector<bool> newInBounds;
- for (const auto &en : enumerate(newResultShape))
- newInBounds.push_back(en.value() == vectorShape[en.index()]);
+ // Set all in_bounds to false and let the folder infer them.
+ SmallVector<bool> newInBounds(vectorShape.size(), false);
auto newExtractOp = rewriter.create<tensor::ExtractSliceOp>(
extractOp.getLoc(), insertOp.getSourceType(), insertOp.getDest(),
insertOp.getMixedOffsets(), insertOp.getMixedSizes(),
More information about the Mlir-commits
mailing list