Issue 186165
Summary [llvm-lit] 20 second delay before any tests are ran
Labels new issue
Assignees
Reporter NeKon69
    I have been hitting this for about a month and tracked it down to the `clang-repl --cuda` run in `clang/test/lit.cfg.py`, specifically `have_host_clang_repl_cuda()`.
On my machine, any `llvm-lit` run that loads the `clang` test suite pays about 20 seconds during startup before test discovery/execution. The expensive step is the `clang-repl --cuda` probe used to determine whether `host-supports-cuda` should be added.
I ran the same command that `have_host_clang_repl_cuda()` runs and got the following errors:
```text
module flag identifiers must be unique (or of 'require' type)
!"wchar_size"
module flag identifiers must be unique (or of 'require' type)
!"nvvm-reflect-ftz"
module flag identifiers must be unique (or of 'require' type)
!"frame-pointer"
fatal error: error in backend: Broken module found, compilation aborted!
```

FYI it also has this 20 seconds delay

<details>
<summary>bash repro</summary>

```bash
printf '%s\n' \
  '__global__ void test_func() {}' \
  'test_func<<<1,1>>>();' \
  'extern "C" int puts(const char *s);' \
  'puts(cudaGetLastError() ? "failure" : "success");' \
 '%quit' \
  | build_Debug/bin/clang-repl --cuda
```

</details>


Lets ignore the fact that i have CUDA installed and an NVIDIA GPU, but llvm-lit still ends up marking the CUDA interpreter tests as unsupported (this is not in the scope of this issue).

The `have_host_clang_repl_cuda()` probe is run from the global `clang/test/lit.cfg.py`, so unrelated llvm-lit runs pay the startup cost even though the result is only used by clang/test/Interpreter/CUDA.

Even if the `clang-repl --cuda` failure is the deeper bug (which I'm not sure if it is), it seems like this probe should not run before general clang test discovery. It would be better if it were limited to the CUDA interpreter test subtree.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to