Enable dylib-llvm-aot tests and switch from testing JIT to AOT. (#3928)
This will let us remove the LLVM JIT compiler target and runtime HAL, supporting #3843.
Resolves some TODOs referencing #2645.
Fixes #2537 and fixes #2673.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d46965d..df30d08 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -124,7 +124,7 @@
# List of all target backends to be built by default:
set(IREE_ALL_TARGET_BACKENDS
- # TODO(#2645): Add DYLIB-LLVM-AOT when it doesn't require an env var
+ DYLIB-LLVM-AOT
LLVM-IR
Metal-SPIRV
Vulkan-SPIRV
diff --git a/build_tools/bazel/build_bindings.sh b/build_tools/bazel/build_bindings.sh
index f5c4d2c..33712b2 100755
--- a/build_tools/bazel/build_bindings.sh
+++ b/build_tools/bazel/build_bindings.sh
@@ -19,7 +19,7 @@
# Looks at environment variables and uses CI-friendly defaults if they are not
# set.
-# IREE_LLVMJIT_DISABLE: Do not run tests that require LLVM-JIT. Default: 0
+# IREE_LLVMAOT_DISABLE: Do not run tests that require LLVM-AOT. Default: 0
# IREE_VULKAN_DISABLE: Do not run tests that require Vulkan. Default: 1
# BUILD_TAG_FILTERS: Passed to bazel to filter targets to build.
# See https://docs.bazel.build/versions/master/command-line-reference.html#flag--build_tag_filters)
@@ -33,15 +33,15 @@
set -x
# Use user-environment variables if set, otherwise use CI-friendly defaults.
-if ! [[ -v IREE_LLVMJIT_DISABLE ]]; then
- IREE_LLVMJIT_DISABLE=0
+if ! [[ -v IREE_LLVMAOT_DISABLE ]]; then
+ IREE_LLVMAOT_DISABLE=0
fi
if ! [[ -v IREE_VULKAN_DISABLE ]]; then
IREE_VULKAN_DISABLE=0
fi
declare -a test_env_args=(
- --test_env=IREE_LLVMJIT_DISABLE=$IREE_LLVMJIT_DISABLE
+ --test_env=IREE_LLVMAOT_DISABLE=$IREE_LLVMAOT_DISABLE
--test_env=IREE_VULKAN_DISABLE=$IREE_VULKAN_DISABLE
--action_env=IREE_LLVMAOT_LINKER_PATH=$IREE_LLVMAOT_LINKER_PATH
)
@@ -52,8 +52,8 @@
if [[ "${IREE_VULKAN_DISABLE?}" == 1 ]]; then
default_test_tag_filters+=("-driver=vulkan")
fi
-if [[ "${IREE_LLVMJIT_DISABLE?}" == 1 ]]; then
- default_test_tag_filters+=("-driver=llvm")
+if [[ "${IREE_LLVMAOT_DISABLE?}" == 1 ]]; then
+ default_test_tag_filters+=("-driver=dylib")
fi
# Use user-environment variables if set, otherwise use CI-friendly defaults.
diff --git a/build_tools/bazel/build_core.sh b/build_tools/bazel/build_core.sh
index 48f2642..0eb0540 100755
--- a/build_tools/bazel/build_core.sh
+++ b/build_tools/bazel/build_core.sh
@@ -19,7 +19,7 @@
# Looks at environment variables and uses CI-friendly defaults if they are not
# set.
-# IREE_LLVMJIT_DISABLE: Do not run tests that require LLVM-JIT. Default: 0
+# IREE_LLVMAOT_DISABLE: Do not run tests that require LLVM-AOT. Default: 0
# IREE_VULKAN_DISABLE: Do not run tests that require Vulkan. Default: 1
# BUILD_TAG_FILTERS: Passed to bazel to filter targets to build.
# See https://docs.bazel.build/versions/master/command-line-reference.html#flag--build_tag_filters)
@@ -33,14 +33,14 @@
set -x
# Use user-environment variables if set, otherwise use CI-friendly defaults.
-if ! [[ -v IREE_LLVMJIT_DISABLE ]]; then
- IREE_LLVMJIT_DISABLE=0
+if ! [[ -v IREE_LLVMAOT_DISABLE ]]; then
+ IREE_LLVMAOT_DISABLE=0
fi
if ! [[ -v IREE_VULKAN_DISABLE ]]; then
IREE_VULKAN_DISABLE=0
fi
declare -a test_env_args=(
- --test_env=IREE_LLVMJIT_DISABLE=$IREE_LLVMJIT_DISABLE
+ --test_env=IREE_LLVMAOT_DISABLE=$IREE_LLVMAOT_DISABLE
--test_env=IREE_VULKAN_DISABLE=$IREE_VULKAN_DISABLE
--action_env=IREE_LLVMAOT_LINKER_PATH=$IREE_LLVMAOT_LINKER_PATH
)
@@ -51,8 +51,8 @@
if [[ "${IREE_VULKAN_DISABLE?}" == 1 ]]; then
default_test_tag_filters+=("-driver=vulkan")
fi
-if [[ "${IREE_LLVMJIT_DISABLE?}" == 1 ]]; then
- default_test_tag_filters+=("-driver=llvm")
+if [[ "${IREE_LLVMAOT_DISABLE?}" == 1 ]]; then
+ default_test_tag_filters+=("-driver=dylib")
fi
# Use user-environment variables if set, otherwise use CI-friendly defaults.
diff --git a/build_tools/bazel/build_tensorflow.sh b/build_tools/bazel/build_tensorflow.sh
index 055e586..e5af85e 100755
--- a/build_tools/bazel/build_tensorflow.sh
+++ b/build_tools/bazel/build_tensorflow.sh
@@ -19,7 +19,7 @@
# Looks at environment variables and uses CI-friendly defaults if they are not
# set.
-# IREE_LLVMJIT_DISABLE: Do not run tests that require LLVM-JIT. Default: 0
+# IREE_LLVMAOT_DISABLE: Do not run tests that require LLVM-AOT. Default: 0
# IREE_VULKAN_DISABLE: Do not run tests that require Vulkan. Default: 1
# BUILD_TAG_FILTERS: Passed to bazel to filter targets to build.
# See https://docs.bazel.build/versions/master/command-line-reference.html#flag--build_tag_filters)
@@ -33,14 +33,14 @@
set -x
# Use user-environment variables if set, otherwise use CI-friendly defaults.
-if ! [[ -v IREE_LLVMJIT_DISABLE ]]; then
- IREE_LLVMJIT_DISABLE=0
+if ! [[ -v IREE_LLVMAOT_DISABLE ]]; then
+ IREE_LLVMAOT_DISABLE=0
fi
if ! [[ -v IREE_VULKAN_DISABLE ]]; then
IREE_VULKAN_DISABLE=0
fi
declare -a test_env_args=(
- --test_env=IREE_LLVMJIT_DISABLE=$IREE_LLVMJIT_DISABLE
+ --test_env=IREE_LLVMAOT_DISABLE=$IREE_LLVMAOT_DISABLE
--test_env=IREE_VULKAN_DISABLE=$IREE_VULKAN_DISABLE
--action_env=IREE_LLVMAOT_LINKER_PATH=$IREE_LLVMAOT_LINKER_PATH
)
@@ -56,8 +56,8 @@
if [[ "${IREE_VULKAN_DISABLE?}" == 1 ]]; then
default_test_tag_filters+=("-driver=vulkan")
fi
-if [[ "${IREE_LLVMJIT_DISABLE?}" == 1 ]]; then
- default_test_tag_filters+=("-driver=llvm")
+if [[ "${IREE_LLVMAOT_DISABLE?}" == 1 ]]; then
+ default_test_tag_filters+=("-driver=dylib")
fi
# Use user-environment variables if set, otherwise use CI-friendly defaults.
diff --git a/build_tools/bazel/iree_check_test.bzl b/build_tools/bazel/iree_check_test.bzl
index fc9c955..5db74df 100644
--- a/build_tools/bazel/iree_check_test.bzl
+++ b/build_tools/bazel/iree_check_test.bzl
@@ -20,7 +20,7 @@
ALL_TARGET_BACKENDS_AND_DRIVERS = [
("vmla", "vmla"),
("vulkan-spirv", "vulkan"),
- ("llvm-ir", "llvm"),
+ ("dylib-llvm-aot", "dylib"),
]
def iree_check_test(
diff --git a/build_tools/cmake/build_docs.sh b/build_tools/cmake/build_docs.sh
index c9e3e1b..d800329 100755
--- a/build_tools/cmake/build_docs.sh
+++ b/build_tools/cmake/build_docs.sh
@@ -112,7 +112,7 @@
mkdir -p ${BUILD_DIR}/doc/ir_examples
-build_one_example iree/samples/ops/mhlo-dot.mlir llvm-ir
+build_one_example iree/samples/ops/mhlo-dot.mlir dylib-llvm-aot
build_one_example iree/samples/ops/mhlo-dot.mlir vmla
build_one_example iree/samples/ops/mhlo-dot.mlir vulkan-spirv
build_one_example iree/samples/ops/dynamic-mhlo-dot.mlir vmla
diff --git a/build_tools/cmake/iree_check_test.cmake b/build_tools/cmake/iree_check_test.cmake
index 5713a5a..2974a93 100644
--- a/build_tools/cmake/iree_check_test.cmake
+++ b/build_tools/cmake/iree_check_test.cmake
@@ -52,17 +52,34 @@
set(_NAME "${_PACKAGE_NAME}_${_RULE_NAME}")
set(_MODULE_NAME "${_RULE_NAME}_module")
- iree_bytecode_module(
- NAME
- "${_MODULE_NAME}"
- SRC
- "${_RULE_SRC}"
- FLAGS
- "-iree-mlir-to-vm-bytecode-module"
- "--iree-hal-target-backends=${_RULE_TARGET_BACKEND}"
- ${_RULE_COMPILER_FLAGS}
- TESTONLY
- )
+
+ if(ANDROID)
+ iree_bytecode_module(
+ NAME
+ "${_MODULE_NAME}"
+ SRC
+ "${_RULE_SRC}"
+ FLAGS
+ "-iree-mlir-to-vm-bytecode-module"
+ "--iree-hal-target-backends=${_RULE_TARGET_BACKEND}"
+ # TODO(ataei): Get target from arguments passed to build
+ "--iree-llvm-target-triple=aarch64-none-linux-android30"
+ ${_RULE_COMPILER_FLAGS}
+ TESTONLY
+ )
+ else(ANDROID)
+ iree_bytecode_module(
+ NAME
+ "${_MODULE_NAME}"
+ SRC
+ "${_RULE_SRC}"
+ FLAGS
+ "-iree-mlir-to-vm-bytecode-module"
+ "--iree-hal-target-backends=${_RULE_TARGET_BACKEND}"
+ ${_RULE_COMPILER_FLAGS}
+ TESTONLY
+ )
+ endif(ANDROID)
# TODO(b/146898896): It would be nice if this were something we could query
# rather than having to know the conventions used by iree_bytecode_module.
@@ -245,8 +262,8 @@
)
if(NOT DEFINED _RULE_TARGET_BACKENDS AND NOT DEFINED _RULE_DRIVERS)
- set(_RULE_TARGET_BACKENDS "vmla" "vulkan-spirv" "llvm-ir")
- set(_RULE_DRIVERS "vmla" "vulkan" "llvm")
+ set(_RULE_TARGET_BACKENDS "vmla" "vulkan-spirv" "dylib-llvm-aot")
+ set(_RULE_DRIVERS "vmla" "vulkan" "dylib")
endif()
list(LENGTH _RULE_TARGET_BACKENDS _TARGET_BACKEND_COUNT)
diff --git a/build_tools/cmake/iree_macros.cmake b/build_tools/cmake/iree_macros.cmake
index 8f4e5d2..a6ce531 100644
--- a/build_tools/cmake/iree_macros.cmake
+++ b/build_tools/cmake/iree_macros.cmake
@@ -330,7 +330,7 @@
if(NOT ${IREE_TARGET_BACKEND_VULKAN-SPIRV} OR NOT ${IREE_HAL_DRIVER_VULKAN})
set_property(TEST ${TEST_NAME} APPEND PROPERTY ENVIRONMENT "IREE_VULKAN_DISABLE=1")
endif()
- if(NOT ${IREE_TARGET_BACKEND_LLVM-IR} OR NOT ${IREE_HAL_DRIVER_LLVM})
- set_property(TEST ${TEST_NAME} APPEND PROPERTY ENVIRONMENT "IREE_LLVMJIT_DISABLE=1")
+ if(NOT ${IREE_TARGET_BACKEND_DYLIB-LLVM-AOT} OR NOT ${IREE_HAL_DRIVER_DYLIB})
+ set_property(TEST ${TEST_NAME} APPEND PROPERTY ENVIRONMENT "IREE_LLVMAOT_DISABLE=1")
endif()
endfunction()
diff --git a/build_tools/cmake/test.sh b/build_tools/cmake/test.sh
index 8172f84..b38df1c 100755
--- a/build_tools/cmake/test.sh
+++ b/build_tools/cmake/test.sh
@@ -25,9 +25,9 @@
export CTEST_PARALLEL_LEVEL=${CTEST_PARALLEL_LEVEL:-$(nproc)}
# Respect the user setting, but default to turning off the vulkan tests
-# and turning on the llvmjit ones.
+# and turning on the llvmaot ones.
export IREE_VULKAN_DISABLE=${IREE_VULKAN_DISABLE:-0}
-export IREE_LLVMJIT_DISABLE=${IREE_LLVMJIT_DISABLE:-0}
+export IREE_LLVMAOT_DISABLE=${IREE_LLVMAOT_DISABLE:-0}
# Tests to exclude by label. In addition to any custom labels (which are carried
# over from Bazel tags), every test should be labeled with the directory it is
@@ -54,8 +54,8 @@
if [[ "${IREE_VULKAN_DISABLE?}" == 1 ]]; then
label_exclude_args+=("^driver=vulkan$")
fi
-if [[ "${IREE_LLVMJIT_DISABLE?}" == 1 ]]; then
- label_exclude_args+=("^driver=llvm$")
+if [[ "${IREE_LLVMAOT_DISABLE?}" == 1 ]]; then
+ label_exclude_args+=("^driver=dylib$")
fi
# Join on "|"
diff --git a/colab/edge_detection.ipynb b/colab/edge_detection.ipynb
index 4501f53..3271237 100644
--- a/colab/edge_detection.ipynb
+++ b/colab/edge_detection.ipynb
@@ -269,7 +269,7 @@
"source": [
"#@markdown ### Backend Configuration\n",
"\n",
- "backend_choice = \"iree_vmla (CPU)\" #@param [ \"iree_vmla (CPU)\", \"iree_llvmjit (CPU)\", \"iree_vulkan (GPU/SwiftShader)\" ]\n",
+ "backend_choice = \"iree_vmla (CPU)\" #@param [ \"iree_vmla (CPU)\", \"iree_llvmaot (CPU)\", \"iree_vulkan (GPU/SwiftShader)\" ]\n",
"backend_choice = backend_choice.split(\" \")[0]\n",
"backend = module_utils.BackendInfo(backend_choice)"
]
@@ -433,7 +433,7 @@
"source": [
"#@markdown ### Backend Configuration\n",
"\n",
- "backend_choice = \"iree_vmla (CPU)\" #@param [ \"iree_vmla (CPU)\", \"iree_llvmjit (CPU)\", \"iree_vulkan (GPU/SwiftShader)\" ]\n",
+ "backend_choice = \"iree_vmla (CPU)\" #@param [ \"iree_vmla (CPU)\", \"iree_llvmaot (CPU)\", \"iree_vulkan (GPU/SwiftShader)\" ]\n",
"backend_choice = backend_choice.split(\" \")[0]\n",
"backend = module_utils.BackendInfo(backend_choice)"
]
diff --git a/colab/mnist_tensorflow.ipynb b/colab/mnist_tensorflow.ipynb
index 4a1f1aa..cfa06ad 100644
--- a/colab/mnist_tensorflow.ipynb
+++ b/colab/mnist_tensorflow.ipynb
@@ -333,7 +333,7 @@
"source": [
"#@markdown ### Backend Configuration\n",
"\n",
- "backend_choice = \"iree_vmla (CPU)\" #@param [ \"iree_vmla (CPU)\", \"iree_llvmjit (CPU)\", \"iree_vulkan (GPU/SwiftShader)\" ]\n",
+ "backend_choice = \"iree_vmla (CPU)\" #@param [ \"iree_vmla (CPU)\", \"iree_llvmaot (CPU)\", \"iree_vulkan (GPU/SwiftShader)\" ]\n",
"backend_choice = backend_choice.split(\" \")[0]\n",
"backend = module_utils.BackendInfo(backend_choice)"
],
diff --git a/colab/resnet.ipynb b/colab/resnet.ipynb
index af7e8e6..c3734aa 100644
--- a/colab/resnet.ipynb
+++ b/colab/resnet.ipynb
@@ -137,7 +137,7 @@
"source": [
"#@markdown ### Backend Configuration\n",
"\n",
- "backend_choice = \"iree_vmla (CPU)\" #@param [ \"iree_vmla (CPU)\", \"iree_llvmjit (CPU)\", \"iree_vulkan (GPU/SwiftShader)\" ]\n",
+ "backend_choice = \"iree_vmla (CPU)\" #@param [ \"iree_vmla (CPU)\", \"iree_llvmaot (CPU)\", \"iree_vulkan (GPU/SwiftShader)\" ]\n",
"backend_choice = backend_choice.split(\" \")[0]\n",
"backend = module_utils.BackendInfo(backend_choice)"
],
diff --git a/docs/developing_iree/e2e_benchmarking.md b/docs/developing_iree/e2e_benchmarking.md
index 1a5b54b..7b5e404 100644
--- a/docs/developing_iree/e2e_benchmarking.md
+++ b/docs/developing_iree/e2e_benchmarking.md
@@ -59,7 +59,7 @@
# Example for MatrixOpsStaticModule:
/tmp/iree/modules/MatrixOpsStaticModule
- ├── iree_llvmjit
+ ├── iree_llvmaot
│ ├── compiled.vmfb
│ └── traces
│ ├── basic_matmul
@@ -72,10 +72,10 @@
│ └── flagfile
├── iree_vmla
│ ├── compiled.vmfb
- │ └── traces # ...same as iree_llvmjit/traces above.
+ │ └── traces # ...same as iree_llvmaot/traces above.
├── iree_vulkan
│ ├── compiled.vmfb
- │ └── traces # ...same as iree_llvmjit/traces above.
+ │ └── traces # ...same as iree_llvmaot/traces above.
└── tflite
├── basic_matmul.tflite
├── matmul_broadcast_singleton_dimension.tflite
diff --git a/integrations/tensorflow/bindings/python/pyiree/tf/support/module_utils.py b/integrations/tensorflow/bindings/python/pyiree/tf/support/module_utils.py
index f984ef8..a1ef78c 100644
--- a/integrations/tensorflow/bindings/python/pyiree/tf/support/module_utils.py
+++ b/integrations/tensorflow/bindings/python/pyiree/tf/support/module_utils.py
@@ -875,6 +875,11 @@
"driver": "vulkan",
"compiler_targets": ["vulkan-*"]
},
+ "iree_llvmaot": {
+ "compiled_module_class": IreeCompiledModule,
+ "driver": "dylib",
+ "compiler_targets": ["dylib-llvm-aot"]
+ },
}
def __init__(self, backend_name: str, backend_id: str = None):
@@ -882,13 +887,13 @@
Args:
backend_name: a str specifying which backend to use. Should be one of
- 'tf', 'tflite', 'iree_vmla', 'iree_vulkan'.
+ 'tf', 'tflite', 'iree_vmla', 'iree_vulkan', 'iree_llvmaot'.
backend_id: an optional str specifying what name to use when saving
compiled artifacts. Must satisfy `backend_id.startswith(backend_name)`.
Raises:
KeyError: if backend_name is not one of ['tf', 'tflite', 'iree_vmla',
- 'iree_vulkan'].
+ 'iree_vulkan', 'iree_llvmaot'].
ValueError: if backend_id doesn't start with backend_name.
"""
if backend_name not in self._name_to_info:
diff --git a/integrations/tensorflow/e2e/BUILD b/integrations/tensorflow/e2e/BUILD
index 2f61a33..da6d432 100644
--- a/integrations/tensorflow/e2e/BUILD
+++ b/integrations/tensorflow/e2e/BUILD
@@ -167,7 +167,7 @@
"tf": TF_PASSING,
"tflite": TFLITE_PASSING,
"iree_vmla": VMLA_PASSING,
- "iree_llvmjit": LLVM_PASSING,
+ "iree_llvmaot": LLVM_PASSING,
"iree_vulkan": VULKAN_PASSING,
},
reference_backend = "tf",
@@ -181,7 +181,7 @@
backends_to_srcs = {
"tflite": TFLITE_FAILING,
"iree_vmla": VMLA_FAILING,
- "iree_llvmjit": LLVM_FAILING,
+ "iree_llvmaot": LLVM_FAILING,
"iree_vulkan": VULKAN_FAILING,
},
reference_backend = "tf",
@@ -203,7 +203,7 @@
"tf": ["mobile_bert_squad_test.py"],
"tflite": ["mobile_bert_squad_test.py"],
"iree_vmla": ["mobile_bert_squad_test.py"],
- "iree_llvmjit": ["mobile_bert_squad_test.py"],
+ "iree_llvmaot": ["mobile_bert_squad_test.py"],
"iree_vulkan": ["mobile_bert_squad_test.py"],
},
reference_backend = "tf",
diff --git a/integrations/tensorflow/e2e/README.md b/integrations/tensorflow/e2e/README.md
index ccc2f63..4a7e179 100644
--- a/integrations/tensorflow/e2e/README.md
+++ b/integrations/tensorflow/e2e/README.md
@@ -18,7 +18,7 @@
If you do not have your environment setup to use IREE with Vulkan (see
[this doc](https://google.github.io/iree/get-started/generic-vulkan-env-setup)),
then you can run the manual test targets with
-`--target_backends=tf,iree_vmla` (that is, by omitting
+`--target_backends=tf,iree_vmla,iree_llvmaot` (that is, by omitting
`iree_vulkan` from the list of backends to run the tests on).
The test suites can be run excluding Vulkan by specifying
@@ -234,8 +234,8 @@
to check numerical correctness against TensorFlow. Tests targets that pass are
placed into the `e2e_tests` test suite. Tests that fail on particular backends
are recorded in lists in the `BUILD` files. For example, if
-`experimental_new_test.py` fails on the `iree_vulkan` backend then the following
-lines should be added to the `BUILD` file:
+`experimental_new_test.py` fails on the `iree_llvmaot` and `iree_vulkan`
+backend then the following lines should be added to the `BUILD` file:
```build
LLVM_FAILING = [
diff --git a/integrations/tensorflow/e2e/iree_e2e_test_suite.bzl b/integrations/tensorflow/e2e/iree_e2e_test_suite.bzl
index 661cc30..0be5f30 100644
--- a/integrations/tensorflow/e2e/iree_e2e_test_suite.bzl
+++ b/integrations/tensorflow/e2e/iree_e2e_test_suite.bzl
@@ -19,10 +19,6 @@
def get_driver(backend):
# TODO(#2175): Simplify this after backend names are standardized.
driver = backend.replace("iree_", "") # "iree_<driver>" --> "<driver>"
-
- # TODO(#2673): enable LLVM AOT for these tests. JIT is deprecated.
- if driver == "llvmjit":
- driver = ""
return driver
def set_difference(include, exclude):
diff --git a/iree/compiler/Dialect/HAL/Target/LLVM/AOT/BUILD b/iree/compiler/Dialect/HAL/Target/LLVM/AOT/BUILD
index 51983ae..6db6f9f 100644
--- a/iree/compiler/Dialect/HAL/Target/LLVM/AOT/BUILD
+++ b/iree/compiler/Dialect/HAL/Target/LLVM/AOT/BUILD
@@ -20,10 +20,9 @@
licenses = ["notice"], # Apache 2.0
)
-# TODO(scotttodd): filter on IREE_TARGET_BACKEND_DYLIB-LLVM-AOT when it exists
iree_cmake_extra_content(
content = """
-if(NOT ${IREE_TARGET_BACKEND_LLVM-IR})
+if(NOT ${IREE_TARGET_BACKEND_DYLIB-LLVM-AOT})
return()
endif()
""",
diff --git a/iree/compiler/Dialect/HAL/Target/LLVM/AOT/CMakeLists.txt b/iree/compiler/Dialect/HAL/Target/LLVM/AOT/CMakeLists.txt
index 0a97912..5c12281 100644
--- a/iree/compiler/Dialect/HAL/Target/LLVM/AOT/CMakeLists.txt
+++ b/iree/compiler/Dialect/HAL/Target/LLVM/AOT/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-if(NOT ${IREE_TARGET_BACKEND_LLVM-IR})
+if(NOT ${IREE_TARGET_BACKEND_DYLIB-LLVM-AOT})
return()
endif()
diff --git a/iree/compiler/Dialect/HAL/Target/LLVM/BUILD b/iree/compiler/Dialect/HAL/Target/LLVM/BUILD
index 9040b96..4f29ec2 100644
--- a/iree/compiler/Dialect/HAL/Target/LLVM/BUILD
+++ b/iree/compiler/Dialect/HAL/Target/LLVM/BUILD
@@ -20,10 +20,9 @@
licenses = ["notice"], # Apache 2.0
)
-# TODO(scotttodd): also return if IREE_TARGET_BACKEND_DYLIB-LLVM-AOT is false
iree_cmake_extra_content(
content = """
-if(NOT ${IREE_TARGET_BACKEND_LLVM-IR})
+if(NOT ${IREE_TARGET_BACKEND_LLVM-IR} AND NOT ${IREE_TARGET_BACKEND_DYLIB-LLVM-AOT})
return()
endif()
""",
diff --git a/iree/compiler/Dialect/HAL/Target/LLVM/CMakeLists.txt b/iree/compiler/Dialect/HAL/Target/LLVM/CMakeLists.txt
index 416f32e..a0768ba 100644
--- a/iree/compiler/Dialect/HAL/Target/LLVM/CMakeLists.txt
+++ b/iree/compiler/Dialect/HAL/Target/LLVM/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-if(NOT ${IREE_TARGET_BACKEND_LLVM-IR})
+if(NOT ${IREE_TARGET_BACKEND_LLVM-IR} AND NOT ${IREE_TARGET_BACKEND_DYLIB-LLVM-AOT})
return()
endif()
diff --git a/iree/compiler/Dialect/HAL/Target/LLVM/LLVMBaseTarget.cpp b/iree/compiler/Dialect/HAL/Target/LLVM/LLVMBaseTarget.cpp
index 4861dd3..93484e8 100644
--- a/iree/compiler/Dialect/HAL/Target/LLVM/LLVMBaseTarget.cpp
+++ b/iree/compiler/Dialect/HAL/Target/LLVM/LLVMBaseTarget.cpp
@@ -80,7 +80,7 @@
buildLLVMTransformPassPipeline(passManager);
}
-static FileLineColLoc findFirstFileLoc(Location baseLoc) {
+static llvm::Optional<FileLineColLoc> findFirstFileLoc(Location baseLoc) {
if (auto loc = baseLoc.dyn_cast<FusedLoc>()) {
for (auto &childLoc : loc.getLocations()) {
auto childResult = findFirstFileLoc(childLoc);
@@ -89,15 +89,19 @@
} else if (auto loc = baseLoc.dyn_cast<FileLineColLoc>()) {
return loc;
}
- return FileLineColLoc{};
+ return llvm::None;
}
static std::string guessModuleName(mlir::ModuleOp moduleOp) {
std::string moduleName =
moduleOp.getName().hasValue() ? moduleOp.getName().getValue().str() : "";
if (!moduleName.empty()) return moduleName;
- FileLineColLoc loc = findFirstFileLoc(moduleOp.getLoc());
- return llvm::sys::path::stem(loc.getFilename()).str();
+ auto loc = findFirstFileLoc(moduleOp.getLoc());
+ if (loc.hasValue()) {
+ return llvm::sys::path::stem(loc.getValue().getFilename()).str();
+ } else {
+ return "llvm_module";
+ }
}
LogicalResult LLVMBaseTargetBackend::linkExecutables(mlir::ModuleOp moduleOp) {
diff --git a/iree/compiler/Dialect/HAL/Target/LLVM/LLVMIRPasses.cpp b/iree/compiler/Dialect/HAL/Target/LLVM/LLVMIRPasses.cpp
index 65cd442..2c60f19 100644
--- a/iree/compiler/Dialect/HAL/Target/LLVM/LLVMIRPasses.cpp
+++ b/iree/compiler/Dialect/HAL/Target/LLVM/LLVMIRPasses.cpp
@@ -21,6 +21,7 @@
#include "llvm/IR/Verifier.h"
#include "llvm/Passes/PassBuilder.h"
#include "llvm/Passes/StandardInstrumentations.h"
+#include "llvm/Support/CodeGen.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/Host.h"
#include "llvm/Support/TargetRegistry.h"
@@ -55,7 +56,7 @@
std::unique_ptr<llvm::TargetMachine> machine(target->createTargetMachine(
targetOptions.targetTriple, targetOptions.targetCPU /* cpu e.g k8*/,
targetOptions.targetCPUFeatures /* cpu features e.g avx512fma*/,
- targetOptions.options, {}, {},
+ targetOptions.options, llvm::Reloc::Model::PIC_, {},
passBuilderOptLevelToCodeGenOptLevel(targetOptions.optLevel),
/*JIT=*/false));
return machine;
diff --git a/iree/hal/dylib/dylib_executable.cc b/iree/hal/dylib/dylib_executable.cc
index 92a8ea7..9c93e6e 100644
--- a/iree/hal/dylib/dylib_executable.cc
+++ b/iree/hal/dylib/dylib_executable.cc
@@ -89,6 +89,9 @@
#if IREE_TRACING_FEATURES & IREE_TRACING_FEATURE_INSTRUMENTATION
// Leak the library when tracing, since the profiler may still be reading it.
// TODO(benvanik): move to an atexit handler instead, verify with ASAN/MSAN
+ // TODO(scotttodd): Make this compatible with testing:
+ // two test cases, one for each function in the same executable
+ // first test case passes, second fails to open the file (already open)
executable_library_.release();
#else
executable_library_.reset();
diff --git a/iree/test/e2e/hackability/flow_partitioned.mlir b/iree/test/e2e/hackability/flow_partitioned.mlir
index 19ba210..3b85a0e 100644
--- a/iree/test/e2e/hackability/flow_partitioned.mlir
+++ b/iree/test/e2e/hackability/flow_partitioned.mlir
@@ -1,5 +1,5 @@
// RUN: iree-run-mlir -export-all -iree-hal-target-backends=vmla %s | IreeFileCheck %s
-// RUN: [[ $IREE_LLVMJIT_DISABLE == 1 ]] || (iree-run-mlir -export-all -iree-hal-target-backends=llvm-ir %s | IreeFileCheck %s)
+// RUN: [[ $IREE_LLVMAOT_DISABLE == 1 ]] || (iree-run-mlir -export-all -iree-hal-target-backends=dylib-llvm-aot %s | IreeFileCheck %s)
flow.executable @ex0 {
flow.dispatch.entry @dispatch0 attributes {workload = 4 : index}
diff --git a/iree/test/e2e/llvmir_specific/BUILD b/iree/test/e2e/llvm_specific/BUILD
similarity index 81%
rename from iree/test/e2e/llvmir_specific/BUILD
rename to iree/test/e2e/llvm_specific/BUILD
index f0bf5de..dffd947 100644
--- a/iree/test/e2e/llvmir_specific/BUILD
+++ b/iree/test/e2e/llvm_specific/BUILD
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# Tests for end-to-end IREE support specific to the vulkan-spirv lowering.
+# Tests for end-to-end IREE support specific to the LLVM lowering.
# TODO(ravishankarm): Reorganize these tests.
load("//build_tools/bazel:iree_check_test.bzl", "iree_check_single_backend_test_suite")
@@ -24,25 +24,25 @@
)
iree_check_single_backend_test_suite(
- name = "check_llvm-ir-conv_img2col",
+ name = "check_llvm-aot-conv_img2col",
srcs = [
"conv.mlir",
],
compiler_flags = [
"-iree-codegen-linalg-to-llvm-conv-img2col-conversion=true",
],
- driver = "llvm",
- target_backend = "llvm-ir",
+ driver = "dylib",
+ target_backend = "dylib-llvm-aot",
)
iree_check_single_backend_test_suite(
- name = "check_llvm-ir-exponential_fast",
+ name = "check_llvm-aot-exponential_fast",
srcs = [
"exponential.mlir",
],
compiler_flags = [
"-iree-codegen-linalg-to-llvm-fast-exp=true",
],
- driver = "llvm",
- target_backend = "llvm-ir",
+ driver = "dylib",
+ target_backend = "dylib-llvm-aot",
)
diff --git a/iree/test/e2e/llvmir_specific/CMakeLists.txt b/iree/test/e2e/llvm_specific/CMakeLists.txt
similarity index 88%
rename from iree/test/e2e/llvmir_specific/CMakeLists.txt
rename to iree/test/e2e/llvm_specific/CMakeLists.txt
index 496841a..ff366f7 100644
--- a/iree/test/e2e/llvmir_specific/CMakeLists.txt
+++ b/iree/test/e2e/llvm_specific/CMakeLists.txt
@@ -16,26 +16,26 @@
iree_check_single_backend_test_suite(
NAME
- check_llvm-ir-conv_img2col
+ check_llvm-aot-conv_img2col
SRCS
"conv.mlir"
TARGET_BACKEND
- llvm-ir
+ dylib-llvm-aot
DRIVER
- llvm
+ dylib
COMPILER_FLAGS
"-iree-codegen-linalg-to-llvm-conv-img2col-conversion=true"
)
iree_check_single_backend_test_suite(
NAME
- check_llvm-ir-exponential_fast
+ check_llvm-aot-exponential_fast
SRCS
"exponential.mlir"
TARGET_BACKEND
- llvm-ir
+ dylib-llvm-aot
DRIVER
- llvm
+ dylib
COMPILER_FLAGS
"-iree-codegen-linalg-to-llvm-fast-exp=true"
)
diff --git a/iree/test/e2e/llvmir_specific/conv.mlir b/iree/test/e2e/llvm_specific/conv.mlir
similarity index 100%
rename from iree/test/e2e/llvmir_specific/conv.mlir
rename to iree/test/e2e/llvm_specific/conv.mlir
diff --git a/iree/test/e2e/llvmir_specific/exponential.mlir b/iree/test/e2e/llvm_specific/exponential.mlir
similarity index 100%
rename from iree/test/e2e/llvmir_specific/exponential.mlir
rename to iree/test/e2e/llvm_specific/exponential.mlir
diff --git a/iree/test/e2e/models/edge_detection.mlir b/iree/test/e2e/models/edge_detection.mlir
index c290e84..c0cfcbe 100644
--- a/iree/test/e2e/models/edge_detection.mlir
+++ b/iree/test/e2e/models/edge_detection.mlir
@@ -1,5 +1,5 @@
// RUN: iree-run-mlir -export-all -iree-hal-target-backends=vmla %s -function-input="1x128x128x1xf32" | IreeFileCheck %s
-// RUN: [[ $IREE_LLVMJIT_DISABLE == 1 ]] || (iree-run-mlir -export-all -iree-hal-target-backends=llvm-ir %s -function-input="1x128x128x1xf32" | IreeFileCheck %s)
+// RUN: [[ $IREE_LLVMAOT_DISABLE == 1 ]] || (iree-run-mlir -export-all -iree-hal-target-backends=dylib-llvm-aot %s -function-input="1x128x128x1xf32" | IreeFileCheck %s)
// RUN: [[ $IREE_VULKAN_DISABLE == 1 ]] || (iree-run-mlir -export-all -iree-hal-target-backends=vulkan-spirv %s -function-input="1x128x128x1xf32" | IreeFileCheck %s)
// RUN: [[ $IREE_LLVMJIT_DISABLE == 1 ]] || (iree-run-mlir -export-all -iree-hal-target-backends=llvm-ir -iree-enable-linalg-on-tensors %s -function-input="1x128x128x1xf32" | IreeFileCheck %s)
// RUN: [[ $IREE_VULKAN_DISABLE == 1 ]] || (iree-run-mlir -export-all -iree-hal-target-backends=vulkan-spirv -iree-enable-linalg-on-tensors %s -function-input="1x128x128x1xf32" | IreeFileCheck %s)
diff --git a/iree/test/e2e/models/fragment_000.mlir b/iree/test/e2e/models/fragment_000.mlir
index 8328f86..2786c6b 100644
--- a/iree/test/e2e/models/fragment_000.mlir
+++ b/iree/test/e2e/models/fragment_000.mlir
@@ -1,5 +1,5 @@
// RUN: iree-run-mlir -export-all -iree-hal-target-backends=vmla %s -function-input="f32=0" -function-input="5x1xf32=[1][-2][-3][4][-5]" -function-input="f32=1" -function-input="5x5xf32=[3.46499 -7.64389 -5.72249 5.98053 17.6892][2.9707 -6.20734 -4.25962 4.76055 13.8784][2.47641 -4.77079 -2.79675 3.54056 10.0675][1.98212 -3.33424 -1.33388 2.32058 6.25666][1.48783 -1.8977 0.12899 1.1006 2.4458]" -function-input="5xf32=0 0 0 0 0" | IreeFileCheck %s --implicit-check-not="[" --implicit-check-not="]"
-// RUN: [[ $IREE_LLVMJIT_DISABLE == 1 ]] || (iree-run-mlir -export-all -iree-hal-target-backends=llvm-ir %s -function-input="f32=0" -function-input="5x1xf32=[1][-2][-3][4][-5]" -function-input="f32=1" -function-input="5x5xf32=[3.46499 -7.64389 -5.72249 5.98053 17.6892][2.9707 -6.20734 -4.25962 4.76055 13.8784][2.47641 -4.77079 -2.79675 3.54056 10.0675][1.98212 -3.33424 -1.33388 2.32058 6.25666][1.48783 -1.8977 0.12899 1.1006 2.4458]" -function-input="5xf32=0 0 0 0 0" | IreeFileCheck %s --implicit-check-not="[" --implicit-check-not="]")
+// RUN: [[ $IREE_LLVMAOT_DISABLE == 1 ]] || (iree-run-mlir -export-all -iree-hal-target-backends=dylib-llvm-aot %s -function-input="f32=0" -function-input="5x1xf32=[1][-2][-3][4][-5]" -function-input="f32=1" -function-input="5x5xf32=[3.46499 -7.64389 -5.72249 5.98053 17.6892][2.9707 -6.20734 -4.25962 4.76055 13.8784][2.47641 -4.77079 -2.79675 3.54056 10.0675][1.98212 -3.33424 -1.33388 2.32058 6.25666][1.48783 -1.8977 0.12899 1.1006 2.4458]" -function-input="5xf32=0 0 0 0 0" | IreeFileCheck %s --implicit-check-not="[" --implicit-check-not="]")
// RUN: [[ $IREE_VULKAN_DISABLE == 1 ]] || (iree-run-mlir -export-all -iree-hal-target-backends=vulkan-spirv %s -function-input="f32=0" -function-input="5x1xf32=[1][-2][-3][4][-5]" -function-input="f32=1" -function-input="5x5xf32=[3.46499 -7.64389 -5.72249 5.98053 17.6892][2.9707 -6.20734 -4.25962 4.76055 13.8784][2.47641 -4.77079 -2.79675 3.54056 10.0675][1.98212 -3.33424 -1.33388 2.32058 6.25666][1.48783 -1.8977 0.12899 1.1006 2.4458]" -function-input="5xf32=0 0 0 0 0" | IreeFileCheck %s --implicit-check-not="[" --implicit-check-not="]")
// RUN: [[ $IREE_LLVMJIT_DISABLE == 1 ]] || (iree-run-mlir -export-all -iree-hal-target-backends=llvm-ir -iree-enable-linalg-on-tensors %s -function-input="f32=0" -function-input="5x1xf32=[1][-2][-3][4][-5]" -function-input="f32=1" -function-input="5x5xf32=[3.46499 -7.64389 -5.72249 5.98053 17.6892][2.9707 -6.20734 -4.25962 4.76055 13.8784][2.47641 -4.77079 -2.79675 3.54056 10.0675][1.98212 -3.33424 -1.33388 2.32058 6.25666][1.48783 -1.8977 0.12899 1.1006 2.4458]" -function-input="5xf32=0 0 0 0 0" | IreeFileCheck %s --implicit-check-not="[" --implicit-check-not="]")
// RUN: [[ $IREE_VULKAN_DISABLE == 1 ]] || (iree-run-mlir -export-all -iree-hal-target-backends=vulkan-spirv -iree-enable-linalg-on-tensors %s -function-input="f32=0" -function-input="5x1xf32=[1][-2][-3][4][-5]" -function-input="f32=1" -function-input="5x5xf32=[3.46499 -7.64389 -5.72249 5.98053 17.6892][2.9707 -6.20734 -4.25962 4.76055 13.8784][2.47641 -4.77079 -2.79675 3.54056 10.0675][1.98212 -3.33424 -1.33388 2.32058 6.25666][1.48783 -1.8977 0.12899 1.1006 2.4458]" -function-input="5xf32=0 0 0 0 0" | IreeFileCheck %s --implicit-check-not="[" --implicit-check-not="]")
diff --git a/iree/test/e2e/models/fullyconnected.mlir b/iree/test/e2e/models/fullyconnected.mlir
index ab9c466..a7ccbfd 100644
--- a/iree/test/e2e/models/fullyconnected.mlir
+++ b/iree/test/e2e/models/fullyconnected.mlir
@@ -1,5 +1,5 @@
// RUN: iree-run-mlir -export-all %s -iree-hal-target-backends=vmla -function-input="1x5xf32=1,-2,-3,4,-5" -function-input="1x5x3x1xf32=15,14,13,12,11,10,9,8,7,6,5,4,3,2,1" | IreeFileCheck %s
-// RUN: [[ $IREE_LLVMJIT_DISABLE == 1 ]] || (iree-run-mlir -export-all %s -iree-hal-target-backends=llvm-ir -function-input="1x5xf32=1,-2,-3,4,-5" -function-input="1x5x3x1xf32=15,14,13,12,11,10,9,8,7,6,5,4,3,2,1" -iree-enable-consumer-only-fusion | IreeFileCheck %s)
+// RUN: [[ $IREE_LLVMAOT_DISABLE == 1 ]] || (iree-run-mlir -export-all %s -iree-hal-target-backends=dylib-llvm-aot -function-input="1x5xf32=1,-2,-3,4,-5" -function-input="1x5x3x1xf32=15,14,13,12,11,10,9,8,7,6,5,4,3,2,1" | IreeFileCheck %s)
// RUN: [[ $IREE_VULKAN_DISABLE == 1 ]] || (iree-run-mlir -export-all %s -iree-hal-target-backends=vulkan-spirv -function-input="1x5xf32=1,-2,-3,4,-5" -function-input="1x5x3x1xf32=15,14,13,12,11,10,9,8,7,6,5,4,3,2,1" | IreeFileCheck %s)
// RUN: [[ $IREE_LLVMJIT_DISABLE == 1 ]] || (iree-run-mlir -export-all %s -iree-hal-target-backends=llvm-ir -function-input="1x5xf32=1,-2,-3,4,-5" -function-input="1x5x3x1xf32=15,14,13,12,11,10,9,8,7,6,5,4,3,2,1" -iree-enable-linalg-on-tensors | IreeFileCheck %s)
// RUN: [[ $IREE_VULKAN_DISABLE == 1 ]] || (iree-run-mlir -export-all %s -iree-hal-target-backends=vulkan-spirv -function-input="1x5xf32=1,-2,-3,4,-5" -function-input="1x5x3x1xf32=15,14,13,12,11,10,9,8,7,6,5,4,3,2,1" -iree-enable-linalg-on-tensors | IreeFileCheck %s)
diff --git a/iree/test/e2e/models/mnist_fake_weights.mlir b/iree/test/e2e/models/mnist_fake_weights.mlir
index 380899d..29e8bf2 100644
--- a/iree/test/e2e/models/mnist_fake_weights.mlir
+++ b/iree/test/e2e/models/mnist_fake_weights.mlir
@@ -1,7 +1,7 @@
// MNIST model with placeholder weights, for testing.
// RUN: iree-run-mlir -export-all -iree-hal-target-backends=vmla %s -function-input="1x28x28x1xf32" | IreeFileCheck %s
-// RUN: [[ $IREE_LLVMJIT_DISABLE == 1 ]] || (iree-run-mlir -export-all -iree-hal-target-backends=llvm-ir %s -function-input="1x28x28x1xf32" | IreeFileCheck %s)
+// RUN: [[ $IREE_LLVMAOT_DISABLE == 1 ]] || (iree-run-mlir -export-all -iree-hal-target-backends=dylib-llvm-aot %s -function-input="1x28x28x1xf32" | IreeFileCheck %s)
// RUN: [[ $IREE_VULKAN_DISABLE == 1 ]] || (iree-run-mlir -export-all -iree-hal-target-backends=vulkan-spirv %s -function-input="1x28x28x1xf32" | IreeFileCheck %s)
// RUN: [[ $IREE_LLVMJIT_DISABLE == 1 ]] || (iree-run-mlir -export-all -iree-hal-target-backends=llvm-ir -iree-enable-linalg-on-tensors %s -function-input="1x28x28x1xf32" | IreeFileCheck %s)
// RUN: [[ $IREE_VULKAN_DISABLE == 1 ]] || (iree-run-mlir -export-all -iree-hal-target-backends=vulkan-spirv -iree-enable-linalg-on-tensors %s -function-input="1x28x28x1xf32" | IreeFileCheck %s)
diff --git a/iree/test/e2e/models/resnet_fake_weights.mlir b/iree/test/e2e/models/resnet_fake_weights.mlir
index 73cf09e..d284e1f 100644
--- a/iree/test/e2e/models/resnet_fake_weights.mlir
+++ b/iree/test/e2e/models/resnet_fake_weights.mlir
@@ -1,7 +1,7 @@
// ResNet model with placeholder weights, for testing.
// RUN: iree-run-mlir -export-all -iree-hal-target-backends=vmla %s -function-input="1x224x224x3xf32" | IreeFileCheck %s
-// RUN: [[ $IREE_LLVMJIT_DISABLE == 1 ]] || (iree-run-mlir -export-all -iree-hal-target-backends=llvm-ir %s -function-input="1x224x224x3xf32" | IreeFileCheck %s)
+// RUN: [[ $IREE_LLVMAOT_DISABLE == 1 ]] || (iree-run-mlir -export-all -iree-hal-target-backends=dylib-llvm-aot %s -function-input="1x224x224x3xf32" | IreeFileCheck %s)
// RUN: [[ $IREE_VULKAN_DISABLE == 1 ]] || (iree-run-mlir -export-all -iree-hal-target-backends=vulkan-spirv %s -function-input="1x224x224x3xf32" | IreeFileCheck %s)
module {
diff --git a/iree/test/e2e/models/unidirectional_lstm.mlir b/iree/test/e2e/models/unidirectional_lstm.mlir
index 302f79e..0dc9929 100644
--- a/iree/test/e2e/models/unidirectional_lstm.mlir
+++ b/iree/test/e2e/models/unidirectional_lstm.mlir
@@ -1,7 +1,7 @@
// An example LSTM exported from a python reference model with dummy weights.
// RUN: iree-run-mlir %s -iree-hal-target-backends=vmla -function-input="1x5xf32=[0 1 0 3 4]" -function-input="1x5x2x2xf32=[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20]" | IreeFileCheck %s --implicit-check-not="[" --implicit-check-not="]"
-// RUN: [[ $IREE_LLVMJIT_DISABLE == 1 ]] || (iree-run-mlir %s -iree-hal-target-backends=llvm-ir -function-input="1x5xf32=[0 1 0 3 4]" -function-input="1x5x2x2xf32=[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20]" | IreeFileCheck %s --implicit-check-not="[" --implicit-check-not="]")
+// RUN: [[ $IREE_LLVMAOT_DISABLE == 1 ]] || (iree-run-mlir %s -iree-hal-target-backends=dylib-llvm-aot -function-input="1x5xf32=[0 1 0 3 4]" -function-input="1x5x2x2xf32=[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20]" | IreeFileCheck %s --implicit-check-not="[" --implicit-check-not="]")
// RUN: [[ $IREE_VULKAN_DISABLE == 1 ]] || (iree-run-mlir %s -iree-hal-target-backends=vulkan-spirv -function-input="1x5xf32=[0 1 0 3 4]" -function-input="1x5x2x2xf32=[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20]" | IreeFileCheck %s --implicit-check-not="[" --implicit-check-not="]")
// RUN: [[ $IREE_LLVMJIT_DISABLE == 1 ]] || (iree-run-mlir %s -iree-hal-target-backends=llvm-ir -function-input="1x5xf32=[0 1 0 3 4]" -function-input="1x5x2x2xf32=[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20]" -iree-enable-linalg-on-tensors | IreeFileCheck %s --implicit-check-not="[" --implicit-check-not="]")
// RUN: [[ $IREE_VULKAN_DISABLE == 1 ]] || (iree-run-mlir %s -iree-hal-target-backends=vulkan-spirv -function-input="1x5xf32=[0 1 0 3 4]" -function-input="1x5x2x2xf32=[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20]" -iree-enable-linalg-on-tensors | IreeFileCheck %s --implicit-check-not="[" --implicit-check-not="]")
@@ -263,4 +263,3 @@
// CHECK-SAME: ][
// CHECK-SAME: [0 0 0 0 0 0 0 0 0 0]
// CHECK-SAME: ]
-
diff --git a/iree/test/e2e/regression/dynamic_abs.mlir b/iree/test/e2e/regression/dynamic_abs.mlir
index c302642..67b3f4c 100644
--- a/iree/test/e2e/regression/dynamic_abs.mlir
+++ b/iree/test/e2e/regression/dynamic_abs.mlir
@@ -1,5 +1,5 @@
// RUN: iree-run-mlir -export-all -iree-hal-target-backends=vmla %s | IreeFileCheck %s
-// RUN: [[ $IREE_LLVMJIT_DISABLE == 1 ]] || (iree-run-mlir -export-all -iree-hal-target-backends=llvm-ir %s | IreeFileCheck %s)
+// RUN: [[ $IREE_LLVMAOT_DISABLE == 1 ]] || (iree-run-mlir -export-all -iree-hal-target-backends=dylib-llvm-aot %s | IreeFileCheck %s)
// CHECK-LABEL: EXEC @dynamic_tensor
func @dynamic_tensor() -> tensor<?x?xf32> attributes { iree.module.export } {
diff --git a/iree/test/e2e/regression/dynamic_add.mlir b/iree/test/e2e/regression/dynamic_add.mlir
index 9707df7..4ba6007 100644
--- a/iree/test/e2e/regression/dynamic_add.mlir
+++ b/iree/test/e2e/regression/dynamic_add.mlir
@@ -1,6 +1,6 @@
// RUN: iree-run-mlir -export-all -iree-hal-target-backends=vmla -function-input="2x4xf32=[[1.0, 2.0, 3.0, 4.0], [-1.0, -2.0, -3.0, -4.0]]" -function-input="2x4xf32=[[5.0, 6.0, 7.0, 8.0], [-5.0, -6.0, -7.0, -8.0]]" %s | IreeFileCheck %s
// RUN: [[ $IREE_VULKAN_DISABLE == 1 ]] || (iree-run-mlir -export-all -iree-hal-target-backends=vulkan-spirv -function-input="2x4xf32=[[1.0, 2.0, 3.0, 4.0], [-1.0, -2.0, -3.0, -4.0]]" -function-input="2x4xf32=[[5.0, 6.0, 7.0, 8.0], [-5.0, -6.0, -7.0, -8.0]]" %s | IreeFileCheck %s)
-// RUN: [[ $IREE_LLVMJIT_DISABLE == 1 ]] || (iree-run-mlir -export-all -iree-hal-target-backends=llvm-ir -function-input="2x4xf32=[[1.0, 2.0, 3.0, 4.0], [-1.0, -2.0, -3.0, -4.0]]" -function-input="2x4xf32=[[5.0, 6.0, 7.0, 8.0], [-5.0, -6.0, -7.0, -8.0]]" %s | IreeFileCheck %s)
+// RUN: [[ $IREE_LLVMAOT_DISABLE == 1 ]] || (iree-run-mlir -export-all -iree-hal-target-backends=dylib-llvm-aot -function-input="2x4xf32=[[1.0, 2.0, 3.0, 4.0], [-1.0, -2.0, -3.0, -4.0]]" -function-input="2x4xf32=[[5.0, 6.0, 7.0, 8.0], [-5.0, -6.0, -7.0, -8.0]]" %s | IreeFileCheck %s)
// CHECK: EXEC @main
// CHECK: 2x4xf32=[6 8 10 12][-6 -8 -10 -12]
diff --git a/iree/test/e2e/regression/dynamic_torch_index_select_high_rank.mlir b/iree/test/e2e/regression/dynamic_torch_index_select_high_rank.mlir
index fc22cf4..8a02faa 100644
--- a/iree/test/e2e/regression/dynamic_torch_index_select_high_rank.mlir
+++ b/iree/test/e2e/regression/dynamic_torch_index_select_high_rank.mlir
@@ -1,4 +1,4 @@
-// RUN: [[ $IREE_LLVMJIT_DISABLE == 1 ]] || (iree-run-mlir %s -iree-hal-target-backends=llvm-ir -function-input="2x2xi32=[6, 7] [8, 9]" -function-input="2x2x2x2xi32=[[[0, 1] [1, 0]] [[0, 0] [1, 1]]] [[[1, 1] [0, 0]] [[0, 1] [1, 0]]]" | IreeFileCheck %s)
+// RUN: [[ $IREE_LLVMAOT_DISABLE == 1 ]] || (iree-run-mlir %s -iree-hal-target-backends=dylib-llvm-aot -function-input="2x2xi32=[6, 7] [8, 9]" -function-input="2x2x2x2xi32=[[[0, 1] [1, 0]] [[0, 0] [1, 1]]] [[[1, 1] [0, 0]] [[0, 1] [1, 0]]]" | IreeFileCheck %s)
// CHECK-LABEL: EXEC @torch_index_select1
func @torch_index_select1(%arg0: tensor<?x?xi32>, %arg1: tensor<?x?x?x?xi32>) -> tensor<?x?x?x?xi32> attributes {iree.module.export} {
@@ -55,4 +55,3 @@
// CHECK-SAME: ]
// CHECK-SAME: ]
// CHECK-SAME: ]
-
diff --git a/iree/test/e2e/regression/dynamic_torch_index_select_negative.mlir b/iree/test/e2e/regression/dynamic_torch_index_select_negative.mlir
index e474bfb..c4e846f 100644
--- a/iree/test/e2e/regression/dynamic_torch_index_select_negative.mlir
+++ b/iree/test/e2e/regression/dynamic_torch_index_select_negative.mlir
@@ -1,4 +1,4 @@
-// RUN: [[ $IREE_LLVMJIT_DISABLE == 1 ]] || (iree-run-mlir %s -iree-hal-target-backends=llvm-ir -function-input="2x2x2xi32=[[100, 101] [110, 111]] [[200, 201] [210, 211]]" -function-input="2x2x2xi32=[[0, 1] [1, 0]] [[0, 0] [1, 1]]" | IreeFileCheck %s)
+// RUN: [[ $IREE_LLVMAOT_DISABLE == 1 ]] || (iree-run-mlir %s -iree-hal-target-backends=dylib-llvm-aot -function-input="2x2x2xi32=[[100, 101] [110, 111]] [[200, 201] [210, 211]]" -function-input="2x2x2xi32=[[0, 1] [1, 0]] [[0, 0] [1, 1]]" | IreeFileCheck %s)
// CHECK-LABEL: EXEC @torch_index_select1
func @torch_index_select1(%arg0: tensor<?x?x?xi32>, %arg1: tensor<?x?x?xi32>) -> tensor<?x?x?xi32> attributes {iree.module.export} {
@@ -11,4 +11,3 @@
// CHECK-SAME: ][
// CHECK-SAME: [200 200][211 211]
// CHECK-SAME: ]
-
diff --git a/iree/test/e2e/regression/dynamic_torch_index_select_scalar.mlir b/iree/test/e2e/regression/dynamic_torch_index_select_scalar.mlir
index b538aa6..4c22cc3 100644
--- a/iree/test/e2e/regression/dynamic_torch_index_select_scalar.mlir
+++ b/iree/test/e2e/regression/dynamic_torch_index_select_scalar.mlir
@@ -1,5 +1,5 @@
// RUN: iree-run-mlir -export-all %s -iree-hal-target-backends=vmla -function-input="5x1x5xi32=[[1,2,3,4,5]] [[6,7,8,9,10]] [[11,12,13,14,15]] [[16,17,18,19,20]] [[21,22,23,24,25]]" -function-input="i32=0" | IreeFileCheck %s
-// RUN: [[ $IREE_LLVMJIT_DISABLE == 1 ]] || (iree-run-mlir %s -iree-hal-target-backends=llvm-ir -function-input="5x1x5xi32=[[1,2,3,4,5]] [[6,7,8,9,10]] [[11,12,13,14,15]] [[16,17,18,19,20]] [[21,22,23,24,25]]" -function-input="i32=0" | IreeFileCheck %s)
+// RUN: [[ $IREE_LLVMAOT_DISABLE == 1 ]] || (iree-run-mlir %s -iree-hal-target-backends=dylib-llvm-aot -function-input="5x1x5xi32=[[1,2,3,4,5]] [[6,7,8,9,10]] [[11,12,13,14,15]] [[16,17,18,19,20]] [[21,22,23,24,25]]" -function-input="i32=0" | IreeFileCheck %s)
// CHECK-LABEL: EXEC @torch_index_select1
func @torch_index_select1(%arg0: tensor<?x?x?xi32>, %arg1: tensor<i32>) -> tensor<?x?xi32> attributes {iree.module.export} {
diff --git a/iree/test/e2e/regression/dynamic_torch_index_select_vector.mlir b/iree/test/e2e/regression/dynamic_torch_index_select_vector.mlir
index d55a610..ba2c937 100644
--- a/iree/test/e2e/regression/dynamic_torch_index_select_vector.mlir
+++ b/iree/test/e2e/regression/dynamic_torch_index_select_vector.mlir
@@ -1,5 +1,5 @@
// RUN: iree-run-mlir -export-all %s -iree-hal-target-backends=vmla -function-input="3x2x2xi32=[[1, 2] [3, 4]] [[5, 6] [7, 8]] [[9, 10] [11, 12]]" -function-input="2xi32=[0, 1]" | IreeFileCheck %s
-// RUN: [[ $IREE_LLVMJIT_DISABLE == 1 ]] || (iree-run-mlir %s -iree-hal-target-backends=llvm-ir -function-input="3x2x2xi32=[[1, 2] [3, 4]] [[5, 6] [7, 8]] [[9, 10] [11, 12]]" -function-input="2xi32=[0, 1]" | IreeFileCheck %s)
+// RUN: [[ $IREE_LLVMAOT_DISABLE == 1 ]] || (iree-run-mlir %s -iree-hal-target-backends=dylib-llvm-aot -function-input="3x2x2xi32=[[1, 2] [3, 4]] [[5, 6] [7, 8]] [[9, 10] [11, 12]]" -function-input="2xi32=[0, 1]" | IreeFileCheck %s)
// CHECK-LABEL: EXEC @torch_index_select1
func @torch_index_select1(%arg0: tensor<?x?x?xi32>, %arg1: tensor<?xi32>) -> tensor<?x?x?xi32> attributes {iree.module.export} {
@@ -26,4 +26,3 @@
// CHECK-SAME: ][
// CHECK-SAME: [5 6][7 8]
// CHECK-SAME: ]
-
diff --git a/iree/test/e2e/regression/scalar.mlir b/iree/test/e2e/regression/scalar.mlir
index 920aa46..bb7829b 100644
--- a/iree/test/e2e/regression/scalar.mlir
+++ b/iree/test/e2e/regression/scalar.mlir
@@ -1,5 +1,5 @@
// RUN: iree-run-mlir -export-all -iree-hal-target-backends=vmla %s | IreeFileCheck %s
-// RUN: [[ $IREE_LLVMJIT_DISABLE == 1 ]] || (iree-run-mlir -export-all -iree-hal-target-backends=llvm-ir %s | IreeFileCheck %s)
+// RUN: [[ $IREE_LLVMAOT_DISABLE == 1 ]] || (iree-run-mlir -export-all -iree-hal-target-backends=dylib-llvm-aot %s | IreeFileCheck %s)
// RUN: [[ $IREE_VULKAN_DISABLE == 1 ]] || (iree-run-mlir -export-all -iree-hal-target-backends=vulkan-spirv %s | IreeFileCheck %s)
// CHECK-LABEL: EXEC @scalar
@@ -8,5 +8,3 @@
return %result : i32
}
// CHECK: i32=42
-
-
diff --git a/iree/test/e2e/regression/unused_args.mlir b/iree/test/e2e/regression/unused_args.mlir
index 48662f4..55a0c08 100644
--- a/iree/test/e2e/regression/unused_args.mlir
+++ b/iree/test/e2e/regression/unused_args.mlir
@@ -1,5 +1,5 @@
// RUN: iree-run-mlir -export-all -iree-hal-target-backends=vmla -function-input=4xf32=0,0,0,0 -function-input=4xf32=1,1,1,1 %s | IreeFileCheck %s
-// RUN: [[ $IREE_LLVMJIT_DISABLE == 1 ]] || (iree-run-mlir -export-all -iree-hal-target-backends=llvm-ir -function-input=4xf32=0,0,0,0 -function-input=4xf32=1,1,1,1 %s | IreeFileCheck %s)
+// RUN: [[ $IREE_LLVMAOT_DISABLE == 1 ]] || (iree-run-mlir -export-all -iree-hal-target-backends=dylib-llvm-aot -function-input=4xf32=0,0,0,0 -function-input=4xf32=1,1,1,1 %s | IreeFileCheck %s)
// RUN: [[ $IREE_VULKAN_DISABLE == 1 ]] || (iree-run-mlir -export-all -iree-hal-target-backends=vulkan-spirv -function-input=4xf32=0,0,0,0 -function-input=4xf32=1,1,1,1 %s | IreeFileCheck %s)
// CHECK-LABEL: EXEC @arg0_unused
diff --git a/iree/test/e2e/structural/BUILD b/iree/test/e2e/structural/BUILD
index aec86b8..1dec4be 100644
--- a/iree/test/e2e/structural/BUILD
+++ b/iree/test/e2e/structural/BUILD
@@ -20,7 +20,7 @@
licenses = ["notice"], # Apache 2.0
)
-# TODO(#2395): Enable all the tests for both LLVM-ir and SPIR-V.
+# TODO(#2395): Enable all the tests for both LLVM and SPIR-V.
iree_check_single_backend_test_suite(
name = "check_vmla_vmla",
srcs = glob(["*.mlir"]),
@@ -38,22 +38,20 @@
target_backend = "vulkan-spirv",
)
-# TODO(ataei): Enable dylib-llvm-aot tests.
-# See: https://github.com/google/iree/issues/2645
iree_check_single_backend_test_suite(
- name = "check_llvm-ir_llvm",
+ name = "check_dylib-llvm-aot_dylib",
srcs = [
"matmul_add.mlir",
"slice_add.mlir",
],
- driver = "llvm",
- target_backend = "llvm-ir",
+ driver = "dylib",
+ target_backend = "dylib-llvm-aot",
)
test_suite(
name = "check",
tests = [
- ":check_llvm-ir_llvm",
+ ":check_dylib-llvm-aot_dylib",
":check_vmla_vmla",
":check_vulkan-spirv_vulkan",
],
diff --git a/iree/test/e2e/structural/CMakeLists.txt b/iree/test/e2e/structural/CMakeLists.txt
index 92023ec..a0bf677 100644
--- a/iree/test/e2e/structural/CMakeLists.txt
+++ b/iree/test/e2e/structural/CMakeLists.txt
@@ -40,12 +40,12 @@
iree_check_single_backend_test_suite(
NAME
- check_llvm-ir_llvm
+ check_dylib-llvm-aot_dylib
SRCS
"matmul_add.mlir"
"slice_add.mlir"
TARGET_BACKEND
- llvm-ir
+ dylib-llvm-aot
DRIVER
- llvm
+ dylib
)
diff --git a/iree/test/e2e/xla_ops/BUILD b/iree/test/e2e/xla_ops/BUILD
index 95e6802..30ea6e7 100644
--- a/iree/test/e2e/xla_ops/BUILD
+++ b/iree/test/e2e/xla_ops/BUILD
@@ -130,10 +130,8 @@
target_backend = "vulkan-spirv",
)
-# TODO(ataei): Enable dylib-llvm-aot tests.
-# See: https://github.com/google/iree/issues/2645
iree_check_single_backend_test_suite(
- name = "check_llvm-ir_llvm",
+ name = "check_dylib-llvm-aot_dylib",
srcs = [
"abs.mlir",
"add.mlir",
@@ -178,14 +176,14 @@
"transpose.mlir",
"while.mlir",
],
- driver = "llvm",
- target_backend = "llvm-ir",
+ driver = "dylib",
+ target_backend = "dylib-llvm-aot",
)
test_suite(
name = "check",
tests = [
- ":check_llvm-ir_llvm",
+ ":check_dylib-llvm-aot_dylib",
":check_vmla_vmla",
":check_vulkan-spirv_vulkan",
],
diff --git a/iree/test/e2e/xla_ops/CMakeLists.txt b/iree/test/e2e/xla_ops/CMakeLists.txt
index dd49ad1..3ecb68b 100644
--- a/iree/test/e2e/xla_ops/CMakeLists.txt
+++ b/iree/test/e2e/xla_ops/CMakeLists.txt
@@ -122,7 +122,7 @@
iree_check_single_backend_test_suite(
NAME
- check_llvm-ir_llvm
+ check_dylib-llvm-aot_dylib
SRCS
"abs.mlir"
"add.mlir"
@@ -167,7 +167,7 @@
"transpose.mlir"
"while.mlir"
TARGET_BACKEND
- llvm-ir
+ dylib-llvm-aot
DRIVER
- llvm
+ dylib
)
diff --git a/iree/tools/CMakeLists.txt b/iree/tools/CMakeLists.txt
index 0f63c8c..f4a8e02 100644
--- a/iree/tools/CMakeLists.txt
+++ b/iree/tools/CMakeLists.txt
@@ -21,10 +21,11 @@
# Enable compiler targets based on options.
set(IREE_COMPILER_TARGETS "")
set(IREE_COMPILER_TARGET_COPTS "")
-# TODO(#2645): Move LLVMAOT target under DYLIB-LLVM-AOT flag
-if(${IREE_TARGET_BACKEND_LLVM-IR})
+if(${IREE_TARGET_BACKEND_DYLIB-LLVM-AOT})
list(APPEND IREE_COMPILER_TARGETS iree::compiler::Dialect::HAL::Target::LLVM::AOT::LLVMAOT)
list(APPEND IREE_COMPILER_TARGET_COPTS "-DIREE_HAVE_LLVMAOT_TARGET")
+endif()
+if(${IREE_TARGET_BACKEND_LLVM-IR})
list(APPEND IREE_COMPILER_TARGETS iree::compiler::Dialect::HAL::Target::LLVM::IR::LLVMIR)
list(APPEND IREE_COMPILER_TARGET_COPTS "-DIREE_HAVE_LLVMIR_TARGET")
endif()
diff --git a/iree/tools/test/simple.mlir b/iree/tools/test/simple.mlir
index 123eed1..e81c719 100644
--- a/iree/tools/test/simple.mlir
+++ b/iree/tools/test/simple.mlir
@@ -1,17 +1,17 @@
// iree-run-module
// RUN: (iree-translate --iree-hal-target-backends=vmla -iree-mlir-to-vm-bytecode-module %s | iree-run-module --driver=vmla --entry_function=abs --function_inputs="i32=-2") | IreeFileCheck %s
// RUN: [[ $IREE_VULKAN_DISABLE == 1 ]] || ((iree-translate --iree-hal-target-backends=vulkan-spirv -iree-mlir-to-vm-bytecode-module %s | iree-run-module --driver=vulkan --entry_function=abs --function_inputs="i32=-2") | IreeFileCheck %s)
-// RUN: [[ $IREE_LLVMJIT_DISABLE == 1 ]] || ((iree-translate --iree-hal-target-backends=llvm-ir -iree-mlir-to-vm-bytecode-module %s | iree-run-module --driver=llvm --entry_function=abs --function_inputs="i32=-2") | IreeFileCheck %s)
+// RUN: [[ $IREE_LLVMAOT_DISABLE == 1 ]] || ((iree-translate --iree-hal-target-backends=dylib-llvm-aot -iree-mlir-to-vm-bytecode-module %s | iree-run-module --driver=dylib --entry_function=abs --function_inputs="i32=-2") | IreeFileCheck %s)
// iree-benchmark-module
// RUN: iree-translate --iree-hal-target-backends=vmla -iree-mlir-to-vm-bytecode-module %s | iree-benchmark-module --driver=vmla --entry_function=abs --function_inputs="i32=-2" | IreeFileCheck %s --check-prefix=BENCHMARK
// RUN: [[ $IREE_VULKAN_DISABLE == 1 ]] || (iree-translate --iree-hal-target-backends=vulkan-spirv -iree-mlir-to-vm-bytecode-module %s | iree-benchmark-module --driver=vulkan --entry_function=abs --function_inputs="i32=-2" | IreeFileCheck %s --check-prefix=BENCHMARK)
-// RUN: [[ $IREE_LLVMJIT_DISABLE == 1 ]] || (iree-translate --iree-hal-target-backends=llvm-ir -iree-mlir-to-vm-bytecode-module %s | iree-benchmark-module --driver=llvm --entry_function=abs --function_inputs="i32=-2" | IreeFileCheck %s --check-prefix=BENCHMARK)
+// RUN: [[ $IREE_LLVMAOT_DISABLE == 1 ]] || (iree-translate --iree-hal-target-backends=dylib-llvm-aot -iree-mlir-to-vm-bytecode-module %s | iree-benchmark-module --driver=dylib --entry_function=abs --function_inputs="i32=-2" | IreeFileCheck %s --check-prefix=BENCHMARK)
// iree-run-mlir
// RUN: (iree-run-mlir --iree-hal-target-backends=vmla --function-input="i32=-2" %s) | IreeFileCheck %s
// RUN: [[ $IREE_VULKAN_DISABLE == 1 ]] || (iree-run-mlir -iree-hal-target-backends=vulkan-spirv --function-input="i32=-2" %s | IreeFileCheck %s)
-// RUN: [[ $IREE_LLVMJIT_DISABLE == 1 ]] || (iree-run-mlir -iree-hal-target-backends=llvm-ir --function-input="i32=-2" %s | IreeFileCheck %s)
+// RUN: [[ $IREE_LLVMAOT_DISABLE == 1 ]] || (iree-run-mlir -iree-hal-target-backends=dylib-llvm-aot --function-input="i32=-2" %s | IreeFileCheck %s)
// BENCHMARK-LABEL: BM_abs
// CHECK-LABEL: EXEC @abs
diff --git a/scripts/update_op_coverage.py b/scripts/update_op_coverage.py
index 77ce782..642bf4d 100755
--- a/scripts/update_op_coverage.py
+++ b/scripts/update_op_coverage.py
@@ -31,12 +31,11 @@
E2E_XLA_OPS_PATH = 'iree/test/e2e/xla_ops'
-# TODO(scotttodd): LLVM AOT (dylib-llvm-aot) HAL target(s)
OP_COVERAGE_DESCRIPTION = """# XLA HLO Op Coverage
There are three backend [targets](https://github.com/google/iree/tree/main/iree/compiler/Dialect/HAL/Target) in IREE:
- vmla
-- llvm-ir
+- dylib-llvm-aot
- vulkan-spirv
The table shows the supported XLA HLO ops on each backend. It is auto-generated
@@ -65,7 +64,7 @@
"""Returns the target backend and operation pair of the test."""
test_suite_backends = {
'check_vmla_vmla': 'vmla',
- 'check_llvm-ir_llvm': 'llvm-ir',
+ 'check_dylib-llvm-aot_dylib': 'dylib-llvm-aot',
'check_vulkan-spirv_vulkan': 'vulkan-spirv'
}
for (test_suite, backend) in test_suite_backends.items():