This is the sort of thing we do in HFT to get single instruction calls and save nanos in places that get called many many thousands of times a second.
Most of the code doesn't need nearly that level of optimization, so you write it in a higher level language.
Making your own compiler is a lot of work compared to just doing what I've outlined above. So you don't. I's not worth it, and you'd still end up back where you are.