\begin{algorithm} \caption{May-Forward-Analysis-Worklist} \begin{algorithmic} \INPUT CFG ($kill_B$ and $gen_B$ computed for each basic block $B$) \OUTPUT $IN[B]$ and $OUT[B]$ for each basic block $B$ \STATE $OUT[ENTRY] = \empty$ \FOR{\textbf{each} basic block $B\in V(CFG) - \{ENTRY\}$} \STATE $OUT[B] = \empty$ \ENDFOR \STATE Let $Worklist$ be a \textbf{Set} of all basic blocks. \WHILE{$Worklist$ \textbf{is} \NOT empty} \STATE Pick a basic block $B$ from $Worklist$. \STATE $temp = OUT[B]$ \STATE $IN[B] = \bigcup\limits_{P\in pre(B)} OUT[P]$ \STATE $OUT[B] = gen_B\cup (IN[B] - kill_B)$ \IF{$temp \ne OUT[B]$} \STATE Add all successors of $B$ to $Worklist$. \ENDIF \ENDWHILE \end{algorithmic} \end{algorithm}