Migrate from MHLO to StableHLO submodule (#365)
diff --git a/.gitmodules b/.gitmodules
index 27a8594..bd6f6c7 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,6 +1,6 @@
-[submodule "third_party/mlir-hlo"]
- path = third_party/mlir-hlo
- url = https://github.com/tensorflow/mlir-hlo.git
+[submodule "third_party/stablehlo"]
+ path = third_party/stablehlo
+ url = https://github.com/openxla/stablehlo.git
[submodule "third_party/googletest"]
path = third_party/googletest
url = https://github.com/google/googletest.git
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3845f7f..7a71019 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,6 +12,12 @@
include(CMakeDependentOption)
+# CMP0116: Ninja generators transform `DEPFILE`s from `add_custom_command()`
+# New in CMake 3.20. https://cmake.org/cmake/help/latest/policy/CMP0116.html
+if(POLICY CMP0116)
+ cmake_policy(SET CMP0116 OLD)
+endif()
+
#-------------------------------------------------------------------------------
# Options and definitions
#-------------------------------------------------------------------------------
@@ -90,11 +96,9 @@
# Configure StableHLO if we are building standalone. If building as part of
# another, let it handle the submodule and includes.
if(EMITC_ENABLE_HLO AND NOT EMITC_BUILD_EMBEDDED)
- add_subdirectory(third_party/mlir-hlo EXCLUDE_FROM_ALL)
- include_directories(${CMAKE_CURRENT_SOURCE_DIR}/third_party/mlir-hlo)
- include_directories(${CMAKE_CURRENT_BINARY_DIR}/third_party/mlir-hlo)
- include_directories(${CMAKE_CURRENT_SOURCE_DIR}/third_party/mlir-hlo/stablehlo)
- include_directories(${CMAKE_CURRENT_BINARY_DIR}/third_party/mlir-hlo/stablehlo)
+ add_subdirectory(third_party/stablehlo EXCLUDE_FROM_ALL)
+ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/third_party/stablehlo)
+ include_directories(${CMAKE_CURRENT_BINARY_DIR}/third_party/stablehlo)
endif()
# Optional Eigen dependency for some TOSA Ops
diff --git a/README.md b/README.md
index 5dbc0eb..fc77d10 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@
MLIR-EmitC provides a way to translate ML models into C++ code. The repository
contains scripts and tools to translate Keras and TensorFlow models into the
[TOSA](https://mlir.llvm.org/docs/Dialects/TOSA/) and
-[StableHLO](https://github.com/tensorflow/mlir-hlo) dialect and to convert those to
+[StableHLO](https://github.com/openxla/stablehlo/) dialect and to convert those to
[EmitC](https://mlir.llvm.org/docs/Dialects/EmitC/).
The latter is used to generate calls to a reference implementation.
@@ -63,7 +63,7 @@
## Supported Conversions and Translations
-Conversions are supported for [StableHLO](https://github.com/tensorflow/mlir-hlo) ops and some ops of the arith and Tensor dialect.
+Conversions are supported for [StableHLO](https://github.com/openxla/stablehlo/) ops and some ops of the arith and Tensor dialect.
In addition, support for converting Tensor Operator Set Architecture [(TOSA)](https://mlir.llvm.org/docs/Dialects/TOSA/) dialect to EmitC is emerging.
The `emitc-opt` tool supports the following options:
diff --git a/third_party/mlir-hlo b/third_party/mlir-hlo
deleted file mode 160000
index 7cdb136..0000000
--- a/third_party/mlir-hlo
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 7cdb13657b0892ff0699ca5e91f647aeecb30407
diff --git a/third_party/stablehlo b/third_party/stablehlo
new file mode 160000
index 0000000..09c82d2
--- /dev/null
+++ b/third_party/stablehlo
@@ -0,0 +1 @@
+Subproject commit 09c82d2dbefeae322010548ee2542c97364f3d32
diff --git a/tools/emitc-opt/CMakeLists.txt b/tools/emitc-opt/CMakeLists.txt
index 219b6ad..6651068 100644
--- a/tools/emitc-opt/CMakeLists.txt
+++ b/tools/emitc-opt/CMakeLists.txt
@@ -3,9 +3,9 @@
if(${EMITC_ENABLE_HLO})
set(HLO_LIBS
- MhloRegisterDialects
MLIRStablehloToEmitC
MLIRStablehloRegionOpsToEmitC
+ StablehloRegister
)
set(HLO_LIBS_DEPS
MLIREmitCConversionPassIncGen