Which intermediate code representation is most suitable for performing local optimizations like constant folding and copy propagation?
14 views
- Abstract Syntax Tree (AST)
- Three-Address Code (TAC) (Correct Answer)
- Syntax Directed Translation (SDT)
- Parse Tree
Explanation
Three-Address Code (TAC) is widely used for local optimizations because each instruction has at most three operands, making constant folding, copy propagation, and strength reduction easier to perform than on AST or Parse Trees.