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

Illustration of a memory organization, Q. Illustration of a memory organiza...

Q. Illustration of a memory organization? Let's consider an illustration of a memory organization as displayed in Figure below in that main memory can store 32K words of 12 b

Explain the term overlays, Explain the term Overlays. An overlay is an ...

Explain the term Overlays. An overlay is an element of program that has the same load origin as several other part of the program. These are used for reduce the main memory req

Specifying optimisation criteria of describe function, Specifying Optimisat...

Specifying Optimisation Criteria Specify values to be minimized, maximized or optimized. You can understand it as way you normalize data in database. For instance, you should

Kirchoff''s laws, i want to make an assignment about kirchoff''s law

i want to make an assignment about kirchoff''s law

Determine through which symbolic names can be associated, Determine Symboli...

Determine Symbolic names can be associated with Symbolic names can be associated with the data or instruction

What is synchronous transmission, What is synchronous transmission? In ...

What is synchronous transmission? In synchronous transmission the two units share a common frequency and bits are transmitted continuously at the rate dictated  by clock pulses

Hard disk technology - computer architecture, Hard Disk Technology: Fi...

Hard Disk Technology: Figure of a computer hard disk drive           HDDs record data by magnetizing ferromagnetic material directionally, to represent

The goal of hashing, The goal of hashing is to produce a search that takes ...

The goal of hashing is to produce a search that takes   O(1) time

TIME COMPLEXITY, calculate the time complexity of a=(b/c) operation in stac...

calculate the time complexity of a=(b/c) operation in stack

write a ''c'' program to accept any 3 digit integer number, Write a 'C' pr...

Write a 'C' program to accept any 3 digit integer number from the keyboard and display the word equivalent representation of the given number

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