constant folding

(redirected from Constant propagation)

constant folding

(compiler)
A compiler optimisation technique where constant subexpressions are evaluated at compile time. This is usually only applied to built-in numerical and boolean operators whereas partial evaluation is more general in that expressions involving user-defined functions may also be evaluated at compile time.
References in periodicals archive ?
Knowing the distribution of the electromagnetic field in the microwave structures makes possible the understanding of the waves' constant propagation, its dependence on frequency, the propagation speed, for the phase and constant attenuation.
It can be tricky and needs constant propagation to keep it going but the scent is well worth the effort.
Thus, if we find, as a result of interprocedural constant propagation, that a conditional branch within a function will always be taken, and there is no other control flow path to the code in the branch that is not taken, then the latter code becomes unreachable and can be eliminated.
3) We carry out interprocedural constant propagation on the resulting control flow graph, as described in Section 2.
The essential idea is to use constant propagation to identify the start address of the jump table, and the bounds check instruction(s) to determine the extent of the jump table.
A performance evaluation of our demand-driven approach is presented for two data flow problems, namely, reaching-definitions and copy constant propagation.
General Terms: Algorithms, Performance, Experimentation Additional Key Words and Phrases: Copy constant propagation, data flow analysis, def-use chains, demand-driven algorithms, distributive data flow frameworks, interprocedural data flow analysis, program optimizations
Likewise, although Gospel can be used to specify a type of constant propagation and folding, it cannot be used, for example, to specify constant propagation transformations requiring fix-point computation.
Figure 2 presents a Gospel specification of a Constant Propagation transformation (CTP) (see Section 3.

Full browser ?