summaryrefslogtreecommitdiff
path: root/mlir/lib/Dialect/Vector/Transforms/VectorTransferSplitRewritePatterns.cpp
diff options
context:
space:
mode:
authorgysit <gysit@google.com>2022-03-14 10:45:04 +0000
committergysit <gysit@google.com>2022-03-14 10:51:08 +0000
commit7294be2b8e9ada57e051bac6a20ca8b4dbf46475 (patch)
tree9ccfdcaf47f1e28a36de99bd0f2f2522d39f98b6 /mlir/lib/Dialect/Vector/Transforms/VectorTransferSplitRewritePatterns.cpp
parent836e34f727e17baa6507a5c6cc19d41dce8e769d (diff)
[mlir][linalg] Replace linalg.fill by OpDSL variant.
The revision removes the linalg.fill operation and renames the OpDSL generated linalg.fill_tensor operation to replace it. After the change, all named structured operations are defined via OpDSL and there are no handwritten operations left. A side-effect of the change is that the pretty printed form changes from: ``` %1 = linalg.fill(%cst, %0) : f32, tensor<?x?xf32> -> tensor<?x?xf32> ``` changes to ``` %1 = linalg.fill ins(%cst : f32) outs(%0 : tensor<?x?xf32>) -> tensor<?x?xf32> ``` Additionally, the builder signature now takes input and output value ranges as it is the case for all other OpDSL operations: ``` rewriter.create<linalg::FillOp>(loc, val, output) ``` changes to ``` rewriter.create<linalg::FillOp>(loc, ValueRange{val}, ValueRange{output}) ``` All other changes remain minimal. In particular, the canonicalization patterns are the same and the `value()`, `output()`, and `result()` methods are now implemented by the FillOpInterface. Depends On D120726 Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D120728
Diffstat (limited to 'mlir/lib/Dialect/Vector/Transforms/VectorTransferSplitRewritePatterns.cpp')
-rw-r--r--mlir/lib/Dialect/Vector/Transforms/VectorTransferSplitRewritePatterns.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/mlir/lib/Dialect/Vector/Transforms/VectorTransferSplitRewritePatterns.cpp b/mlir/lib/Dialect/Vector/Transforms/VectorTransferSplitRewritePatterns.cpp
index 48470f7b059d..c457621ec61b 100644
--- a/mlir/lib/Dialect/Vector/Transforms/VectorTransferSplitRewritePatterns.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/VectorTransferSplitRewritePatterns.cpp
@@ -262,7 +262,8 @@ createFullPartialLinalgCopy(RewriterBase &b, vector::TransferReadOp xferOp,
b.create<scf::YieldOp>(loc, viewAndIndices);
},
[&](OpBuilder &b, Location loc) {
- b.create<linalg::FillOp>(loc, xferOp.padding(), alloc);
+ b.create<linalg::FillOp>(loc, ValueRange{xferOp.padding()},
+ ValueRange{alloc});
// Take partial subview of memref which guarantees no dimension
// overflows.
IRRewriter rewriter(b);