21-08-2014, 03:31 PM
New trends and Challenges in Source Code Optimization
New trends.pptx (Size: 200.92 KB / Downloads: 8)
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.
Peephole Optimization
The peephole optimization uses an alternative strategy. They generate naïve code and then improve the quality of the target code by applying optimization transformations to the target program.
The peephole optimization technique attempts to improve the target code by examining a sliding window of target instructions (called the peephole) and then replacing instructions within the peephole by a shorter or faster sequence, whenever possible.
The peephole is a small, sliding window on a program. The code in the peephole need not be contiguous.
The peephole optimizations can also be applied directly after intermediate code generation to improve the intermediate representation.
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.