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

How a typical dma controller can be interfaced to an 8086, Demonstrate how ...

Demonstrate how a typical DMA controller can be interfaced to an 8086/8085 based maximum mode system.  For 8088 in maximum mode: The RQ/GT0 and RQ/GT1 pins are used to is

Define syntax of mpi_scatter function, Q. Define syntax of MPI_Scatter func...

Q. Define syntax of MPI_Scatter function? MPI_Scatter(Sendaddr, Scount, Sdatatype, Receiveaddr, Rcount, Rdatatype, Rank, Comm): 'Using this function process with rank' ran

Protocols and services on internet, To work with Internet as well as to uti...

To work with Internet as well as to utilize its facilities we use certain tools. For illustration, Telnet is a tool, which is utilized for logging on remote computers on the Intern

Explain the benefits of interpreter, Explain the Benefits of Interpreter? ...

Explain the Benefits of Interpreter? The benefit of an interpreter though is that it doesn't need to go through the compilation stage during which machine instructions are gene

Which scheduling is suitable for time-shared operatin system, Which schedul...

Which scheduling policy is most suitable for a time-shared operating system? Ans. Round-Robin scheduling policy is most appropriate for a time-shared operating system.

What are the basic functions of database utility, What are the basic functi...

What are the basic functions of Database utility? The basic features of database utility are: Make database objects. Remove database objects. Adjust database obj

Does c have circular shift operators, No C don't have circular shift operat...

No C don't have circular shift operator. (Part of the reason why that is the sizes of C's types aren't precisely described----but a circular shift makes most sense when applied to

. net is compile time or runtime environment, . NET is Compile Time OR RunT...

. NET is Compile Time OR RunTime Environment?   .Net's framework has CLS,CTS and CLR.CTS checks declaration of types at the time when u write code and CLS explains some rules a

Discuss the advantages of store program control, Discuss the advantages of ...

Discuss the advantages of store program control (SPC) automation in telephone switching. Advantages of SPC: (i) Simple to control (ii) Simple to maintain (iii) Fine-

What are escape sequences characters, What are escape sequences characters?...

What are escape sequences characters? List any six of them.  The characters which when used with output functions like printf( ),putc(),put() etc. helps in formatting the outpu

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