Code specialization based on value profiles

Robert Muth, Scott Watterson, Saumya K Debray

Research output: Chapter in Book/Report/Conference proceedingConference contribution

21 Citations (Scopus)

Abstract

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.

Original languageEnglish (US)
Title of host publicationLecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)
PublisherSpringer Verlag
Pages340-361
Number of pages22
Volume1824 LNCS
ISBN (Print)3540676686, 9783540676683
StatePublished - 2000
Event7th International Symposium on Static Analysis, SAS 2000 - Santa Barbara, CA, United States
Duration: Jun 29 2000Jul 1 2000

Publication series

NameLecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)
Volume1824 LNCS
ISSN (Print)03029743
ISSN (Electronic)16113349

Other

Other7th International Symposium on Static Analysis, SAS 2000
CountryUnited States
CitySanta Barbara, CA
Period6/29/007/1/00

Fingerprint

Cost benefit analysis
Specialization
Cost-benefit Analysis
Testing
Static Analysis
Compiler
Costs
Optimise
Invariant
Necessary
Profile
Optimization
Experimental Results
Arbitrary

ASJC Scopus subject areas

  • Computer Science(all)
  • Theoretical Computer Science

Cite this

Muth, R., Watterson, S., & Debray, S. K. (2000). Code specialization based on value profiles. In Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics) (Vol. 1824 LNCS, pp. 340-361). (Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics); Vol. 1824 LNCS). Springer Verlag.

Code specialization based on value profiles. / Muth, Robert; Watterson, Scott; Debray, Saumya K.

Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics). Vol. 1824 LNCS Springer Verlag, 2000. p. 340-361 (Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics); Vol. 1824 LNCS).

Research output: Chapter in Book/Report/Conference proceedingConference contribution

Muth, R, Watterson, S & Debray, SK 2000, Code specialization based on value profiles. in Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics). vol. 1824 LNCS, Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics), vol. 1824 LNCS, Springer Verlag, pp. 340-361, 7th International Symposium on Static Analysis, SAS 2000, Santa Barbara, CA, United States, 6/29/00.
Muth R, Watterson S, Debray SK. Code specialization based on value profiles. In Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics). Vol. 1824 LNCS. Springer Verlag. 2000. p. 340-361. (Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)).
Muth, Robert ; Watterson, Scott ; Debray, Saumya K. / Code specialization based on value profiles. Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics). Vol. 1824 LNCS Springer Verlag, 2000. pp. 340-361 (Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)).
@inproceedings{557b1f9aec264877bd332e4fa04d91e6,
title = "Code specialization based on value profiles",
abstract = "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.",
author = "Robert Muth and Scott Watterson and Debray, {Saumya K}",
year = "2000",
language = "English (US)",
isbn = "3540676686",
volume = "1824 LNCS",
series = "Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)",
publisher = "Springer Verlag",
pages = "340--361",
booktitle = "Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)",

}

TY - GEN

T1 - Code specialization based on value profiles

AU - Muth, Robert

AU - Watterson, Scott

AU - Debray, Saumya K

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

M3 - Conference contribution

SN - 3540676686

SN - 9783540676683

VL - 1824 LNCS

T3 - Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)

SP - 340

EP - 361

BT - Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)

PB - Springer Verlag

ER -