#include "mlir/Dialect/Linalg/Passes.h"
#include "mlir/Dialect/Linalg/IR/Linalg.h"
#include "mlir/Dialect/Linalg/Transforms/Transforms.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/TypeSwitch.h"
namespace mlir {
#define GEN_PASS_DEF_LINALGNAMEDOPCONVERSIONPASS
#include "mlir/Dialect/Linalg/Passes.h.inc"
}
usingnamespacemlir;
usingnamespacemlir::linalg;
static llvm::SmallVector<int64_t> getIndicesVector(int start, int end) { … }
static LogicalResult
matchAndReplaceDepthwiseConv(Operation *operation, Value input, Value kernel,
Value iZp, Value kZp, Value init, Attribute stride,
Attribute dilation, PatternRewriter &rewriter) { … }
namespace {
struct SimplifyDepthwiseConvOp
: public OpRewritePattern<DepthwiseConv2DNhwcHwcmOp> { … };
struct SimplifyDepthwiseConvQOp
: public OpRewritePattern<DepthwiseConv2DNhwcHwcmQOp> { … };
struct LinalgNamedOpConversionPass
: public impl::LinalgNamedOpConversionPassBase<
LinalgNamedOpConversionPass> { … };
}
void mlir::linalg::populateLinalgNamedOpConversionPatterns(
RewritePatternSet &patterns) { … }