Java Reference
In-Depth Information
1
3
Start
4
5
14
y = 3
w = 5
13
6
w = y+2
7
y = w−2
8
9
w = 5
x = 3
10
w = 1
x = 7
11
u = w+x
2
12
Stop
Figure 14.60: A program for constant propagation. The depth-first
number of each node is shown near the top of each node.
We pose the constant propagation over a program's variables . fthe
program contains an expression or subexpression of interest, then this
can be assigned to a temporary variable. Constant propagation can then
try to discover a constant value for the temporary variable.
For each variable, we formulate the three-tiered lattice shown in Fig-
ure 14.59.
-
means that the variable is considered a constant of an (as yet)
undetermined value.
-
means that the expression is not constant.
- Otherwise, the expression has a constant value found in the middle
layer.
 
Search WWH ::




Custom Search