Алгоритмы, структуры данных

5c8b6e8c

Исходный алгоритм


&#8704 t &#8712 tuples lattice(t) = T unvisited(t) = true

Visit all basic blocks B in the program Visit all tuples t within B if unvisited(t) then propagate(t)

propagate (tuple t) unvisited(t) = false if ssa_link(t) ? 0 then if unvisited(ssa_link(t)) then propagate(ssa_link(t)) lattice(t) = lattice(t) П lattice(ssa_link(t)) endif if unvisited(left(t)) then propagate(left(t)) if unvisited(right(t)) then propagate(right(t)) case on type (t) constant C: lattice(t) = C arithmetic operation: if all operands have constant lattice value then lattice(t) = arithmetic result of lattice values of operands else lattice(t) = &#8869 endif store: lattice(t) = lattice(RHS) &#966-function: lattice(t) = П of &#966-arguments of t ?-function: if lattice(predicate) = C then lattice(t) = lattice value of ?-argument corresponding to C else lattice(t) = П of all ?-arguments of t endif ?-function: lattice(t) = &#8869 &#951-function: lattice(t) = lattice(&#951-argument) default: lattice(t) = &#8869 end case end propagate



Содержание раздела