
220 An Introduction to Compiler Construction in a Java World
Of course, a redundant Phi function will not be changed. If the w is never modified in the
loop body, the Phi function instruction takes the form
w
2
= [w
1
w
2
]
and can be removed as it is apparent that w has not been changed.
Phi functions are tightly bound to state vectors. When a block is processed:
• If the block has just a single predecessor, then it may inherit the state vector of that
predecessor; the states are simply copied.
• If the block has more than one predecessor, then those states in the vectors that differ
must be merged using Phi functions.
• For loop headers we conservatively