mirror of https://github.com/llvm/torch-mlir
Adding stablehlo dialects support for torch-mlir-opt tool (#1887)
* Adding stablehlo dialects support for torch-mlir-opt tool. * Update torch-mlir-opt.cpp Fixed the build error according to build configuration for macOS.pull/1919/merge
parent
6c06b9560d
commit
13533307ca
|
@ -12,6 +12,10 @@
|
|||
#include "mlir/Tools/mlir-opt/MlirOptMain.h"
|
||||
#include "torch-mlir/InitAll.h"
|
||||
|
||||
#ifdef TORCH_MLIR_ENABLE_STABLEHLO
|
||||
#include "stablehlo/dialect/Register.h"
|
||||
#endif
|
||||
|
||||
using namespace mlir;
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
|
@ -22,6 +26,9 @@ int main(int argc, char **argv) {
|
|||
registerAllDialects(registry);
|
||||
mlir::torch::registerAllDialects(registry);
|
||||
|
||||
#ifdef TORCH_MLIR_ENABLE_STABLEHLO
|
||||
mlir::stablehlo::registerAllDialects(registry);
|
||||
#endif
|
||||
return mlir::asMainReturnCode(
|
||||
mlir::MlirOptMain(argc, argv, "MLIR modular optimizer driver\n", registry,
|
||||
/*preloadDialectsInContext=*/false));
|
||||
|
|
Loading…
Reference in New Issue