Escape analysis
The analysis that determines whether a reference to an object can leave the function or thread that created it.
If nothing "escapes", the object has no business on the heap. The compiler can put it on the stack instead, or break it into loose fields that live in registers — scalar replacement. An object no other thread can ever see needs no locking either, so synchronisation can be removed altogether.
In Java the main win is less pressure on the garbage collector; HotSpot has had the analysis on by default since 2010. In Go it is more visible: go build -gcflags=-m prints "escapes to heap" for every variable that didn't make it, and a good share of performance work consists of reading that list. The analysis is conservative and improves a lot after inlining, because a call into unknown code counts as an escape.