Redundant (Common) Subexpression Elimination

Global Constant Folding and Propagation

Dead Code Elimination

Conditional Pruning

Conditional Reordering

Assignment Elimination Due to Equality

GOTO Chasing

Array Temporary Elimination

10.3.2 Global Constant Folding and Propagation

From reaching definitions, a use-definition chain, ud-chain, can be constructed. This is a list of variable definitions linked with their uses. Within a block, a definition is matched to its subsequent use. If there is no definition within the block, then all definitions which reach the block are matched with the use.

The ud-chain may be used for constant propagation.

    This can be optimized still further with an algebraic substitution and a dead code elimination. The result is shown in Example 14.