Precise interprocedural dataflow analysis with applications to constant propagation

Mooly Sagiv, Thomas Reps, Susan Horwitz

Research output: Contribution to journalArticlepeer-review

Abstract

This paper concerns interprocedural dataflow-analysis problems in which the dataflow information at a program point is represented by an environment (i.e., a mapping from symbols to values), and the effect of a program operation is represented by a distributive environment transformer. We present two efficient algorithms that produce precise solutions: an exhaustive algorithm that finds values for all symbols at all program points, and a demand algorithm that finds the value for an individual symbol at a particular program point. Two interesting problems that can be handled by our algorithms are (decidable) variants of the interprocedural constant-propagation problem: copy-constant propagation and linear-constant propagation. The former interprets program statements of the form x := 7 and x := y. The latter also interprets statements of the form x := 5 * y + 17. Experimental results on C programs have shown that • Although solving constant-propagation problems precisely (i.e., finding the meet-over-all-valid-paths solution, rather than the meet-over-all-paths solution) resulted in a slowdown by a factor ranging from 2.2 to 4.5, the precise algorithm found additional constants in 7 of 38 test programs. • In contrast to previous results for numeric Fortran programs, linear-constant propagation found more constants than copy-constant propagation in 6 of 38 test programs. • The demand algorithm, when used to demand values for all uses of scalar integer variables, was faster than the exhaustive algorithm by a factor ranging from 1.14 to about 6.

Original languageEnglish
Pages (from-to)131-170
Number of pages40
JournalTheoretical Computer Science
Volume167
Issue number1-2
DOIs
StatePublished - 30 Oct 1996
Externally publishedYes

Fingerprint

Dive into the research topics of 'Precise interprocedural dataflow analysis with applications to constant propagation'. Together they form a unique fingerprint.

Cite this