In my experience, compilers are very good at this.