#include "mlir/Dialect/Tosa/Transforms/Passes.h"
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Dialect/Tosa/IR/TosaOps.h"
#include "mlir/Pass/Pass.h"
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
namespace mlir {
namespace tosa {
#define GEN_PASS_DEF_TOSALAYERWISECONSTANTFOLDPASS
#include "mlir/Dialect/Tosa/Transforms/Passes.h.inc"
}
}
usingnamespacemlir;
usingnamespacemlir::tosa;
namespace {
template <typename... Args>
void addOpsCanonicalizations(MLIRContext *ctx, RewritePatternSet &patterns) { … }
void populateTosaOpsCanonicalizationPatterns(MLIRContext *ctx,
RewritePatternSet &patterns) { … }
struct TosaLayerwiseConstantFoldPass
: public tosa::impl::TosaLayerwiseConstantFoldPassBase<
TosaLayerwiseConstantFoldPass> { … };
}
std::unique_ptr<Pass> mlir::tosa::createTosaLayerwiseConstantFoldPass() { … }
std::unique_ptr<Pass> mlir::tosa::createTosaLayerwiseConstantFoldPass(
const TosaLayerwiseConstantFoldPassOptions &options) { … }