Code specialization based on value profiles

Robert Muth, Scott Watterson, Saumya Debray

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

23 Scopus citations

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 publicationStatic Analysis - 7th International Symposium, SAS 2000, Proceedings
PublisherSpringer-Verlag
Pages340-361
Number of pages22
ISBN (Print)3540676686, 9783540676683
StatePublished - Jan 1 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)0302-9743
ISSN (Electronic)1611-3349

Other

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

ASJC Scopus subject areas

  • Theoretical Computer Science
  • Computer Science(all)

Fingerprint Dive into the research topics of 'Code specialization based on value profiles'. Together they form a unique fingerprint.

  • Cite this

    Muth, R., Watterson, S., & Debray, S. (2000). Code specialization based on value profiles. In Static Analysis - 7th International Symposium, SAS 2000, Proceedings (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.