Canonicalization (IR)
Rewriting equivalent expressions in the intermediate representation into a single preferred form, so later optimizations only have to recognise one variant.
The same computation can be spelled many ways: 5 + x, x + 5, x - (-5). A pattern-matching optimization would otherwise have to know every spelling, and the number of combinations multiplies quickly. LLVM's InstCombine settles it by fiat: constants go on the right of commutative operations, subtracting a constant becomes adding its negation, and loops are normalised to have a preheader and a single back edge. MLIR made it an explicit kind of pass, canonicalize, that every operation can hook into.
The canonical form is chosen to be easy to analyse, not fast to run. That is why the backend sometimes translates back into something canonicalization just removed — and why tweaking the rules can produce wins and regressions in entirely unrelated corners of the compiler.