25-08-2014, 02:54 PM
New trends and Challenges in Source Code Optimization
New trends.pptx (Size: 200.92 KB / Downloads: 11)
Introduction
Optimization is the process of transforming a piece of source code to produce more efficient (in terms of time and space ) target code.
The front end of the compiler transforms the source code into an intermediate representation which is then improved by the code optimizer to produce better target code.
Optimization is generally implemented using a set of optimizing transformations, i.e., algorithms which take a program and transform it to produce a semantically equivalent output program that uses fewer resources.
Local Optimization
Local optimization is performed within each basic block.
We can often obtain a substantial improvement in the running time of code by performing local optimization within each basic block by itself.
Since basic blocks have no control flow, these optimizations need little analysis.
Local Optimization
The leaders are instructions 1,2,3,10,12 and 13.
The basic block of each leader contains all the instructions from itself until just before the next leader.
Thus, the basic block of 1 is just 1; for leader 2 the basic block is just 2. Leader 3 has a basic block consisting of instructions 3 through 9,inclusive. Instruction 10’s block is 10 and 11; instruction 12’s block is just 12, and instruction 13’s block is 13 through 17.
Inter-Procedural Optimization :
Inter-procedural optimization (IPO) differs from other optimization techniques because it analyses the entire program, whereas other optimizations look at only a single function, or even a single block of code.
Inter-procedural optimization (IPO) techniques attempts to improve performance in programs containing many frequently used functions of small or medium length.
IPO seeks to reduce or eliminate duplicate calculations, inefficient use of memory, and to simplify iterative sequences such as loops. If there is a call to another routine that occurs within a loop, IPO analysis may determine that it is best to inline that. Additionally, IPO may re- order the routines for better memory utilization and locality.
Conclusion:
Since code optimization is a field of broad research, it is not possible to cover all aspects of code optimization in a seminar paper.
However, we have tried our best to cover the aspects in code optimization.