The Middle End of a compiler is the stage where the code is represented in an intermediate form (Intermediate Representation) and architecture-independent optimizations are performed.
Key activities in this stage include:
- optimizations: Such as dead code elimination, devirtualization, and function inlining.
- Escape Analysis: Determining if variables can be stack-allocated or must escape to the heap.
- Walk (Compiler): The final pass over the AST before the back end, which includes Desugaring complex statements into simpler ones.
