4 ms·
Superoptimizers attempt to find shorter instruction sequences. This may or may not produce faster code - sometimes you can make code faster by inserting nops!
by millstone 6y ago
Superoptimizers attempt to find shorter instruction sequences. This may or may not produce faster code - sometimes you can make code faster by inserting nops!
The idea of superoptimization is to find missed optimizations, which a human can review and then implement directly.
- deleted 6y ago[deleted]
- josephg 6y ago> Superoptimizers attempt to find shorter instruction sequences. That sounds measurable.
- deleted 6y ago[deleted]
- kzrdude 6y agoIt should have a trophy case then :) About nice found optimizations
- celrod 6y agoYeah, I'd like to know more about what it can do. Can it optimize sequences of shuffles? If so, it'd be worth a try, even if it takes hours (probably doesn't take that long?), I could let it run until it finds faster sequences than what I have now, and update my code. But for it to be worth the time for me to figure out how to install and use it, I need some sort of expectation for what I'd get out of trying this instead of something else.
- kzrdude 6y agoit's not an optimizer and so it's runtime doesn't matter really. It's intended to find new rules (patterns) that can in turn be implemented in llvm as new optimizations. So this thing is just a research step.
- millstone 6y agoThe trophy case is here: https://www.cs.utah.edu/~regehr/souper/ https://www.cs.utah.edu/~regehr/souper/ Example program 6: https://www.cs.utah.edu/~regehr/souper/output_6.html https://www.cs.utah.edu/~regehr/souper/output_6.html int a, b; void fn1() { b = a * ~1 == 1; } Here we multiply an int by -2. LLVM emitted the multiply and compare, but Souper proved that no int multiplied by -2 can equal 1, so this could be optimized to 0. By its nature Souper becomes less effective over time as its findings are incorporated into LLVM, so most of the trophies are old!
- underdeserver 6y agoIf the goal is smaller code then show me a benchmark on the size of the code.
- CUViper 6y agoIt would be kind of amusing if this shortened code by re-rolling an unrolled loop.
- touisteur 6y agoAre you sure about shorter? If you have a model of execution behaviour you can build the 'best' instruction sequence for your operation. Not all superoptimizers are born equal.