28.12.11

The Most Basic Classes of Optimizations


  • Simple identity transformations
  • Constant folding
  • Common subexpression elimination
  • Inlining of functions
  • The identity transform is a data transformation that copies the source data into the destination data without change.
  • The identity transformation is considered an essential process in creating a reusable transformation library. By creating a library of variations of the base identity transformation, a variety of data transformation filters can be easily maintained. These filters can be chained together in a format similar to UNIX shell pipes.
That is not the one I am looking for.

(Redirected from Identity transformation)

In mathematics, an identity function, also called identity map or identity transformation, is a functionthat always returns the same value that was used as its argument. In terms of equations, the function is given by f(x) = x.

So, Simple Identity Transformation means the compiler picks up some obvious code/block which could be easily transform to other code but more optimistic.

Constant folding and constant propagation are related compiler optimizations used by many modern compilers. An advanced form of constant propagation known as sparse conditional constant propagation can more accurately propagate constants and simultaneously remove dead code.

Constant folding

Constant folding is the process of simplifying constant expressions at compile time. Terms in constant expressions are typically simple literals, such as the integer 2, but can also be variables whose values are never modified, or variables explicitly marked as constant. Consider the statement: 

i = 320 * 200 * 32;


Most modern compilers would not actually generate two multiply instructions and a store for this statement. Instead, they identify constructs such as these, and substitute the computed values at compile time (in this case, 2,048,000), usually in the intermediate representation (IR) tree.

Common subexpression elimination - Wikipedia, the free encyclopedia
In computer science, common subexpression elimination (CSE) is a compiler optimization that searches for instances of identical expressions (i.e., they all evaluate to the same value), and analyses whether it is worthwhile replacing them with a single variable holding the computed value.

No comments: