blob: 30f88cf33fece70c25e22e6d4871f41760d8e8ef [file] [log] [blame]
// Copyright 2021 The IREE Authors
//
// Licensed under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#include "iree-dialects/Dialect/IREE/IREEDialect.h"
#include "iree-dialects/Dialect/IREEPyDM/IR/Dialect.h"
#include "iree-dialects/Dialect/IREEPyDM/Transforms/Passes.h"
#include "mlir/Dialect/SCF/SCF.h"
#include "mlir/Dialect/StandardOps/IR/Ops.h"
#include "mlir/IR/AsmState.h"
#include "mlir/IR/Dialect.h"
#include "mlir/InitAllPasses.h"
#include "mlir/Support/MlirOptMain.h"
#include "mlir/Transforms/Passes.h"
using namespace mlir;
using namespace mlir::iree;
using namespace mlir::iree_pydm;
int main(int argc, char **argv) {
registerAsmPrinterCLOptions();
registerMLIRContextCLOptions();
registerTransformsPasses();
registerSCFPasses();
// Local dialects.
registerIREEPyDMTransformsPasses();
DialectRegistry registry;
registry.insert<
// Local dialects
mlir::iree::IREEDialect, mlir::iree_pydm::IREEPyDMDialect,
// Upstream dialects
mlir::StandardOpsDialect, mlir::scf::SCFDialect>();
return mlir::asMainReturnCode(
mlir::MlirOptMain(argc, argv, "MLIR modular optimizer driver\n", registry,
/*preloadDialectsInContext=*/false));
}