Expand description

Calculate the reaching definitions in a control program.

Structs

A datastructure used to represent a set of definitions/uses. These are represented as pairs of (Id, GroupOrInvoke) where the Id is the identifier being defined, and the second term represents the defining location (or use location). In the case of a group, this location is just the group Id. In the case of an invoke the “location” is a unique label assigned to each invoke statement that beings with the INVOKE_PREFIX.
A struct used to compute a reaching definition analysis. The only field is a map between GroupOrInvoke labels and the definitions that exit the given group or the given Invoke node. This analysis is conservative and will only kill a definition if the group MUST write the given register and does not read it. If this is not the case old definitions will remain in the reaching set as we cannot be certain that they have been killed.

Enums

A wrapper enum to distinguish between Ids that come from groups and ids that were fabricated during the analysis for individual invoke statements. This prevents attempting to look up the ids used for the invoke statements as there will be no corresponding group.