Compiler Design
Code Generation & Optimization
GATE 2008
Medium
Some code optimizations are carried out on the intermediate code because
- they enhance the portability of the compiler to other target processors
- Bprogram analysis is more accurate on intermediate code than on machine code
- Cthe information from dataflow analysis cannot otherwise be used for optimization
- Dthe information from the front end cannot otherwise be used for optimization
Explanation
Performing optimizations at the machine-independent intermediate-code level (rather than on final machine code) keeps the optimizer reusable across different target architectures — enhancing the compiler's portability, since only the code generator (not the optimizer) needs to be rewritten per target.
Source: GATE CS 2008 (2008)
This question is part of a 15-day revision cycle — sign in and Project Forge will bring it back the day before you'd forget it.