Social Sciences, asked by nirmit1291, 11 months ago

Explain the principal sources of optimization with suitable example.

Answers

Answered by sahanaa30
1

Answer:

PRINCIPAL SOURCES OF. OPTIMISATION

A transformation of a program is called local if it can be performed by looking only at the statements in a basic block; otherwise, it is called global. Many transformations can be performed at both the local and global levels. Local transformations are usually performed first.

Function-Preserving Transformations

  1. There are a number of ways in which a compiler can improve a program without changing the function its computes.
  2. examples:

Common sub expression elimination

Copy propagation,

Dead-code elimination

Constant folding

The other transformations come up primarily when global optimizations are performed.

Frequently, a program will include several calculations of the offset in an array. Some of the duplicate calculations cannot be avoided by the programmer because they lie below the level of detail accessible within the source language.

Similar questions