this bug was causing miscompile.
now clang cant properly selfhost with -mllvm --enable-knowledge-retention
Details
- Reviewers
jdoerfert lebedev.ri - Commits
- rGa79e604462ea: [AssumeBundles] Fix Bug in Assume Queries
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
i would also like to add a test for it, but the smallest reproduction example is still very big 30k+ line of IR
and depend on what is present in the AssumptionCache so i could only reproduce it under -O3 run.
it isn't minimized at all but minimizing it in a way that still exibit the bug is quite hard
Also, this either needs a rebase, or this isn't against master but the stack doesn't say so.
The patch should apply cleanly now. it was conflicting with an other path that landed.
one way to see the effect of the bug is to try to run ADT unitest compiled with stage1 clang with -O3 -mllvm --enable-knowledge-retention.
this test should have test failures caused by this bug.
one of the files in which a miscompile occurs is /home/tyker/opensource/llvm-project/llvm/unittests/ADT/ImmutableSetTest.cpp
here is the unoptimized IR that triggers the bug.
running: opt -O3 --enable-knowledge-retention tmp.ll
LG
@jdoerfert ?
By not treating compiler as a black box - there is a (an unreduced) testcase already, and a fix, that changes the IR after optimizations.
So one just has to write an interestingness test that checks that 1. the bug is still triggered, and 2. the final IR differs with/without the fix.
I would be lying if i said that llvm-reduce got those 2mb down to these 40 lines all by itself,
there are still some rough edges that required manual intervention..