Hot/cold splitting
Moving rarely executed code — error handling, logging, unusual branches — away from the code that actually runs, so the instruction cache holds only what's needed.
A function with a short fast path and fifty lines of error handling takes up more cache than it deserves, because the CPU fetches whole cache lines regardless of which instructions execute. Karl Pettis and Robert Hansen at HP showed in 1990 that splitting and reordering code by profile data paid off measurably. Today GCC puts cold code in its own section such as .text.unlikely, and LLVM gained a dedicated pass that outlines cold regions into separate functions.
The compiler has to know what's cold. That comes from profile-guided optimization, from heuristics (a branch ending in abort is hardly hot) or from the programmer via __builtin_expect and C++20's [[unlikely]]. The gains rarely show in microbenchmarks, where everything fits in cache, and mostly appear in large server programs whose code dwarfs it.