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

Explain working of bit serial associative processor, Q. Explain working of ...

Q. Explain working of Bit Serial Associative Processor? When associative processor accepts bit serial memory organization subsequently it is known as bit serial associative pr

Design a memory buffer of limited size, Extend task 1 so that it now suppor...

Extend task 1 so that it now supports a memory buffer of limited size. Provide the same functionality as task 1 except now make the server work with a limited buffer size. Like

What is the pcm pulse or symbol transmission rate, An analog information si...

An analog information signal, whose maximum frequency is 6000Hz, is to be transmitted using a PCM system. The quantization error must not exceed the ±1 % of the peak-topeak analog

What are value types and reference types, What are value types and referenc...

What are value types and reference types?  Value type - bool, byte, chat, decimal, double, enum, float, int, long, sbyte, short, strut, uint, ulong, ushort. Value types are sto

Illustrate the state diagrams of dynamic modelling, Dynamic modelling: stat...

Dynamic modelling: state diagrams A state diagrams allow you to further explore operations and attributes which need to be defined for an object. They comprises of sets of sta

What is disadvantage of distributed systems, What is disadvantage of Dis...

What is disadvantage of Distributed systems? Ans. Reliability is disadvantage of Distributed system.

When the get cursor command used in interactive lists, When the get cursor ...

When the get cursor command used in interactive lists? If the hidden information is not enough to uniquely recognize the selected line, the command GET CURSOR is used.  The GET

Explain what is the difference among isr & function call, In ISR there is n...

In ISR there is no return value but in function call there is return value

Programmed input - output technique for computers, Q. Programmed input - ou...

Q. Programmed input - output technique for computers? Programmed input/output is a useful I/O technique for computers where hardware costs need to be minimised. Input or output

How to manage the web based projects, How to manage the web based projects?...

How to manage the web based projects? Many project management applications contain additional functions useful in the management of group projects. These features may contain g

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