Re:A Few Synthesizing Superoptimizer Results
by andrewchambers on Sunday July 26, 2015 @09:52PM
(#9952978)
My intuition is that stacking general super optimizers will be at best equally or less effective than just running a machine specific one for twice as long.
[ Parent
| on HN ]
The advantage of performing superoptimization on IR level is that you have explicit data dependencies (due to SSA form). Thus you don't have unrelated instructions in between. Figure 1 of the cited Optgen paper http://pp.info.uni-karlsruhe.de/uploads/publikationen/buchwa... shows an example that can be optimized with IR-based superoptimization but not with a machine-specific one.
In summary, no approache subsumes the other one. Thus, it is worthwhile to have them both.
I believe the intention here is to use the super-optimiser to derive specific generally-applicable optimisations that can be contributed back to LLVM as peephole optimisations, rather than running the super-optimiser as part of the usual compilation process.
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.