Clever Geek Handbook
📜 ⬆️ ⬇️

Cycle inversion

Loop inversion ( eng. Loop inversion ) - compiler optimization and loop transformation, during which the While-loop replaced by a branch operator containing the Do-While-cycle . When used properly, this optimization improves performance through pipelining .

C Example

For example, the following code:

  int i , a [ 100 ];
   i = 0 ;
   while ( i < 100 ) {
     a [ i ] = 0 ;
     i ++ ;
   }

as a result of the application of optimization is converted to:

  int i , a [ 100 ];
   i = 0 ;
   if ( i < 100 ) {
     do {
       a [ i ] = 0 ;
       i ++ ;
     } while ( i < 100 );
   }

Notes

Literature

  • Alfred Aho, Monica Lam, Ravi Seti, Jeffrey Ulman. Compilers: principles, technologies and tools = Compilers: Principles, Techniques, and Tools. - 2nd edition. - M .: “Williams”, 2008. - 1184 p. - 1500 copies - ISBN 978-5-8459-1349-4 .
  • Steven S. Muchnick. Advanced Compiler Design and Implementation. - 5th edition. - San Francisco: Morgan Kaufmann Publishers , 1997. - 856 p. - ISBN 1-55860-320-4 .
  • Kennedy, Ken; & Allen, Randy. Optimizing Compilers for Modern Architectures: A Dependence-based Approach. - Morgan Kaufmann, 2001. - ISBN 1-55860-286-0 .
Source - https://ru.wikipedia.org/w/index.php?title=Inversion_ cycle &oldid = 55574019


More articles:

  • Upitis, Peteris (graph)
  • Sound Normalizer
  • Mughrabi Bridge
  • Volchik, Vladimir Mikhailovich
  • Kirsanovka (Voronezh region)
  • Cosmos-197
  • Melentyevsky
  • Wikipedia
  • Kreps, Evgeny Mikhailovich
  • Bootes II

All articles

Clever Geek | 2019