[Mlir-commits] [mlir] fea175b - [mlir][Linalg] Small refactoring of ConvOpVectorization
Jakub Lichman
llvmlistbot at llvm.org
Thu Sep 10 00:06:21 PDT 2020
Author: Jakub Lichman
Date: 2020-09-10T07:05:30Z
New Revision: fea175b59fbdf5d2b95e8fd81ac043479f20fe10
URL: https://github.com/llvm/llvm-project/commit/fea175b59fbdf5d2b95e8fd81ac043479f20fe10
DIFF: https://github.com/llvm/llvm-project/commit/fea175b59fbdf5d2b95e8fd81ac043479f20fe10.diff
LOG: [mlir][Linalg] Small refactoring of ConvOpVectorization
This commit addresses comments that were requested on D86619
after it was landed.
Differential Revision: https://reviews.llvm.org/D87354
Added:
Modified:
mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
Removed:
################################################################################
diff --git a/mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h b/mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
index ce3b5fd2fd24..3049570bd47b 100644
--- a/mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
+++ b/mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
@@ -568,10 +568,11 @@ struct AffineMinSCFCanonicalizationPattern
/// Subsequently, they are contracted together and the result is written to
/// the first entry of the output buffer.
template <typename ConvOp, int N>
-struct ConvOpVectorization : public OpRewritePattern<ConvOp> {
+class ConvOpVectorization : public OpRewritePattern<ConvOp> {
using OpRewritePattern<ConvOp>::OpRewritePattern;
SmallVector<bool, 4> mask;
+public:
ConvOpVectorization(MLIRContext *context, SmallVector<bool, 4> msk)
: OpRewritePattern<ConvOp>(context) {
assert(msk.size() == N && "Mask size does not match rank");
diff --git a/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp b/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
index 51781af9cb30..f4aabf8a8302 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
@@ -371,7 +371,7 @@ LogicalResult LinalgCopyVTWForwardingPattern::matchAndRewrite(
template <class ConvOp, int N>
LogicalResult ConvOpVectorization<ConvOp, N>::matchAndRewrite(
ConvOp op, PatternRewriter &rewriter) const {
- const unsigned dimSize = 3;
+ unsigned dimSize = 3;
Location loc = op.getLoc();
MLIRContext *context = op.getContext();
edsc::ScopedContext scope(rewriter, loc);
More information about the Mlir-commits
mailing list