Skip to content

LLVM backend is not properly tested during CI

Summary

Running the CI pipeline with +llvm does not cause the testsuite to be built with the LLVM backend. As a result, issues with the LLVM backend may go unnoticed.

Steps to reproduce

For example, T22187_run reveals a bug in the LLVM backend (which will be addressed by !13936 (closed)):

$ git rev-parse HEAD
db3e810f32804ab9171a7f6b74a95480ded7011a
$ hadrian/build test -j --flavour=validate+llvm --only=T22187_run --test-way=llvm
...
=====> 1 of 1 [0, 0, 0]
Compile failed (exit code 1) errors were:
[1 of 2] Compiling Main             ( T22187_run.hs, T22187_run.o )
opt-15: /tmp/ghc460976_tmp_5_0/ghc_tmp_5_1.ll:560:22: error: '%XMM1_Arg' defined with type '<2 x i64>' but expected '<4 x float>'
  store <4 x float>  %XMM1_Arg, <4 x float>*  %XMM1_Var 
                     ^
<no location info>: error:
    `opt-15' failed in phase `LLVM Optimiser'. (Exit code: 1)


*** unexpected failure for T22187_run(llvm)
...

But, the problem does not surface if run without --test-way=llvm, even if +llvm flavour transformer is used:

$ hadrian/build test -j --flavour=validate+llvm --only=T22187_run
...
=====> 1 of 1 [0, 0, 0]

Performance Metrics (test environment: local):


None collected.


SUMMARY for test run started at Tue Feb 18 21:47:06 2025 
0:00:02.882705 spent to go through
       1 total tests, which gave rise to
       9 test cases, of which
       8 were skipped
       0 had missing libraries

       1 expected passes
       0 expected failures

       0 caused framework failures
       0 caused framework warnings
       0 unexpected passes
       0 unexpected failures
       0 unexpected stat failures
       0 fragile tests

Build completed in 24.49s

For example, a run of x86_64-linux-deb12-validate+llvm https://gitlab.haskell.org/ghc/ghc/-/jobs/2002909 does not show the failure.

Expected behavior

I expect +llvm transformer to set --test-way=llvm or something. At least, the testsuite should be run with --test-way=llvm during CI if LLVM Backend tag is set to the MR.

Environment

Optional:

  • Operating System:
  • System Architecture:
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information