Common subexpression elimination
The removal of common subexpressions (English common subexpression elimination ) describes a compiler optimization. It is this search for subexpressions that have previously been computed. If these are found, the previous result is stored in a variable and the repeated calculation replaced by the variable.
Example
The following program section, the value of a * b * is calculated twice,
X = a * b c; y = a * b d; The CSE transforms the section then so that the first result is cached:
_tmp = a * b; x = _tmp c; y = _tmp d; References
- Compiler
- Compiler optimization