A Few Synthesizing Superoptimizer Results
blog.regehr.org
blog.regehr.org
I feel like the way other superoptimizers get good results is by taking advantage of really strange interactions of some of the less commonly understood opcodes. LLVM doesn't have those funky opportunities.
Of course there a cases where preventing an IR optimization can trigger a more powerful one and the resulting code gets better. However, in general I would say it's the other way around: Performing the IR superoptimization leads to better code quality.
The goal of an optimization pass is to improve the performance of an average, and that's exactly what the IR superoptimization does.
That being the case, it seems like it would be advantageous to create optimisations that work at both stages of compilation - not least because the IR-level ones will be more widely applicable.
In summary, no approache subsumes the other one. Thus, it is worthwhile to have them both.
Here he talks about the end-results of Souper and Alive, which should be presented more user-friendly and generalized, with some help from a solver. Encoding every single edge-case into the optimizer is not as good as finding better generalizations, automatically.
Another idea I want to see tried is a source code annotation which indicates to an llvm plugin to run machine specific super optimization on a specific basic block and cache the result. Might be an interesting way to enhance tight loops.
A third idea I had would be to use super optimization as a way of automatically generating isel selectors with only the lowest level descriptions of what the ir and the opcodes do. That is harvest a program for ir sequences, automatically find good mappings to assembly constructs, automatically emit a backend.