Sparse conditional constant propagation

In computer science, sparse conditional constant propagation (SCCP) is an optimization frequently applied in compilers after conversion to static single assignment form (SSA).

[1][2] The algorithm operates by performing abstract interpretation of the code in SSA form.

It may be the case that the values are perfectly precise (neither top nor bottom) and hence, abstract execution can decide in which direction to branch.

If the values are not constant, or a variable in the condition is undefined, then both branch directions must be taken to remain conservative.

SSA variables found to have constant values may then be inlined at (propagated to) their point of use.