Actually I do have dynamic pessimizations steps in my compiler.
It's done when boxing raw stack values back into typed heap values. A series of ops acting on typed values might be faster with the unboxed variants, but only if all ops exist to work with unboxed values. If not, we need to pessimize back into boxed values.
Don’t Box Me In (feat. Stan Ridgway) Stewart Copeland https://youtu.be/8j6Tln0lN0c