TY - GEN
T1 - Code specialization based on value profiles
AU - Muth, Robert
AU - Watterson, Scott
AU - Debray, Saumya
PY - 2000
Y1 - 2000
N2 - It is often the case at runtime that variables and registers in programs are "quasi-invariant," i.e., the distribution of the values they take on is very skewed, with a small number of values occurring most of the time. Knowledge of such frequently occurring values can be exploited by a compiler to generate code that optimizes for the common cases without sacrificing the ability to handle the general case. The idea can be generalized to the notion of expression profiles, which profile the runtime values of arbitrary expressions and can permit optimizations that may not be possible using simple value profiles. Since this involves the introduction of runtime tests, a careful cost-benefit analysis is necessary to make sure that the benefits from executing the code specialized for the common values outweigh the cost of testing for these values. This paper describes a static cost-benefit analysis that allows us to discover when such specialization is profitable. Experimental results, using such an analysis and an implementation of low-level code specialization based on value and expression profiles within a link-time code optimizer, are given to validate our approach.
AB - It is often the case at runtime that variables and registers in programs are "quasi-invariant," i.e., the distribution of the values they take on is very skewed, with a small number of values occurring most of the time. Knowledge of such frequently occurring values can be exploited by a compiler to generate code that optimizes for the common cases without sacrificing the ability to handle the general case. The idea can be generalized to the notion of expression profiles, which profile the runtime values of arbitrary expressions and can permit optimizations that may not be possible using simple value profiles. Since this involves the introduction of runtime tests, a careful cost-benefit analysis is necessary to make sure that the benefits from executing the code specialized for the common values outweigh the cost of testing for these values. This paper describes a static cost-benefit analysis that allows us to discover when such specialization is profitable. Experimental results, using such an analysis and an implementation of low-level code specialization based on value and expression profiles within a link-time code optimizer, are given to validate our approach.
UR - http://www.scopus.com/inward/record.url?scp=84906098649&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=84906098649&partnerID=8YFLogxK
U2 - 10.1007/978-3-540-45099-3_18
DO - 10.1007/978-3-540-45099-3_18
M3 - Conference contribution
AN - SCOPUS:84906098649
SN - 3540676686
SN - 9783540676683
T3 - Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)
SP - 340
EP - 361
BT - Static Analysis - 7th International Symposium, SAS 2000, Proceedings
A2 - Palsberg, Jens
PB - Springer-Verlag
T2 - 7th International Symposium on Static Analysis, SAS 2000
Y2 - 29 June 2000 through 1 July 2000
ER -