blob: 2c9afd4babe88c87a33363dc3f5bd0478dcf102b [file]
# Copyright 2026 The IREE Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
load("//build_tools/bazel:build_defs.oss.bzl", "iree_cmake_extra_content")
load("//build_tools/bazel:enforce_glob.bzl", "enforce_glob")
load("//build_tools/bazel:iree_lit_test.bzl", "iree_lit_test_suite")
package(
features = ["layering_check"],
licenses = ["notice"], # Apache 2.0
)
iree_lit_test_suite(
name = "lit",
srcs = enforce_glob(
# keep sorted
[
"e2e_inner_tiled_pipeline.mlir",
"lookup_builtin_and_byo.mlir",
"lower_inner_tiled_to_bitcode_ukernel.mlir",
"lower_inner_tiled_to_bitcode_ukernel_i8_vnni.mlir",
"select_ukernel.mlir",
"ukernel_inlining.mlir",
],
include = ["*.mlir"],
exclude = [
"ukernel_inlining_aarch64.mlir",
"ukernel_inlining_riscv64.mlir",
],
),
cfg = "//compiler:lit.cfg.py",
tools = [
"//tools:iree-compile",
"//tools:iree-opt",
"@llvm-project//llvm:FileCheck",
],
)
# The tests below compile for other architectures. That needs the LLVM target
# and the ukernel bitcode of the architecture. CMake builds both only if
# LLVM_TARGETS_TO_BUILD has the target, and only then adds the test. The Bazel
# build always has these targets.
iree_cmake_extra_content(
content = """
iree_compiler_targeting_iree_arch(_IREE_COMPILER_TARGETING_ARM_64 "arm_64")
if(_IREE_COMPILER_TARGETING_ARM_64)
""",
inline = True,
)
iree_lit_test_suite(
name = "lit_aarch64",
srcs = ["ukernel_inlining_aarch64.mlir"],
cfg = "//compiler:lit.cfg.py",
tools = [
"//tools:iree-compile",
"@llvm-project//llvm:FileCheck",
],
)
iree_cmake_extra_content(
content = """
endif()
""",
inline = True,
)
iree_cmake_extra_content(
content = """
iree_compiler_targeting_iree_arch(_IREE_COMPILER_TARGETING_RISCV_64 "riscv_64")
if(_IREE_COMPILER_TARGETING_RISCV_64)
""",
inline = True,
)
iree_lit_test_suite(
name = "lit_riscv64",
srcs = ["ukernel_inlining_riscv64.mlir"],
cfg = "//compiler:lit.cfg.py",
tools = [
"//tools:iree-compile",
"@llvm-project//llvm:FileCheck",
],
)
iree_cmake_extra_content(
content = """
endif()
""",
inline = True,
)