Example: Copy Constant Propagation (CCP)
Variable V is a copy constant (i) if V is assigned a constant, or
(ii)if V is defined by a copy V:= is a copy constant
call Q
a = 0
b = a
c = b
Write b
A = b + c
Procedure Main
1
2
3
4
5
6
7
f2(xa,xb,xc)=(0,xb,xc)
f3(xa,xb,xc)=(xa,xa,xc)
f4(xa,xb,xc)=(xa,xb,xb)
f6(xa,xb,xc)= (?,xb,xc)
Procedure P
entry
Write(a,b,c)
Read(b)
exit
8
9
10
11
F9(xa,xb,xc)=(xa,xb,xc)
F10(xa,xb,xc)=(xa,?,xc)
P
Previous slide
Next slide
Back to first slide
View graphic version