Moving loop induction variable calculation to the head of loop.