Scalar replacement does not work even in very trivial cases: https://pkolaczk.github.io/overhead-of-optional/
In all those cases, Optionals were inlined, didn't escape, yet they haven't been properly optimized out.
In all those cases, Optionals were inlined, didn't escape, yet they haven't been properly optimized out.