[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
This commit is contained in:
Jakub Lichman 2020-09-10 07:03:43 +00:00
parent 39c1653b3d
commit fea175b59f
2 changed files with 3 additions and 2 deletions

View File

@ -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");

View File

@ -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);