Explain loop-invariant code motion, Computer Engineering

Assignment Help:

Explain briefly Loop-invariant code motion of the commonly used code optimization techniques.

Loop-invariant code motion

If a quantity is calculated inside a loop during iteration and its value is similar for iteration, this can vastly improve efficiency to hoist this outside the loop and calculate its value just once before the loop begins. It is particularly significant with the address-calculation expressions generated through loops over arrays. For accurate implementation, such technique must be utilized with loop inversion, since not all code is safe to be hoisted outside the loop.

For illustration:

 for (i=1; i≤10, i++){

x=y*2-(1)

.

.

.

}

statement 1 can be hoisted outside the loop assuming value of x and y does not modify in the loop.


Related Discussions:- Explain loop-invariant code motion

State the features of pentium series of microprocessors, State the features...

State the features of Pentium series of microprocessors: Pentium is a 32-bit superscalar, CISC microprocessor.  The term superscalar is used for processor that contains more th

Sound and complete, Dictator Dim wants to replace counting, in particular, ...

Dictator Dim wants to replace counting, in particular, counting the population of his land. To keep an accurate population count, Dictator Dim has instructed his secretary to add o

Pre-os and runtime sub-os functionality, In a raw Itanium, a "Processor Abs...

In a raw Itanium, a "Processor Abstraction Layer" (PAL) is integrated into the system. When it is booted the PAL is loaded into the CPU and gives a low-level interface that abstrac

Explain about candidate check, The process which is underlined throughout t...

The process which is underlined throughout the check of base data is called as candidate check. When performing candidate check performance varies either towards the positive side

Dbms, documentation for dbms report

documentation for dbms report

What is a metadata, What is a Metadata?  Metadata is information about ...

What is a Metadata?  Metadata is information about a PE. In COM, metadata is communicated by non-standardized type libraries. In .NET, this data is contained in the header port

What is secondary storage systems, There are various limitations of primary...

There are various limitations of primary memory like limited capacity which is its not enough to store a very large volume of data and volatility which is when power is turned off

What is interpolated resolution, Q. What is Interpolated Resolution? Ev...

Q. What is Interpolated Resolution? Every Scanner is accompanied by a software. This software can raise the apparent resolution of scan by a scheme known as Interpolation.  By

Give the meaning of spc, SPC stands (A)   Standard Protocol Control ...

SPC stands (A)   Standard Protocol Control (B)   Stored Program Control (C)  Signaling and switching Centre (D)  Signaling Process Center Ans: SPC repres

Combinatorial and scheduling problems, Combinatorial and Scheduling Proble...

Combinatorial and Scheduling Problems: One class of problems is concerned with specifying optimal scheduled. A classical example is the Travelling Salesperson Problem where

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd