If we can automatically derive compiler optimizations, we might be able to sidestep some of the substantial engineering challenges involved in creating and maintaining a high-quality compiler. We developed Souper, a synthesizing superoptimizer, to see how far these ideas might be pushed in the context of LLVM. Along the way, we discovered that Souper's intermediate representation was sufficiently similar to the one in Microsoft Visual C++ that we applied Souper to that compiler as well. Shipping, or about-to-ship, versions of both compilers contain optimizations suggested by Souper but implemented by hand. Alternately, when Souper is used as a fully automated optimization pass it compiles a Clang compiler binary that is about 3 MB (4.4%) smaller than the one compiled by LLVM.
翻译:如果我们能够自动生成编译优化, 我们也许能够回避创建和维护高质量编译器所涉及的一些重大工程挑战 。 我们开发了Souper, 一个合成超优化器, 来查看这些想法在LLLVM 背景下的推力。 顺便说一句, 我们发现Souper的中间代表器与微软视觉C++中我们也对该编译器应用Souper的中间代表器非常相似 。 两个编译器的版本都包含由 Souper 推荐的但由手动执行的优化。 或者说, 当Souper 被用作完全自动化的优化传票时, 它汇编了一个比LLLVM 汇编的版本小3MB (4.4%)的小的Clanger二进库。