2020-08-28 06:09:10 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// Part of the LLVM Project, 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
|
2021-09-30 00:03:40 +08:00
|
|
|
// Also available under a BSD-style license. See LICENSE.
|
2020-08-28 06:09:10 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2021-09-24 11:59:12 +08:00
|
|
|
#include "torch-mlir/Conversion/Passes.h"
|
2020-08-28 06:09:10 +08:00
|
|
|
|
2022-08-23 16:47:21 +08:00
|
|
|
#ifdef TORCH_MLIR_ENABLE_MHLO
|
2022-11-17 06:40:36 +08:00
|
|
|
#include "mhlo/transforms/passes.h"
|
2022-09-08 10:15:36 +08:00
|
|
|
#include "mlir-hlo/Transforms/passes.h"
|
2022-08-23 16:47:21 +08:00
|
|
|
#endif // TORCH_MLIR_ENABLE_MHLO
|
2021-09-24 11:59:12 +08:00
|
|
|
#include "torch-mlir/Conversion/TorchToLinalg/TorchToLinalg.h"
|
|
|
|
#include "torch-mlir/Conversion/TorchToSCF/TorchToSCF.h"
|
2022-08-11 03:12:51 +08:00
|
|
|
#include "torch-mlir/Conversion/TorchToArith/TorchToArith.h"
|
2021-10-08 10:07:03 +08:00
|
|
|
#include "torch-mlir/Conversion/TorchToTosa/TorchToTosa.h"
|
2022-07-21 07:18:16 +08:00
|
|
|
#include "torch-mlir/Conversion/TorchToMhlo/TorchToMhlo.h"
|
2022-03-03 00:48:15 +08:00
|
|
|
#include "torch-mlir/Conversion/TorchToTMTensor/TorchToTMTensor.h"
|
2022-11-24 12:33:47 +08:00
|
|
|
#include "torch-mlir/Conversion/TorchConversionToMLProgram/TorchConversionToMLProgram.h"
|
2020-08-28 06:09:10 +08:00
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Pass registration
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
#define GEN_PASS_REGISTRATION
|
2021-09-24 11:59:12 +08:00
|
|
|
#include "torch-mlir/Conversion/Passes.h.inc"
|
2020-08-28 06:09:10 +08:00
|
|
|
} // end namespace
|
|
|
|
|
2022-08-23 16:47:21 +08:00
|
|
|
void mlir::torch::registerConversionPasses() {
|
|
|
|
::registerPasses();
|
|
|
|
#ifdef TORCH_MLIR_ENABLE_MHLO
|
|
|
|
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
|
|
|
|
return mlir::mhlo::createLegalizeHloToLinalgPass();
|
|
|
|
});
|
2022-09-08 10:15:36 +08:00
|
|
|
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
|
|
|
|
return mlir::createSymbolicShapeOptimizationPass();
|
|
|
|
});
|
2022-08-23 16:47:21 +08:00
|
|
|
#endif // TORCH_MLIR_ENABLE_MHLO
|
|
|
|
}
|