SamplePGO - The Power of Profile Guided Optimizations without the Usability Burden
暂无分享,去创建一个
Profile-guided optimizations (PGO) offer more optimization opportunities that are typically hard to obtain with static heuristics and techniques. In several application domains, significant performance can be gained by using runtime profiles to guide optimization. However, traditional PGO techniques that rely on compiler instrumentation are difficult enough to use that they have not become very popular.This paper describes SamplePGO, an LLVM implementation of a profile-guided technique that addresses the usability problem. Instead of using compiler-generated instrumentation to generate profiles, it relies on profile information gathered by external sampling profilers. These profilers use commonly available hardware counters to inspect the execution of a program.In our experience with large applications in video/image processing, logs processing, web search and ads, we have obtained, in our GCC implementation, performance improvements of up to 30% using SamplePGO over statically optimized code.While the LLVM implementation is fully functional as of LLVM 3.5, not many optimization passes in LLVM make use of profile information. Therefore, the speedups we have been able to obtain using LLVM are much more modest (up to 5% over statically optimized code).
[1] James R. Larus,et al. Optimally profiling and tracing programs , 1992, POPL '92.
[2] Wenguang Chen,et al. Taming Hardware Event Samples for Precise and Versatile Feedback Directed Optimizations , 2013, IEEE Transactions on Computers.
[3] Gadi Haber,et al. Complementing Missing and Inaccurate Profiling Using a Minimum Cost Circulation Algorithm , 2008, HiPEAC.
[4] Matthew Arnold,et al. A framework for reducing the cost of instrumented code , 2001, PLDI '01.