Examining and Reducing the Influence of Sampling Errors on Feedback-Driven Optimizations

Autor: Mingzhou Zhou, Bo Wu, Xipeng Shen, Yaoqing Gao, Graham Yiu
Rok vydání: 2016
Předmět:
Zdroj: ACM Transactions on Architecture and Code Optimization. 13:1-24
ISSN: 1544-3973
1544-3566
DOI: 10.1145/2851502
Popis: Feedback-driven optimization (FDO) is an important component in mainstream compilers. By allowing the compiler to reoptimize the program based on some profiles of the program's dynamic behaviors, it often enhances the quality of the generated code substantially. A barrier for using FDO is that it often requires many training runs to collect enough profiles to amortize the sensitivity of program optimizations to program input changes. Various sampling techniques have been explored to alleviate this time-consuming process. However, the lowered profile accuracy caused by sampling often hurts the benefits of FDO. This article gives the first systematic study in how sampling rates affect the accuracy of collected profiles and how the accuracy correlates with the usefulness of the profile for modern FDO. Studying basic block and edge profiles for FDO in two mature compilers reveals several counterintuitive observations, one of which is that profiling accuracy does not strongly correlate with the benefits of the FDO. A detailed analysis identifies three types of sampling-caused errors that critically impair the quality of the profiles for FDO. It then introduces a simple way to rectify profiles based on the findings. Experiments demonstrate that the simple rectification fixes most of those critical errors in sampled profiles and significantly enhances the effectiveness of FDO.
Databáze: OpenAIRE