File: lit.local.cfg

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (90 lines) | stat: -rw-r--r-- 3,747 bytes parent folder | download | duplicates (3)
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
from lit.llvm import llvm_config

if not config.mlir_include_integration_tests:
    config.unsupported = True


def configure_aarch64_lli_and_mcr_cmd():
    lli_cmd = "lli"
    mcr_cmd = "mlir-cpu-runner"

    # NOTE: If the SVE tests are disabled and the SME tests are enabled to run
    # under emulation, the SVE specific RUN lines in the SparseTensor tests
    # will run under emulation.
    if not (config.mlir_run_arm_sve_tests or config.mlir_run_arm_sme_tests):
        return (lli_cmd, mcr_cmd)

    config.substitutions.append(
        (
            "%mlir_native_utils_lib_dir",
            config.arm_emulator_utils_lib_dir or config.mlir_lib_dir,
        )
    )

    if config.arm_emulator_executable:
        if config.arm_emulator_lli_executable:
            lli_cmd = config.arm_emulator_lli_executable
        else:
            # Top-level lit config adds llvm_tools_dir to PATH but this is lost
            # when running under an emulator. If the user didn't specify an lli
            # executable, use absolute path %llvm_tools_dir/lli.
            lli_cmd = llvm_config.use_llvm_tool(
                "lli",
                search_env="LLI",
                required=True,
                search_paths=[config.llvm_tools_dir],
                use_installed=False,
            )

        if config.arm_emulator_mlir_cpu_runner_executable:
            mcr_cmd = config.arm_emulator_mlir_cpu_runner_executable
        else:
            # Top-level LIT config adds llvm_tools_dir to PATH but this is lost
            # when running under an emulator. If the user didn't specify an
            # mlir-cpu-runner executable, use absolute path
            # %llvm_tools_dir/mlir-cpu-runner.
            mcr_cmd = llvm_config.use_llvm_tool(
                "mlir-cpu-runner",
                search_env="MLIR_CPU_RUNNER",
                required=True,
                search_paths=[config.mlir_tools_dir],
                use_installed=False,
            )

        # Run test in emulator (qemu or armie)
        emulation_cmd = (
            f"{config.arm_emulator_executable} {config.arm_emulator_options}"
        )

        lli_cmd = f"{emulation_cmd} {lli_cmd}"
        mcr_cmd = f"{emulation_cmd} {mcr_cmd}"

    return (lli_cmd, mcr_cmd)


aarch64_lli_cmd, aarch64_mcr_cmd = configure_aarch64_lli_and_mcr_cmd()

# Configure the following AArch64 substitutions:
#
# * %lli_aarch64_cmd         - Invokes lli. For tests that _will_ run on AArch64 (ArmSVE, ArmSME).
# * %lli_host_or_aarch64_cmd - Invokes lli. For tests that _may_ run on AArch64 (SparseTensor).
# * %mcr_aarch64_cmd         - Invokes mlir-cpu-runner. For tests that _will_
#                              run on AArch64. May invoke mlir-cpu-runner under
#                              an AArch64 emulator (when
#                              `config.arm_emulator_executable` is set).
#
# AArch64 tests will run under emulation if configured at build time by the
# following CMake options:
#
# * ARM_EMULATOR_EXECUTABLE     - emulator to use.
# * ARM_EMULATOR_OPTIONS        - options for emulator.
# * ARM_EMULATOR_LLI_EXECUTABLE - AArch64 native lli to support cross-compilation.
# * ARM_EMULATOR_UTILS_LIB_DIR  - AArch64 native utilites library to support cross-compilation.
#
# Functionally the two substitutions are equivalent, i.e. %lli_aarch64_cmd
# could be used in the SparseTensor tests where necessary, but the meaning
# conveyed by the substitution name would be a misnomer if the host target
# is not AArch64 and MLIR_RUN_ARM_SVE_TESTS=OFF.
config.substitutions.append(("%lli_aarch64_cmd", aarch64_lli_cmd))
config.substitutions.append(("%lli_host_or_aarch64_cmd", aarch64_lli_cmd))
config.substitutions.append(("%mcr_aarch64_cmd", aarch64_mcr_cmd))