Re:Can we do better than our C compiler?
by tikhonj on Thursday August 13, 2020 @12:49PM
(#24145393)
And the flip side is that STOKE and friends can find new, faster ways to compile code... only for short snippets :).
That said, compilers and superoptimizers can go together well. One of my favorite examples is using program synthesis to generate peephole optimization rules for a compiler[1]. The synthesis step takes a long time and only works for short snippets, but if you can turn the results of that into rules a compiler's optimization system can use, you only have to pay the synthesis cost once and the compiler can apply those rules to speed up large programs.
To actually answer your question, compilers are pretty good, and so are expert human assemblers, but they both miss things even for short snippets.