Program optimization is the process of modifying software to execute more efficiently. Because finding the optimal program is generally undecidable, modern compilers usually resort to expert-written heuristic optimizations. In contrast, superoptimizers attempt to find the optimal program by employing significantly more expensive search and constraint solving techniques. Generally, these methods do not scale well to programs in real development scenarios, and as a result superoptimization has largely been confined to small-scale, domain-specific, and/or synthetic program benchmarks. In this paper, we propose a framework to learn to superoptimize real-world programs by using neural sequence-to-sequence models. We introduce the Big Assembly benchmark, a dataset consisting of over 25K real-world functions mined from open-source projects in x86-64 assembly, which enables experimentation on large-scale optimization of real-world programs. We propose an approach, Self Imitation Learning for Optimization (SILO) that is easy to implement and outperforms a standard policy gradient learning approach on our Big Assembly benchmark. Our method, SILO, superoptimizes programs an expected 6.2% of our test set when compared with the gcc version 10.3 compiler's aggressive optimization level -O3. We also report that SILO's rate of superoptimization on our test set is over five times that of a standard policy gradient approach and a model pre-trained on compiler optimization demonstration.
翻译:程序优化是修改软件以更高效地执行程序的过程。 因为找到最佳程序一般是不可估量的, 现代编译者通常会采用专家编写的超光速优化。 相反, 超优化器试图通过使用昂贵得多的搜索和限制解决技术来找到最佳程序。 一般而言, 这些方法并不适应实际开发情景中的方案, 结果, 超优化主要局限于小规模、 特定域和/ 或合成程序基准 。 由于找到最佳程序一般是不可估量的, 现代编译者通常会采用专家编写的超优化现实世界程序的框架 。 相反, 我们引入大大会基准, 由25K以上真实世界功能组成的数据集, 由x86- 64 组装的开放源项目所采掘的 。 这有利于在大规模优化真实世界程序上进行实验, 结果, 超优化主要限于小规模的、 特定域和/ 合成程序。 我们提出的一个方法, 简单实施和超越大大会基准标准的政策梯度学习方法。 我们的方法, SILO, 超优化的系统, 也比我们的标准标准的S10比标准标准标准标准标准标准的S10 标准的S10比标准标准标准标准标准标准标准的S10标准的S10比标准标准标准标准标准标准标准标准标准标准标准标准标准的S 6.标准标准标准标准的S 6.标准标准的S 6.标准标准标准的S10比标准标准标准标准标准标准标准标准标准标准标准标准标准标准标准标准标准标准标准标准标准的S 6.。