Profile guided optimization is an effective technique for improving the optimization ability of compilers based on dynamic behavior, but collecting profile data is expensive, cumbersome, and requires regular updating to remain fresh. We present a novel statistical approach to inferring branch probabilities that improves the performance of programs that are compiled without profile guided optimizations. We perform offline training using information that is collected from a large corpus of binaries that have branch probabilities information. The learned model is used by the compiler to predict the branch probabilities of regular uninstrumented programs, which the compiler can then use to inform optimization decisions. We integrate our technique directly in LLVM, supplementing the existing human-engineered compiler heuristics. We evaluate our technique on a suite of benchmarks, demonstrating some gains over compiling without profile information. In deployment, our technique requires no profiling runs and has negligible effect on compilation time.
翻译:概况指导优化是提高汇编者根据动态行为优化能力的有效方法,但收集概况数据是昂贵、繁琐和需要定期更新才能保持更新的。我们提出了一种新的统计方法,用以推断分支概率,从而改进未经剖析指导优化而汇编的方案的性能。我们使用从大量具有分支概率信息的二进制资料库收集的信息进行离线培训。汇编者使用该学习模型来预测正常非工具程序分支概率,而汇编者随后可以使用该模型来为优化决策提供信息。我们直接将我们的技术纳入LLLVM,以补充现有的人造编集编集者的体力学。我们用一套基准来评估我们的技术,在没有剖析信息的情况下进行编集。在部署过程中,我们的技术不需要剖析运行,对编集时间产生微不足道的影响。