#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Dialect/Tensor/IR/Tensor.h"
#include "mlir/Dialect/Tosa/IR/TosaOps.h"
#include "mlir/Dialect/Tosa/Transforms/Passes.h"
#include "mlir/Dialect/Tosa/Utils/QuantUtils.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/Matchers.h"
#include "mlir/Pass/Pass.h"
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
#define PASS_NAME …
usingnamespacemlir;
usingnamespacemlir::tosa;
struct ConvertTosaNegateOp : public RewritePattern { … };
LogicalResult
ConvertTosaNegateOp::matchAndRewrite(Operation *op,
PatternRewriter &rewriter) const { … }
struct ConvertTosaConv2DOp : public RewritePattern { … };
LogicalResult
ConvertTosaConv2DOp::matchAndRewrite(Operation *op,
PatternRewriter &rewriter) const { … }
namespace {
struct TosaTestQuantUtilAPI
: public PassWrapper<TosaTestQuantUtilAPI, OperationPass<func::FuncOp>> { … };
void TosaTestQuantUtilAPI::runOnOperation() { … }
}
namespace mlir {
void registerTosaTestQuantUtilAPIPass() { … }
}