Extend IR instruction set:
- Add
OP_PHI operation type
- Phi instruction format:
result = φ(arg1, arg2, ..., argN)
Phi-node placement algorithm:
- Compute dominance frontier for each basic block
- Insert phi-nodes at join points where variables merge
- Handle multiple variables and multiple predecessors