Constant Propagation on the Value Graph: Simple Constants and Beyond

  • Authors:
  • Jens Knoop;Oliver Rüthing

  • Affiliations:
  • -;-

  • Venue:
  • CC '00 Proceedings of the 9th International Conference on Compiler Construction
  • Year:
  • 2000

Quantified Score

Hi-index 0.00

Visualization

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, Ferrante and Ottenstein, and Weg man and Zadeck with the (2) conceptual simplicity of their classic conventional counterparts of Kildall, and Kam and Ullman, while (3) outperformingt hem in power. It detects a proper superset of the simple constants detected by the classical CP-algorithms, while avoiding the exponential worstcase behaviour of the CP-algorithm for finite constants of Steffen and Knoop 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 in order to capture to a certain extent the determinism of conditional branching.