Dependencies One problem that RISC programmers face is that the processor can be slowed down by a poor choice of instructions. Since each instruction takes some amount of time to store its result, and several instructions are being handled at the same time, later instructions may have to wait for the results of earlier instructions to be stored. Our sample program can be fixed with a few simple adjustments. This program doesn't stall because none of the instructions have to wait for a previous instruction. We've shown a simple example of instruction scheduling.
Sophisticated compilers can apply other optimization techniques to an application.
Instead of executing a sequence of instruction inside a loop, the compiler may replicate the instructions multiple times. This eliminates the overhead of calculating and testing the loop control variable. Compilers also perform function inlining, where a call to a small subroutine is replaced by the code of the subroutine itself. This is only a small sample of the optimizations which are available. Consult a good textbook on compilers for other ideas on how compiled code may be optimized.