[Mlir-commits] [mlir] [mlir][tensor] Apply `InsertSliceOfTransferWriteOpFolder` only when `transfer_write` overwrites all elements of `insert_slice` (PR #108803)
Han-Chung Wang
llvmlistbot at llvm.org
Wed Sep 25 10:23:29 PDT 2024
================
@@ -154,6 +163,18 @@ LogicalResult InsertSliceOfTransferWriteOpFolder::matchAndRewrite(
return success();
}
+bool InsertSliceOfTransferWriteOpFolder::doesTransferWriteCoverInsertSlice(
+ vector::TransferWriteOp writeOp) {
+ if (writeOp.getVectorType().hasStaticShape() &&
+ writeOp.getShapedType().hasStaticShape())
+ return llvm::equal(writeOp.getVectorType().getShape(),
+ writeOp.getShapedType().getShape());
+
+ // Todo: ValueBoundsConstraintSet for dynamic shapes.
----------------
hanhanW wrote:
style nit:
```suggestion
// TODO: ValueBoundsConstraintSet for dynamic shapes.
```
https://github.com/llvm/llvm-project/pull/108803
More information about the Mlir-commits
mailing list