Loop-invariant code motion: Difference between revisions

Content deleted Content added
No edit summary
Tags: Reverted Mobile edit Mobile web edit
Undid revision 1022086390 by 203.144.75.49 (talk)
Line 1:
{{More citations needed|date=January 2021}}
 
In [[computer programming]], '''[[loop-invariant code]]''' consists of statements or expressions (in an [[imperative programming|imperative]] [[programming language]]) which can be moved outside the body of a loop without affecting the semantics of the program. '''Loop-invariant code motion''' (also called '''hoisting''' or '''scalar promotion''') is a [[compiler optimization]] which performs this movement automatically.
 
==Example==