While changes occur do
for all the stmts S of the program do
for each operand B of S do
if there is a unique definition of B
that reaches S and is a constant C
then replace B by C in S;
if all the operands of S are constant
then replace rhs by eval(rhs);
endfor
endfor
endwhile