Perform more optimizations to unroll small loops