In a compiler, the term Back End (BE) is sometime confused with code generator for the overlapped functionality of generating assembly code. The work in back end is done in multiple steps:
- Compiler analysis - This is the process to gather program information from the intermediate representation of the input source files.
- Optimization - the intermediate language representation is transformed into functionally equivalent but faster (or smaller) forms.
- Code generation - the transformed intermediate language is translated into the output language, usually the native machine language of the system. This involves resource and storage decisions, such as deciding which variables to fit into registers and memory and the selection and scheduling of appropriate machine instructions along with their associated addressing modes.
In general, the BE of a Language Processor (LP) is the subset of modules that, after the analysis phase, perform transformation that depend on the Intermediate Representation (IR) and not directly on the source tests.