Intermediate representations of computer code are efficiently generated.
More particularly, methods described herein may be used to construct a
static single assignment representation of computer code without
unnecessary phi-function nodes. Potentially necessary phi-function node
assignments may be analyzed to determine whether they directly reach a
non-phi use or a necessary phi-use of a corresponding variable. Those
that ultimately reach such a use may be determined to be necessary and a
pruned static single assignment may be constructed by including those
potentially necessary phi-functions determined to be in fact necessary.
Also, some phi-function nodes may be determined to be necessary based on
their dependency relationship to other phi-functions previously
determined to be necessary (e.g., because they directly reach a non-phi
use). A phi-function dependency graph may be used to record dependency
relationships between phi-function nodes. The analysis can proceed during
a forward walk of a control flow representation of the program.