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

Where the trunks lines are run between, Trunks are the lines that run betwe...

Trunks are the lines that run between (A)  Subscribers and exchange (B)  Switching system and power plant (C) Local area network (D) Switching stations Ans:

I2c protocol bus , I²C TECHNOLOGIES The I2C protocol bus is two bi-dire...

I²C TECHNOLOGIES The I2C protocol bus is two bi-directional wires, serial data (SDA) and serial clock (SCL), that transmit information between the devices connected to the bus.

Explain XLAT instruction with help of example, Q. Explain XLAT instruction ...

Q. Explain XLAT instruction with help of example? Let's presume a table of hexadecimal characters signifying all 16 hexadecimal digits in table: HEXA      DB      '012345678

What is the function of alu, What is the function of ALU? Most of the c...

What is the function of ALU? Most of the computer operations (arithmetic and logic) are performed in ALU. The data needed for the operation is brought by the processor and the

Explain dial tone and ringing tone in strowger telephony, Explain Dial Tone...

Explain Dial Tone and Ringing Tone in strowger telephony. Dial Tone: it is used to indicate that the exchange is ready to recognize dialed digits by the subscriber. The subsc

Tag do you use to add a hyperlink column to the DataGrid, What tag do you u...

What tag do you use to add a hyperlink column to the DataGrid?   Anchor tag is used to add a hyperlink column to the data grid

Explain the logic symbols - flip flops, Explain the Logic symbols - Flip Fl...

Explain the Logic symbols - Flip Flops? These flip-flops are as well called Master-Slave flip-flops simply because their internal construction is divided into two sections. Th

Explain the term thread scheduling, Problem: a) Most RMI and RPC system...

Problem: a) Most RMI and RPC systems expect to be supported by the "Request-Reply Protocol". Describe what "Request-Reply Protocol" is. b) Describe the invocation semantics

Intentional hacking helps in maintaining better security, Intentional hacki...

Intentional hacking helps in maintaining better security Several companies employ professionals as security specialists whose basic job is to detect and cover loopholes in t

E-r diagrams, for ticket reservation in trains for payroll processing for i...

for ticket reservation in trains for payroll processing for insurance database

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