module Index : Identifiable.SThe module
Indexis used to filter and group the generated subranges. Inclusion of a computed subrange in the result is conditional upon the existence of an index that can be associated to it. To give a concrete example, the keys associated to ranges might be pseudoregisters, and the indexes variable names (c.f.Available_ranges_vars). Every register that is not known to hold the value of some variable is dropped from the result.
module Key : sig ... endThe module
Keycorresponds to the identifiers that define the ranges inLinearizeinstructions. Each instruction should have two sets of keys,available_beforeandavailable_across, with accessor functions of these names being provided to retrieve them. The notion of "availability" is not prescribed. The availability sets are used to compute subranges associated to each key.
module Range_info : Compute_ranges_intf.S_range_info with type key := Key.t with type index := Index.tThe module
Range_infois used to store additional information on a range that is associated to a range at its creation and can be retrieved from the result. The association between keys and indices is also done here:Range_info.createserves both as a map between keys and indices; and also as the creator of theRange_info.tstructure. When several subranges are contained in a single range, the associatedRange_info.twill correspond to the first closed subrange.
module Subrange_state : Compute_ranges_intf.S_subrange_stateThe module
Subrange_statedescribes information that needs to be propagated and passed toSubrange_info.create. The state that will be used for subrange creation is the state at the end of the subrange, not at the beginning.
module Subrange_info : Compute_ranges_intf.S_subrange_info with type key := Key.t with type subrange_state := Subrange_state.tThe module
Subrange_infohas a similar purpose toRange_info, but for subranges. Its distinguishing property is that it can store information about its context using the additionalsubrange_stateparameter of itscreatefunction.
val available_before : Compute_ranges_intf.L.instruction -> Key.Set.tHow to retrieve from an instruction those keys that are available immediately before the instruction starts executing.
val available_across : Compute_ranges_intf.L.instruction -> Key.Set.tHow to retrieve from an instruction those keys that are available between the points at which the instruction reads its arguments and writes its results.
val must_restart_ranges_upon_any_change : unit -> boolThis
must_restart_ranges_upon_any_changeboolean exists because some consumers of the range information may require that two subranges are disjoint rather than including one in another. When this function returnstrue, whenever a subrange is opened or closed, all other overlapping subranges will be split in two at the same point.