[mhlo] Drop unnecessary build dependencies (#12728)
Also update the bazel-cmake target mapping to avoid pulling in unused
cmake targets.
Issue: https://github.com/openxla/iree/issues/12678
diff --git a/build_tools/bazel_to_cmake/bazel_to_cmake_targets.py b/build_tools/bazel_to_cmake/bazel_to_cmake_targets.py
index fd5884e..9948c76 100644
--- a/build_tools/bazel_to_cmake/bazel_to_cmake_targets.py
+++ b/build_tools/bazel_to_cmake/bazel_to_cmake_targets.py
@@ -84,11 +84,6 @@
"ChloOps",
"MhloDialect",
],
- "@mlir-hlo//:map_lmhlo_to_scalar_op": [
- "tensorflow::external_mhlo_includes",
- "LmhloDialect", # Unfortunate.
- "MhloDialect",
- ],
"@mlir-hlo//:map_mhlo_to_scalar_op": [
"tensorflow::external_mhlo_includes",
"MhloDialect",
@@ -97,12 +92,12 @@
"tensorflow::external_mhlo_includes",
"MhloPasses",
"MhloShapeOpsToStandard",
- "MhloToArithmeticConversion",
- "MhloToLhloConversion",
"MhloToLinalg",
- "MhloToMemrefConversion",
"MhloToStandard",
"StablehloToMhlo",
+ # Note: We deliberately omit some passes that we do not use in IREE,
+ # e.g.: MhloToArithmeticConversion, MhloToLhloConversion, or
+ # MhloToMemrefConversion.
],
"@mlir-hlo//:unfuse_batch_norm": [
"tensorflow::external_mhlo_includes",
diff --git a/compiler/src/iree/compiler/InputConversion/MHLO/BUILD.bazel b/compiler/src/iree/compiler/InputConversion/MHLO/BUILD.bazel
index 7912457..1cbd07c 100644
--- a/compiler/src/iree/compiler/InputConversion/MHLO/BUILD.bazel
+++ b/compiler/src/iree/compiler/InputConversion/MHLO/BUILD.bazel
@@ -100,11 +100,9 @@
"@llvm-project//mlir:Transforms",
"@mlir-hlo//:chlo_legalize_to_hlo",
"@mlir-hlo//:map_chlo_to_hlo_op",
- "@mlir-hlo//:map_lmhlo_to_scalar_op",
"@mlir-hlo//:map_mhlo_to_scalar_op",
"@mlir-hlo//:mhlo_passes",
"@mlir-hlo//:mlir_hlo",
- "@mlir-hlo//:unfuse_batch_norm",
"@mlir-hlo//stablehlo:broadcast_utils",
"@mlir-hlo//stablehlo:chlo_ops",
],
diff --git a/compiler/src/iree/compiler/InputConversion/MHLO/CMakeLists.txt b/compiler/src/iree/compiler/InputConversion/MHLO/CMakeLists.txt
index 4afeac3..b3dc7f1 100644
--- a/compiler/src/iree/compiler/InputConversion/MHLO/CMakeLists.txt
+++ b/compiler/src/iree/compiler/InputConversion/MHLO/CMakeLists.txt
@@ -59,7 +59,6 @@
IREELinalgExtDialect
IREELinalgExtPasses
LLVMSupport
- LmhloDialect
MLIRAffineDialect
MLIRAffineUtils
MLIRArithDialect
@@ -87,10 +86,7 @@
MhloDialect
MhloPasses
MhloShapeOpsToStandard
- MhloToArithmeticConversion
- MhloToLhloConversion
MhloToLinalg
- MhloToMemrefConversion
MhloToStandard
StablehloBroadcastUtils
StablehloToMhlo
diff --git a/compiler/src/iree/compiler/Tools/BUILD.bazel b/compiler/src/iree/compiler/Tools/BUILD.bazel
index bfd07e9..a3294fd 100644
--- a/compiler/src/iree/compiler/Tools/BUILD.bazel
+++ b/compiler/src/iree/compiler/Tools/BUILD.bazel
@@ -43,7 +43,6 @@
"@llvm-project//mlir:ConversionPasses",
"@llvm-project//mlir:IR",
"@llvm-project//mlir:TosaDialect",
- "@mlir-hlo//:lhlo",
"@mlir-hlo//:mlir_hlo",
"@mlir-hlo//stablehlo:chlo_ops",
"@mlir-hlo//stablehlo:stablehlo_ops",