> For the complete documentation index, see [llms.txt](https://isubasinghe.gitbook.io/isithas-wiki/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://isubasinghe.gitbook.io/isithas-wiki/computer_science/programming_language_theory/optimisations.md).

# optimisations

## Basic idea

Semantics-preserving program transformations that make code run faster or smaller. Classical optimisations operate on basic blocks or control-flow graphs and are framed as data-flow analyses.

## Key facts

* Data-flow analyses solve fixpoints over a lattice on the CFG.
* Common: constant propagation, dead-code elimination, CSE, loop-invariant code motion, inlining, peephole.
* SSA form makes most of these one-pass and local.
