[Mlir-commits] [mlir] 5c9db62 - [mlir][test] Add missing LIT config for `mlir-cpu-config` + emulator

Andrzej Warzynski llvmlistbot at llvm.org
Fri Jul 21 02:21:24 PDT 2023


Author: Andrzej Warzynski
Date: 2023-07-21T09:20:03Z
New Revision: 5c9db625873d9cbf891115f37265d093845b7cc7

URL: https://github.com/llvm/llvm-project/commit/5c9db625873d9cbf891115f37265d093845b7cc7
DIFF: https://github.com/llvm/llvm-project/commit/5c9db625873d9cbf891115f37265d093845b7cc7.diff

LOG: [mlir][test] Add missing LIT config for `mlir-cpu-config` + emulator

Similarly to when using `lli`, make sure that when using
`mlir-cpu-runner` with an emulator, a full path to `mlir-cpu-runner` is
used. Otherwise `mlir-cpu-runner` won't be found and you will get the
following error:
```
Error while loading mlir-cpu-runner: No such file or directory
```

This patch should fix:
  * https://lab.llvm.org/buildbot/#/builders/179
The breakage was originally introduced in
https://reviews.llvm.org/D155405.

Differential Revision: https://reviews.llvm.org/D155920

Added: 
    

Modified: 
    mlir/test/Integration/lit.local.cfg

Removed: 
    


################################################################################
diff  --git a/mlir/test/Integration/lit.local.cfg b/mlir/test/Integration/lit.local.cfg
index 12429d412cd45e..86008241f17c1e 100644
--- a/mlir/test/Integration/lit.local.cfg
+++ b/mlir/test/Integration/lit.local.cfg
@@ -36,14 +36,26 @@ def configure_aarch64_lli_and_mcr_cmd():
                 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}"
         )
 
-        if config.arm_emulator_mlir_cpu_runner_executable:
-          mcr_cmd = config.arm_emulator_mlir_cpu_runner_executable
-
         lli_cmd = f"{emulation_cmd} {lli_cmd}"
         mcr_cmd = f"{emulation_cmd} {mcr_cmd}"
 


        


More information about the Mlir-commits mailing list