the first thing we do after adding a new feature to Alive2 is run it over the LLVM unit tests.
and by doing this, riscv-tv found a vector miscompile!
the first thing we do after adding a new feature to Alive2 is run it over the LLVM unit tests.
and by doing this, riscv-tv found a vector miscompile!
@regehr Does that mean that the LLVM unit tests from the LLVM repository included C source code that LLVM was generating incorrect RVV code for?
@xentrac not C, but LLVM IR
@regehr Was the unit test requiring that incorrect RVV code to pass, or was it just not testing it?
@xentrac @regehr The lit tests simply check input LLVM IR and output LLVM IR after the transformation. It fundamentally cannot be a correctness check, because that would require compiling it down to assembly, having a known-gold answer to each snippet (this means having a main function, in particular), and running it on actual hardware to "check the answer". Further, different hardware may report different answers, and some hardware may be buggy, so the problem of checking correctness can only be done by mathematically reasoning about the semantics of the LLVM IR, otherwise known as a traslation-validator or tv.
@artagnon @xentrac but to answer Kragen... this test is not literally found in the test suite, but is rather a reduced version of one that is (I forgot that I had asked an LLM to reduce the bug triggers while it was doing triage for me).
but, a test triggering the same miscompile triggered by my test case is found in the test suite
but also it turns out my bug report was a dup :(
@artagnon @xentrac but also -- we've found plenty of LLVM bugs using its own tests, just because we have a great oracle. I've done the same thing with other research projects previously, for example the code that eventually became the integer parts of UBsan found bugs in most everything using their own unit tests