Removing module dialect specialized opt/translate tools.
These are not useful vs. the main iree-opt/iree-translate as everything
is still compiled in all cases but having them separate prevents using
the dialects in iree-opt/iree-translate/iree-run-mlir and just increases
link time.
Fixes #1262.
Also fixes test execution of these modules on Windows.
Closes https://github.com/google/iree/pull/1263
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/iree/pull/1263 from google:benvanik-mondo-tools f107800452b87bf247a317beef7df1097608545b
PiperOrigin-RevId: 303167394
diff --git a/build_tools/bazel/iree_check_test.bzl b/build_tools/bazel/iree_check_test.bzl
index a244100..c145527 100644
--- a/build_tools/bazel/iree_check_test.bzl
+++ b/build_tools/bazel/iree_check_test.bzl
@@ -45,7 +45,6 @@
"-iree-mlir-to-vm-bytecode-module",
"--iree-hal-target-backends=%s" % target_backend,
],
- translate_tool = "//iree/compiler/Dialect/Modules/Check:check-translate",
visibility = ["//visibility:private"],
)
diff --git a/build_tools/bazel_to_cmake/bazel_to_cmake.py b/build_tools/bazel_to_cmake/bazel_to_cmake.py
index 869d311..33deda8 100755
--- a/build_tools/bazel_to_cmake/bazel_to_cmake.py
+++ b/build_tools/bazel_to_cmake/bazel_to_cmake.py
@@ -149,7 +149,7 @@
return " FLAGS\n%s\n" % (flags_list)
def _convert_translate_tool_block(self, translate_tool):
- if translate_tool:
+ if translate_tool and translate_tool != "//iree/tools:iree-translate":
# Bazel `//iree/base` -> CMake `iree::base`
# Bazel `//iree/base:api` -> CMake `iree::base::api`
translate_tool = translate_tool.replace("//iree", "iree") # iree/base:api
diff --git a/iree/compiler/Dialect/Modules/Check/BUILD b/iree/compiler/Dialect/Modules/Check/BUILD
index 19fd00f..2917f10 100644
--- a/iree/compiler/Dialect/Modules/Check/BUILD
+++ b/iree/compiler/Dialect/Modules/Check/BUILD
@@ -27,19 +27,3 @@
flatten = True,
h_file_output = "check.imports.h",
)
-
-cc_binary(
- name = "check-opt",
- deps = [
- "//iree/compiler/Dialect/Modules/Check/IR:CheckDialect",
- "//iree/tools:iree_opt_main",
- ],
-)
-
-cc_binary(
- name = "check-translate",
- deps = [
- "//iree/compiler/Dialect/Modules/Check/IR:CheckDialect",
- "//iree/tools:iree_translate_main",
- ],
-)
diff --git a/iree/compiler/Dialect/Modules/Check/CMakeLists.txt b/iree/compiler/Dialect/Modules/Check/CMakeLists.txt
index f4dce0c..951175a8 100644
--- a/iree/compiler/Dialect/Modules/Check/CMakeLists.txt
+++ b/iree/compiler/Dialect/Modules/Check/CMakeLists.txt
@@ -28,23 +28,3 @@
FLATTEN
PUBLIC
)
-
-iree_cc_binary(
- NAME
- check-opt
- OUT
- check-opt
- DEPS
- iree::compiler::Dialect::Modules::Check::IR::CheckDialect
- iree::tools::iree_opt_main
-)
-
-iree_cc_binary(
- NAME
- check-translate
- OUT
- check-translate
- DEPS
- iree::compiler::Dialect::Modules::Check::IR::CheckDialect
- iree::tools::iree_translate_main
-)
diff --git a/iree/compiler/Dialect/Modules/Check/test/BUILD b/iree/compiler/Dialect/Modules/Check/test/BUILD
index 4936bb0..14281d1 100644
--- a/iree/compiler/Dialect/Modules/Check/test/BUILD
+++ b/iree/compiler/Dialect/Modules/Check/test/BUILD
@@ -23,7 +23,7 @@
name = "lit",
srcs = glob(["*.mlir"]),
data = [
- "//iree/compiler/Dialect/Modules/Check:check-opt",
"//iree/tools:IreeFileCheck",
+ "//iree/tools:iree-opt",
],
)
diff --git a/iree/compiler/Dialect/Modules/Check/test/CMakeLists.txt b/iree/compiler/Dialect/Modules/Check/test/CMakeLists.txt
index bd7043e..17d53b9 100644
--- a/iree/compiler/Dialect/Modules/Check/test/CMakeLists.txt
+++ b/iree/compiler/Dialect/Modules/Check/test/CMakeLists.txt
@@ -21,6 +21,6 @@
SRCS
"${_GLOB_X_MLIR}"
DATA
- iree::compiler::Dialect::Modules::Check::check-opt
iree::tools::IreeFileCheck
+ iree::tools::iree-opt
)
diff --git a/iree/compiler/Dialect/Modules/Check/test/ops.mlir b/iree/compiler/Dialect/Modules/Check/test/ops.mlir
index 9885595..c3f92a3 100644
--- a/iree/compiler/Dialect/Modules/Check/test/ops.mlir
+++ b/iree/compiler/Dialect/Modules/Check/test/ops.mlir
@@ -14,7 +14,7 @@
// Tests the printing/parsing of the Check dialect ops.
-// RUN: check-opt -split-input-file %s | check-opt -split-input-file | IreeFileCheck %s
+// RUN: iree-opt -split-input-file %s | iree-opt -split-input-file | IreeFileCheck %s
// CHECK-LABEL: @expect_true
// CHECK-SAME: [[ARG:%[a-zA-Z0-9]+]]
diff --git a/iree/compiler/Dialect/Modules/Check/test/vm_import_conversion.mlir b/iree/compiler/Dialect/Modules/Check/test/vm_import_conversion.mlir
deleted file mode 100644
index 7f604a1..0000000
--- a/iree/compiler/Dialect/Modules/Check/test/vm_import_conversion.mlir
+++ /dev/null
@@ -1,85 +0,0 @@
-// RUN: check-opt %s -iree-convert-flow-to-hal -iree-vm-conversion -split-input-file | IreeFileCheck %s
-
-// CHECK-LABEL: @expect_true
-// CHECK-SAME: [[ARG:%[a-zA-Z0-9]+]]
-func @expect_true_i32(%arg : i32) {
- // CHECK: vm.call @check.expect_true([[ARG]]
- check.expect_true(%arg) : i32
- return
-}
-
-// -----
-
-// CHECK-LABEL: @expect_false
-// CHECK-SAME: [[ARG:%[a-zA-Z0-9]+]]
-func @expect_false_i32(%arg : i32) {
- // CHECK: vm.call @check.expect_false([[ARG]]
- check.expect_false(%arg) : i32
- return
-}
-
-// -----
-
-// CHECK-LABEL: @expect_all_true
-// CHECK-SAME: [[ARG:%[a-zA-Z0-9]+]]
-func @expect_all_true(%arg : !hal.buffer_view) {
- // CHECK: vm.call @check.expect_all_true([[ARG]]
- check.expect_all_true(%arg) : !hal.buffer_view
- return
-}
-
-// -----
-
-// CHECK-LABEL: @expect_all_true_tensor
-// CHECK-SAME: [[ARG:%[a-zA-Z0-9]+]]
-func @expect_all_true_tensor(%arg : tensor<2x2xi32>) {
- // CHECK: vm.call @check.expect_all_true(%{{[a-zA-Z0-9]+}}) : (!vm.ref<!hal.buffer_view>) -> ()
- check.expect_all_true(%arg) : tensor<2x2xi32>
- return
-}
-
-// -----
-
-// CHECK-LABEL: @expect_eq
-// CHECK-SAME: [[LHS:%[a-zA-Z0-9]+]]
-// CHECK-SAME: [[RHS:%[a-zA-Z0-9]+]]
-func @expect_eq(%lhs : !hal.buffer_view, %rhs : !hal.buffer_view) {
- // CHECK: vm.call @check.expect_eq([[LHS]], [[RHS]]
- check.expect_eq(%lhs, %rhs) : !hal.buffer_view
- return
-}
-
-// -----
-
-// CHECK-LABEL: @expect_eq_tensor
-// CHECK-SAME: [[LHS:%[a-zA-Z0-9]+]]
-// CHECK-SAME: [[RHS:%[a-zA-Z0-9]+]]
-func @expect_eq_tensor(%lhs : tensor<2x2xi32>, %rhs : tensor<2x2xi32>) {
- // CHECK: vm.call @check.expect_eq
- // CHECK-SAME: (!vm.ref<!hal.buffer_view>, !vm.ref<!hal.buffer_view>) -> ()
- check.expect_eq(%lhs, %rhs) : tensor<2x2xi32>
- return
-}
-
-// -----
-
-// CHECK-LABEL: @expect_almost_eq
-// CHECK-SAME: [[LHS:%[a-zA-Z0-9]+]]
-// CHECK-SAME: [[RHS:%[a-zA-Z0-9]+]]
-func @expect_almost_eq(%lhs : !hal.buffer_view, %rhs : !hal.buffer_view) {
- // CHECK: vm.call @check.expect_almost_eq([[LHS]], [[RHS]]
- check.expect_almost_eq(%lhs, %rhs) : !hal.buffer_view
- return
-}
-
-// -----
-
-// CHECK-LABEL: @expect_almost_eq_tensor
-// CHECK-SAME: [[LHS:%[a-zA-Z0-9]+]]
-// CHECK-SAME: [[RHS:%[a-zA-Z0-9]+]]
-func @expect_almost_eq_tensor(%lhs : tensor<2x2xf32>, %rhs : tensor<2x2xf32>) {
- // CHECK: vm.call @check.expect_almost_eq
- // CHECK-SAME: (!vm.ref<!hal.buffer_view>, !vm.ref<!hal.buffer_view>) -> ()
- check.expect_almost_eq(%lhs, %rhs) : tensor<2x2xf32>
- return
-}
diff --git a/iree/compiler/Dialect/Modules/Strings/BUILD b/iree/compiler/Dialect/Modules/Strings/BUILD
index 9ed7157..48da311 100644
--- a/iree/compiler/Dialect/Modules/Strings/BUILD
+++ b/iree/compiler/Dialect/Modules/Strings/BUILD
@@ -27,19 +27,3 @@
flatten = True,
h_file_output = "strings.imports.h",
)
-
-cc_binary(
- name = "strings-opt",
- deps = [
- "//iree/compiler/Dialect/Modules/Strings/IR:Dialect",
- "//iree/tools:iree_opt_main",
- ],
-)
-
-cc_binary(
- name = "strings-translate",
- deps = [
- "//iree/compiler/Dialect/Modules/Strings/IR:Dialect",
- "//iree/tools:iree_translate_main",
- ],
-)
diff --git a/iree/compiler/Dialect/Modules/Strings/CMakeLists.txt b/iree/compiler/Dialect/Modules/Strings/CMakeLists.txt
index 034d695..f2f151c 100644
--- a/iree/compiler/Dialect/Modules/Strings/CMakeLists.txt
+++ b/iree/compiler/Dialect/Modules/Strings/CMakeLists.txt
@@ -28,23 +28,3 @@
FLATTEN
PUBLIC
)
-
-iree_cc_binary(
- NAME
- strings-opt
- OUT
- strings-opt
- DEPS
- iree::compiler::Dialect::Modules::Strings::IR::Dialect
- iree::tools::iree_opt_main
-)
-
-iree_cc_binary(
- NAME
- strings-translate
- OUT
- strings-translate
- DEPS
- iree::compiler::Dialect::Modules::Strings::IR::Dialect
- iree::tools::iree_translate_main
-)
diff --git a/iree/compiler/Dialect/Modules/Strings/IR/test/BUILD b/iree/compiler/Dialect/Modules/Strings/IR/test/BUILD
index 95c28c9..7c58b4a 100644
--- a/iree/compiler/Dialect/Modules/Strings/IR/test/BUILD
+++ b/iree/compiler/Dialect/Modules/Strings/IR/test/BUILD
@@ -23,7 +23,7 @@
name = "lit",
srcs = glob(["*.mlir"]),
data = [
- "//iree/compiler/Dialect/Modules/Strings:strings-opt",
"//iree/tools:IreeFileCheck",
+ "//iree/tools:iree-opt",
],
)
diff --git a/iree/compiler/Dialect/Modules/Strings/IR/test/CMakeLists.txt b/iree/compiler/Dialect/Modules/Strings/IR/test/CMakeLists.txt
index 79c0448..17d53b9 100644
--- a/iree/compiler/Dialect/Modules/Strings/IR/test/CMakeLists.txt
+++ b/iree/compiler/Dialect/Modules/Strings/IR/test/CMakeLists.txt
@@ -21,6 +21,6 @@
SRCS
"${_GLOB_X_MLIR}"
DATA
- iree::compiler::Dialect::Modules::Strings::strings-opt
iree::tools::IreeFileCheck
+ iree::tools::iree-opt
)
diff --git a/iree/compiler/Dialect/Modules/Strings/IR/test/conversion.mlir b/iree/compiler/Dialect/Modules/Strings/IR/test/conversion.mlir
deleted file mode 100644
index fc1b88d..0000000
--- a/iree/compiler/Dialect/Modules/Strings/IR/test/conversion.mlir
+++ /dev/null
@@ -1,21 +0,0 @@
-// RUN: strings-opt %s -iree-vm-conversion -split-input-file | IreeFileCheck %s
-
-// CHECK-LABEL: @i32ToStringOp
-func @i32ToStringOp(%arg0 : i32) -> !strings.string {
- // CHECK: vm.call @strings.i32_to_string(%arg0) : (i32) -> !vm.ref<!strings.string>
- %0 = "strings.i32_to_string"(%arg0) : (i32) -> !strings.string
- return %0 : !strings.string
-}
-
-// CHECK: vm.import @strings.i32_to_string
-
-// -----
-
-// CHECK-LABEL: @printOp
-func @printOp(%arg0 : !strings.string) {
- // CHECK: vm.call @strings.print(%arg0) : (!vm.ref<!strings.string>)
- "strings.print"(%arg0) : (!strings.string) -> ()
- return
-}
-
-// CHECK: vm.import @strings.print
diff --git a/iree/compiler/Dialect/Modules/Strings/IR/test/strings_ops.mlir b/iree/compiler/Dialect/Modules/Strings/IR/test/strings_ops.mlir
index 0007eff..a7dc1fc 100644
--- a/iree/compiler/Dialect/Modules/Strings/IR/test/strings_ops.mlir
+++ b/iree/compiler/Dialect/Modules/Strings/IR/test/strings_ops.mlir
@@ -1,4 +1,4 @@
-// RUN: strings-opt -split-input-file %s | strings-opt -split-input-file | IreeFileCheck %s
+// RUN: iree-opt -split-input-file %s | iree-opt -split-input-file | IreeFileCheck %s
// CHECK-LABEL: @i32ToStringOp
func @i32ToStringOp(%arg0 : i32) -> !strings.string {
diff --git a/iree/compiler/Dialect/Modules/TensorList/BUILD b/iree/compiler/Dialect/Modules/TensorList/BUILD
index c27364c..c6b986e 100644
--- a/iree/compiler/Dialect/Modules/TensorList/BUILD
+++ b/iree/compiler/Dialect/Modules/TensorList/BUILD
@@ -32,19 +32,3 @@
flatten = True,
h_file_output = "tensorlist.imports.h",
)
-
-cc_binary(
- name = "tensorlist-opt",
- deps = [
- "//iree/compiler/Dialect/Modules/TensorList/IR:TensorListDialect",
- "//iree/tools:iree_opt_main",
- ],
-)
-
-cc_binary(
- name = "tensorlist-translate",
- deps = [
- "//iree/compiler/Dialect/Modules/TensorList/IR:TensorListDialect",
- "//iree/tools:iree_translate_main",
- ],
-)
diff --git a/iree/compiler/Dialect/Modules/TensorList/CMakeLists.txt b/iree/compiler/Dialect/Modules/TensorList/CMakeLists.txt
index 2ab4319..8c8a73a 100644
--- a/iree/compiler/Dialect/Modules/TensorList/CMakeLists.txt
+++ b/iree/compiler/Dialect/Modules/TensorList/CMakeLists.txt
@@ -29,23 +29,3 @@
FLATTEN
PUBLIC
)
-
-iree_cc_binary(
- NAME
- tensorlist-opt
- OUT
- tensorlist-opt
- DEPS
- iree::compiler::Dialect::Modules::TensorList::IR::TensorListDialect
- iree::tools::iree_opt_main
-)
-
-iree_cc_binary(
- NAME
- tensorlist-translate
- OUT
- tensorlist-translate
- DEPS
- iree::compiler::Dialect::Modules::TensorList::IR::TensorListDialect
- iree::tools::iree_translate_main
-)
diff --git a/iree/compiler/Dialect/Modules/TensorList/Conversion/test/BUILD b/iree/compiler/Dialect/Modules/TensorList/Conversion/test/BUILD
index c429fd0..7c58b4a 100644
--- a/iree/compiler/Dialect/Modules/TensorList/Conversion/test/BUILD
+++ b/iree/compiler/Dialect/Modules/TensorList/Conversion/test/BUILD
@@ -23,7 +23,7 @@
name = "lit",
srcs = glob(["*.mlir"]),
data = [
- "//iree/compiler/Dialect/Modules/TensorList:tensorlist-opt",
"//iree/tools:IreeFileCheck",
+ "//iree/tools:iree-opt",
],
)
diff --git a/iree/compiler/Dialect/Modules/TensorList/Conversion/test/CMakeLists.txt b/iree/compiler/Dialect/Modules/TensorList/Conversion/test/CMakeLists.txt
index a83ec11..17d53b9 100644
--- a/iree/compiler/Dialect/Modules/TensorList/Conversion/test/CMakeLists.txt
+++ b/iree/compiler/Dialect/Modules/TensorList/Conversion/test/CMakeLists.txt
@@ -21,6 +21,6 @@
SRCS
"${_GLOB_X_MLIR}"
DATA
- iree::compiler::Dialect::Modules::TensorList::tensorlist-opt
iree::tools::IreeFileCheck
+ iree::tools::iree-opt
)
diff --git a/iree/compiler/Dialect/Modules/TensorList/Conversion/test/convert_hal_to_vm.mlir b/iree/compiler/Dialect/Modules/TensorList/Conversion/test/convert_hal_to_vm.mlir
index dbf47fd..070b3b7 100644
--- a/iree/compiler/Dialect/Modules/TensorList/Conversion/test/convert_hal_to_vm.mlir
+++ b/iree/compiler/Dialect/Modules/TensorList/Conversion/test/convert_hal_to_vm.mlir
@@ -1,4 +1,4 @@
-// RUN: tensorlist-opt <%s -iree-vm-conversion -split-input-file | IreeFileCheck %s
+// RUN: iree-opt <%s -iree-vm-conversion -split-input-file | IreeFileCheck %s
// CHECK-LABEL: @Reserve
func @Reserve(%element_shape: !hal.buffer_view, %num_elements: !hal.buffer_view) -> !tensorlist.list {
diff --git a/iree/compiler/Dialect/Modules/TensorList/IR/test/BUILD b/iree/compiler/Dialect/Modules/TensorList/IR/test/BUILD
index c429fd0..7c58b4a 100644
--- a/iree/compiler/Dialect/Modules/TensorList/IR/test/BUILD
+++ b/iree/compiler/Dialect/Modules/TensorList/IR/test/BUILD
@@ -23,7 +23,7 @@
name = "lit",
srcs = glob(["*.mlir"]),
data = [
- "//iree/compiler/Dialect/Modules/TensorList:tensorlist-opt",
"//iree/tools:IreeFileCheck",
+ "//iree/tools:iree-opt",
],
)
diff --git a/iree/compiler/Dialect/Modules/TensorList/IR/test/CMakeLists.txt b/iree/compiler/Dialect/Modules/TensorList/IR/test/CMakeLists.txt
index a83ec11..17d53b9 100644
--- a/iree/compiler/Dialect/Modules/TensorList/IR/test/CMakeLists.txt
+++ b/iree/compiler/Dialect/Modules/TensorList/IR/test/CMakeLists.txt
@@ -21,6 +21,6 @@
SRCS
"${_GLOB_X_MLIR}"
DATA
- iree::compiler::Dialect::Modules::TensorList::tensorlist-opt
iree::tools::IreeFileCheck
+ iree::tools::iree-opt
)
diff --git a/iree/compiler/Dialect/Modules/TensorList/IR/test/ops.mlir b/iree/compiler/Dialect/Modules/TensorList/IR/test/ops.mlir
index f9e9254..7474aff 100644
--- a/iree/compiler/Dialect/Modules/TensorList/IR/test/ops.mlir
+++ b/iree/compiler/Dialect/Modules/TensorList/IR/test/ops.mlir
@@ -1,4 +1,4 @@
-// RUN: tensorlist-opt -split-input-file %s | tensorlist-opt -split-input-file | IreeFileCheck %s
+// RUN: iree-opt -split-input-file %s | iree-opt -split-input-file | IreeFileCheck %s
// CHECK-LABEL: @Reserve
func @Reserve(%element_shape: !hal.buffer_view, %num_elements: !hal.buffer_view) -> !tensorlist.list {
diff --git a/iree/modules/check/test/BUILD b/iree/modules/check/test/BUILD
index dab1dbf..7a9e977 100644
--- a/iree/modules/check/test/BUILD
+++ b/iree/modules/check/test/BUILD
@@ -24,9 +24,9 @@
name = "lit",
srcs = glob(["*.mlir"]),
data = [
- "//iree/compiler/Dialect/Modules/Check:check-translate",
"//iree/modules/check:iree-check-module",
"//iree/tools:IreeFileCheck",
+ "//iree/tools:iree-translate",
],
tags = ["hostonly"],
)
diff --git a/iree/modules/check/test/CMakeLists.txt b/iree/modules/check/test/CMakeLists.txt
index 6c5d9af..4ba5f30 100644
--- a/iree/modules/check/test/CMakeLists.txt
+++ b/iree/modules/check/test/CMakeLists.txt
@@ -21,7 +21,7 @@
SRCS
"${_GLOB_X_MLIR}"
DATA
- iree::compiler::Dialect::Modules::Check::check-translate
iree::modules::check::iree-check-module
iree::tools::IreeFileCheck
+ iree::tools::iree-translate
)
diff --git a/iree/modules/check/test/failure.mlir b/iree/modules/check/test/failure.mlir
index 2038dcf..33110a0 100644
--- a/iree/modules/check/test/failure.mlir
+++ b/iree/modules/check/test/failure.mlir
@@ -1,5 +1,5 @@
-// RUN: check-translate --iree-hal-target-backends=vmla -iree-mlir-to-vm-bytecode-module %s | iree-check-module --expect_failure | IreeFileCheck %s
-// RUN: [[ $IREE_VULKAN_DISABLE == 1 ]] || (check-translate --iree-hal-target-backends=vulkan-spirv -iree-mlir-to-vm-bytecode-module %s | iree-check-module --driver=vulkan --expect_failure | IreeFileCheck %s)
+// RUN: iree-translate --iree-hal-target-backends=vmla -iree-mlir-to-vm-bytecode-module %s | iree-check-module --expect_failure | IreeFileCheck %s
+// RUN: [[ $IREE_VULKAN_DISABLE == 1 ]] || (iree-translate --iree-hal-target-backends=vulkan-spirv -iree-mlir-to-vm-bytecode-module %s | iree-check-module --driver=vulkan --expect_failure | IreeFileCheck %s)
// CHECK-LABEL: expect_failure.expect_true_of_false
// CHECK: Expected 0 to be nonzero
diff --git a/iree/modules/check/test/success.mlir b/iree/modules/check/test/success.mlir
index 724f745..5bebdd6 100644
--- a/iree/modules/check/test/success.mlir
+++ b/iree/modules/check/test/success.mlir
@@ -1,5 +1,5 @@
-// RUN: check-translate --iree-hal-target-backends=vmla -iree-mlir-to-vm-bytecode-module %s | iree-check-module --driver=vmla
-// RUN: [[ $IREE_VULKAN_DISABLE == 1 ]] || (check-translate --iree-hal-target-backends=vulkan-spirv -iree-mlir-to-vm-bytecode-module %s | iree-check-module --driver=vulkan)
+// RUN: iree-translate --iree-hal-target-backends=vmla -iree-mlir-to-vm-bytecode-module %s | iree-check-module --driver=vmla
+// RUN: [[ $IREE_VULKAN_DISABLE == 1 ]] || (iree-translate --iree-hal-target-backends=vulkan-spirv -iree-mlir-to-vm-bytecode-module %s | iree-check-module --driver=vulkan)
func @expect_true() attributes { iree.module.export } {
%true = iree.unfoldable_constant 1 : i32
diff --git a/iree/modules/strings/BUILD b/iree/modules/strings/BUILD
index ad26c28..60df7c8 100644
--- a/iree/modules/strings/BUILD
+++ b/iree/modules/strings/BUILD
@@ -53,5 +53,4 @@
src = "strings_module_test.mlir",
cc_namespace = "iree::strings_module_test",
flags = ["-iree-mlir-to-vm-bytecode-module"],
- translate_tool = "//iree/compiler/Dialect/Modules/Strings:strings-translate",
)
diff --git a/iree/modules/strings/CMakeLists.txt b/iree/modules/strings/CMakeLists.txt
index d0b532b..0db3ea2 100644
--- a/iree/modules/strings/CMakeLists.txt
+++ b/iree/modules/strings/CMakeLists.txt
@@ -68,8 +68,6 @@
"strings_module_test.mlir"
CC_NAMESPACE
"iree::strings_module_test"
- TRANSLATE_TOOL
- iree_compiler_Dialect_Modules_Strings_strings-translate
FLAGS
"-iree-mlir-to-vm-bytecode-module"
PUBLIC
diff --git a/iree/modules/tensorlist/BUILD b/iree/modules/tensorlist/BUILD
index 3584690..6ceb95c 100644
--- a/iree/modules/tensorlist/BUILD
+++ b/iree/modules/tensorlist/BUILD
@@ -24,7 +24,6 @@
src = "tensorlist_test.mlir",
cc_namespace = "iree::modules::tensorlist",
flags = ["-iree-mlir-to-vm-bytecode-module"],
- translate_tool = "//iree/compiler/Dialect/Modules/TensorList:tensorlist-translate",
)
cc_test(
diff --git a/iree/modules/tensorlist/CMakeLists.txt b/iree/modules/tensorlist/CMakeLists.txt
index a98ed35..eb2880a 100644
--- a/iree/modules/tensorlist/CMakeLists.txt
+++ b/iree/modules/tensorlist/CMakeLists.txt
@@ -21,8 +21,6 @@
"tensorlist_test.mlir"
CC_NAMESPACE
"iree::modules::tensorlist"
- TRANSLATE_TOOL
- iree_compiler_Dialect_Modules_TensorList_tensorlist-translate
FLAGS
"-iree-mlir-to-vm-bytecode-module"
PUBLIC
diff --git a/iree/samples/simple_embedding/CMakeLists.txt b/iree/samples/simple_embedding/CMakeLists.txt
index 4ff6210..5dd80be 100644
--- a/iree/samples/simple_embedding/CMakeLists.txt
+++ b/iree/samples/simple_embedding/CMakeLists.txt
@@ -21,8 +21,6 @@
"simple_embedding_test.mlir"
CC_NAMESPACE
"iree::samples"
- TRANSLATE_TOOL
- iree_tools_iree-translate
FLAGS
"-iree-mlir-to-vm-bytecode-module"
PUBLIC
diff --git a/iree/tools/BUILD b/iree/tools/BUILD
index 83c8585..c8dda90 100644
--- a/iree/tools/BUILD
+++ b/iree/tools/BUILD
@@ -27,12 +27,18 @@
"sanitizer_suppressions.txt",
])
-TARGET_COMPILER_BACKENDS = [
+IREE_COMPILER_TARGET_BACKENDS = [
"//iree/compiler/Dialect/HAL/Target/VMLA",
"//iree/compiler/Dialect/HAL/Target/VulkanSPIRV",
"//iree/compiler/Dialect/HAL/Target/LLVM",
]
+IREE_COMPILER_DIALECT_MODULES = [
+ "//iree/compiler/Dialect/Modules/Check/IR:CheckDialect",
+ "//iree/compiler/Dialect/Modules/Strings/IR:Dialect",
+ "//iree/compiler/Dialect/Modules/TensorList/IR:TensorListDialect",
+]
+
cc_binary(
name = "iree-benchmark-module",
testonly = True,
@@ -136,7 +142,7 @@
"@org_tensorflow//tensorflow/compiler/mlir/xla:xla_dialect_registration",
"@org_tensorflow//tensorflow/compiler/mlir/xla:xla_legalize_control_flow",
"@org_tensorflow//tensorflow/compiler/mlir/xla:xla_test_passes",
- ] + TARGET_COMPILER_BACKENDS,
+ ] + IREE_COMPILER_DIALECT_MODULES + IREE_COMPILER_TARGET_BACKENDS,
)
cc_binary(
@@ -179,7 +185,7 @@
"//iree/base:init",
"//iree/base:status",
"//iree/compiler/Translation:IREEVM",
- ] + TARGET_COMPILER_BACKENDS + PLATFORM_VULKAN_DEPS + IREE_DRIVER_MODULES,
+ ] + IREE_COMPILER_DIALECT_MODULES + IREE_COMPILER_TARGET_BACKENDS + PLATFORM_VULKAN_DEPS + IREE_DRIVER_MODULES,
)
cc_binary(
@@ -230,7 +236,7 @@
"@llvm-project//mlir:TranslateClParser",
"@llvm-project//mlir:Translation",
"@org_tensorflow//tensorflow/compiler/mlir/xla:xla_dialect_registration",
- ] + TARGET_COMPILER_BACKENDS,
+ ] + IREE_COMPILER_DIALECT_MODULES + IREE_COMPILER_TARGET_BACKENDS,
alwayslink = 1,
)
diff --git a/iree/tools/CMakeLists.txt b/iree/tools/CMakeLists.txt
index db45a6e..fa969d7 100644
--- a/iree/tools/CMakeLists.txt
+++ b/iree/tools/CMakeLists.txt
@@ -30,6 +30,12 @@
"iree::compiler::Dialect::HAL::Target::VulkanSPIRV"
)
+set(IREE_COMPILER_DIALECT_MODULES
+ "iree::compiler::Dialect::Modules::Check::IR::CheckDialect"
+ "iree::compiler::Dialect::Modules::Strings::IR::Dialect"
+ "iree::compiler::Dialect::Modules::TensorList::IR::TensorListDialect"
+)
+
iree_cc_binary(
NAME
iree-benchmark-module
@@ -179,6 +185,7 @@
iree::compiler::Translation::SPIRV::XLAToSPIRV
iree::compiler::Translation::CodegenPasses
tensorflow::mlir_xla
+ ${IREE_COMPILER_DIALECT_MODULES}
${IREE_COMPILER_TARGET_BACKENDS}
PUBLIC
)
@@ -227,6 +234,7 @@
iree::vm
iree::vm::bytecode_module
iree::vm::value
+ ${IREE_COMPILER_DIALECT_MODULES}
${IREE_COMPILER_TARGET_BACKENDS}
${IREE_HAL_DRIVER_MODULES}
)
@@ -249,6 +257,7 @@
iree::compiler::Translation::IREEVM
iree::compiler::Translation::SPIRV::XLAToSPIRV
tensorflow::mlir_xla
+ ${IREE_COMPILER_DIALECT_MODULES}
${IREE_COMPILER_TARGET_BACKENDS}
ALWAYSLINK
PUBLIC
diff --git a/iree/vm/CMakeLists.txt b/iree/vm/CMakeLists.txt
index d0412cf..940beea 100644
--- a/iree/vm/CMakeLists.txt
+++ b/iree/vm/CMakeLists.txt
@@ -38,8 +38,6 @@
"bytecode_dispatch_test.mlir"
CC_NAMESPACE
"iree::vm"
- TRANSLATE_TOOL
- iree_tools_iree-translate
FLAGS
"-iree-vm-ir-to-bytecode-module"
PUBLIC
@@ -95,8 +93,6 @@
"bytecode_module_benchmark.mlir"
CC_NAMESPACE
"iree::vm"
- TRANSLATE_TOOL
- iree_tools_iree-translate
FLAGS
"-iree-vm-ir-to-bytecode-module"
PUBLIC