Code generation and optimisation (A level Comp)
From WikiTextbook
This is one of the final stages of compilation, where the machine (object) code instructions are created and optimised for use on a specific architecture.
During optimisation:
- Any superfluous commands are removed or replaced
- Any slow commands are replaced with more-efficient ones
For example:
ADD R0, 1
ADD R0, 1
can be changed to
ADD R0, 2
