Minotaur: A SIMD-oriented synthesizing superoptimizer
arxiv.org
arxiv.org
do {
if (*--p == '.') *p = '_';
} while (p != name);
LLVM originally produced this bitcode for AVX-2 instructions: %1 = shufflevector %0, <31, 30, 29, ... , 0>
%2 = icmp eq %1, <46, 46, 46, ... , 46>
%3 = shufflevector %2, <31, 30, 29, ... , 0>
Minotaur instead produced: %1 = icmp eq %0, <46, 46, 46, ... , 46>
Both compare the register to ASCII 46 ('.'), but LLVM originally produced an unnecessary pair of vector reversals. Minotaur removed it.https://theory.stanford.edu/~aiken/publications/papers/asplo...
> Souper is a superoptimizer for LLVM IR. It uses an SMT solver to help identify missing peephole optimizations in LLVM's midend optimizers.
[1] https://www.deepmind.com/blog/alphadev-discovers-faster-sort...
There was an interesting paper a while back before the LLM craze that basically did this for OpenMP programs. You'd feed it the source code to some loop body or whatever, and it would try to pick the right OMP block/loop scheduling parameters from there.
Naturally, if you're training it on open code, you will have to censor the AI so it doesn't use flags like -ffast-math too much. :)
There are many research projects out there exploring different ways to use neural networks for compiler optimisation though. My impression is that most of them are using it as a technique to replace heuristics to find candidate solutions for local optimisation problems.