Abstract
Compilers can exploit knowledge that a variable has a fixed known value at a program point for optimizations such as code specialization and constant folding. Recent work has shown that it is possible to take advantage of such optimizations, and thereby obtain significant performance improvements, even if a variable cannot be statically guaranteed to have a fixed constant value. To do this profitably, however, it is necessary to take into account information about the runtime distribution of values taken on by variables. This information can be obtained though value profiling. Unfortunately, existing approaches to value profiling incur high overheads, primarily because profiling is carried out without consideration for the way in which the resulting information will be used. In this paper, we describe an approach to reduce the cost of value profiling by making the value profiler aware of the utility of the value profiles being gathered. This allows our profiler to avoid wasting resources where the profile can be guaranteed to not be useful for optimization. This results in significant reductions in both the time and space requirements for value profiling. Our approach, implemented in the context of the alto link-time optimizer, is an order of magnitude faster, and uses about 5% of the space, of a straightforward implementation.
Chapter PDF
Similar content being viewed by others
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
References
J. Auslander, M Philipose, C. Chambers, S. Eggers, and B. Bershad. Fast, effectvie dynamic compilation. In SIGPLAN’ 96 Conference on Programming Language Design and Implementation, pages 149–159, May 1996.
T. Ball and J. R. Larus, “Optimally Profiling and Tracing Programs”, Proc. 19th. Symposium on Principles of Programming Languages, Jan. 1992.
T. Ball and J. R. Larus, “Efficient Path Profiling”, Proc. MICRO-29, Dec. 1996.
B. Calder, P. Feller, and A. Eustace. Value profiling. In 30th Annual International Symposium on Microarchitecture, pages 259–269, December 1997.
B. Calder, P. Feller, and A. Eustace.Value profiling and optimization. In Journal of Instruction Level Parallelism, 1999.
P. P. Chang, S. A. Mahlke, W. Y. Chen, and W. W. Hwu, “Profile-guided automatic inline expansion for C programs”, Software Practice and Experience vol. 22 no. 5, May 1992, pp. 349–369.
R. Cohn and P. G. Lowney, “Hot Cold Optimization of Large Windows/NT Applications”, Proc. MICRO29, Dec. 1996.
C. Consel and F. Noel. A general approach to run-time specialization and its application to c. In 23rd Annual ACM Symposium on Principles of Programming Languages, pages 145–146, Jan 1996.
D. Engler, W. Hsieh, and M. Kaashoek. ’c:A language for high-level, efficient, and machineindependent dynamic code generation. In 23rd Annual ACM Symposium on Principles of Programming Languages, pages 131–144, Jan 1996.
P. Feller. Value profling for instructions and memory locations. Master’s thesis, UCSD, 1998.
C. Fu, M. Jennings, S. Larin, and T. Conte. Software-only value speculation scheduling. Technical report, Department of Electrical and Computer Engineering, North Carolina State University, June 1998.
F. Gabbay and A. Mendelson. Can program profiling support value prediction? In Proceedings of the 30 th Annual ACM/IEEE International Symposium on Microarchitecture, pages 270–280, Dec 1997.
A. J. Goldberg, “ReducingOverhead in Counter-Based Execution Profiling”,Technical Report CSL-TR-91-495, Computer Systems Lab., Stanford University, Oct. 1991.
S. S. Muchnick, Advanced Compiler Design and Implementation, Morgan Kaufman, 1997.
Robert Muth, Scott Watterson, and Saumya Debray. Code specialization using value profiles. In Static Analysis Symposium, July 2000, pp. 340–359.
R. Muth, S. K. Debray, S. Watterson, and K. De Bosschere, “alto: ALink-Time Optimizer for the Compaq Alpha”, Software-Practice and Experience, vol. 31 no. 1, Jan 2001, pp. 67–101.
K. Pettis and R. C. Hansen, “Profile-Guided Code Positioning”, Proc. SIGPLAN’ 90 Conference on Programming Language Design and Implementation, June 1990, pp. 16–27.
B. Calder and D. Grunwald, “Reducing Indirect Function Call Overhead in C++ Programs”, Proc. 21st ACM Symposium on Principles of Programming Languages, Jan. 1994, pp. 397–408.
U. Hölzle and D. Ungar, “Optimizing Dynamically-Dispatched Calls with Run-Time Type Feedback”, Proc. SIGPLAN’ 94 Conference on Programming Language Design and Implementation (PLDI), June 1994, pp. 326–336.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2001 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Watterson, S., Debray, S. (2001). Goal-Directed Value Profiling. In: Wilhelm, R. (eds) Compiler Construction. CC 2001. Lecture Notes in Computer Science, vol 2027. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45306-7_22
Download citation
DOI: https://doi.org/10.1007/3-540-45306-7_22
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-41861-0
Online ISBN: 978-3-540-45306-2
eBook Packages: Springer Book Archive