Write short notes on Loop optimization

1 min read In Compiler Design

Loop optimization : most of the execution time of a scientific program spent on loops. The running lime of program may he improved we o o of the followin

1 Decrease the number of Malmo-Ms in the inner loops.

2. Increase the number of statements In the outer loops. The loop optimization aims to mitihnize the time spent in the loop, often by reducing the number of operations In the loop.

The different loop optimizations that can be applied to a loop are:

  1. Move loop.invariants. A loop-invariant is a computation that yields the same result independent of the toucher of times through the loop. Such computation should be moved out of the loop so that the resulting code is optimized.
  2. Elimination of induction variables.
  3. Reduction in strength.
  4. Loop unrolling.
  5. Looop jamming.
Written by

Asheesh Gupta

Asheesh Gupta is a digital marketer, blogger, and developer helping individuals and businesses grow online through SEO, tools, and modern web solutions since 2014.

Leave a Reply

Your email address will not be published. Required fields are marked *