Alive2
More info
- Creator
- Nuno P. Lopes, John Regehr et al.
- Type
- Verification tool
- Source
- github.com/AliveToolkit/alive2
- Website
- alive2.llvm.org
A tool that proves, or disproves, that an LLVM optimisation preserves a program's meaning by having an SMT solver compare the code before and after.
Its predecessor Alive (2015) let developers write peephole rules in a small DSL and verify them before they went into InstCombine. Alive2, described in a PLDI paper in 2021, does translation validation on real functions: it takes LLVM IR before and after an optimisation, encodes both as logical formulas and asks an SMT solver whether any input makes the results differ. If one exists, it prints it as a counterexample.
The tool has found hundreds of bugs in LLVM, a striking number of them in the handling of undef and poison values, where human intuition about what is allowed turns out to be worse than anyone hoped. The web version at alive2.llvm.org has become the standard way to settle arguments in code review.