Explain the various code improving transformation techniques.

Simply stated, the best program transformations are those that yield the most benefit for the least effort. First, the transformation must preserve the meaning of programs. That is the optimization must not change the output produced by a program for a given input or cause an error. Second a transformation must on the average speed up programs by a measurable amount.

Third the transformation must be worth the effort. Some transformations can only be applied after detailed often time-consuming analysis of the source program so there is little point in applying them to programs that will be run only a few times.

Code Improvement Criteria

  • A transformation must preserve meaning of a program (correctness).
  • A transformation must improve (e.g., speed-up) programs by a measurable amount on average.
  • A transformation must worth the effort indicate the places for potential improvements can be made by the user and the compiler. Programmer.
  • Profiles, change algorithm, transform loops.
  • Compiler :(on intermediate code).
  • Improve loops, procedure calls, various transformation.
  • Use of registers, instruction selection, peephole optimization.

Leave a Reply