Expression Transformations
-
Book Excerpt from "Generative AI in C++" (full text online)
-
by David Spuler, Ph.D.
Expression Transformations
Expression-level types of arithmetic improvements on an expression with multiple operations include:
- Constant folding (compile-time precomputation of constant expressions)
- Common subexpression elimination (only computing things once in expressions)
- Algebraic identities in computations
- Type consistency (avoid conversions)