Lecture Notes in Computer Science, 2000, Volume 1781/2000, 94-110, DOI: 10.1007/3-540-46423-9_7

Constant Propagation on the Value Graph: Simple Constants and Beyond

Jens Knoop and Oliver Rüthing

View Related Documents

Abstract

We present a new algorithm for constant propagation (CP), which works on the value graph of a program. This algorithm combines the (1) efficiency of the sparse CP-algorithms of Reif and Lewis [24,25], Ferrante and Ottenstein [9], and Wegman and Zadeck [30,31] with the (2) conceptual simplicity of their classic conventional counterparts of Kildall [19], and Kam and Ullman [16], while (3) outperforming them in power. It detects a proper superset of the simple constants detected by the classical CP-algorithms, while avoiding the exponential worst-case behaviour of the CP-algorithm for finite constants of Steffen and Knoop [28] allowing its optimality for acyclic control flow. The class detected is a well-balanced compromise between power and performance. In fact, we show that CP is co-NP-hard for acyclic control flow making the existence of efficient optimal algorithms for acyclic control flow most unlikely. Nonetheless, the new algorithm is open for extensions, e.g. towards conditional constants in the fashion of [30,31] in order to capture to a certain extent the determinism of conditional branching.

Fulltext Preview

Image of the first page of the fulltext document