andreinaku / SpyType

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

implement worklist algorithm

andreinaku opened this issue · comments

Flemming Nielson - page 73

for a little help, check out the following link: https://www.cs.cornell.edu/courses/cs6120/2020fa/lesson/4/
there is the following algorithm summarized here:

in[entry] = init
out[*] = init

worklist = all blocks
while worklist is not empty:
    b = pick any block from worklist
    in[b] = merge(out[p] for every predecessor p of b)
    out[b] = transfer(b, in[b])
    if out[b] changed:
        worklist += successors of b