jon.recoil.org

Module Available_ranges_vars

Given a variable x and a function, an "available subrange" is in the normal case a contiguous subset of that function's code paired with a register r, such that at all times during the block's execution the value of x is available in r. (r may end up being a hard register or a location on the stack.)

Available subranges associated with non-phantom variables are computed by this pass based on the information from the dataflow analysis in Regs. (The linearized code is updated so that it contains the necessary labels for delimiting such ranges.)

An "available range" is then a set of available subranges that do not overlap in code space, again for a single variable and function.

module Subrange_state : sig ... end
module Subrange_info : sig ... end
module Range_info : sig ... end
include Compute_ranges_intf.S with module Index := Backend_var with module Key := Available_ranges_vars.Key with module Subrange_state := Available_ranges_vars.Subrange_state with module Subrange_info := Available_ranges_vars.Subrange_info with module Range_info := Available_ranges_vars.Range_info
module Subrange : sig ... end
module Range : sig ... end
type t

The type holding information on computed ranges.

A value of type t that holds no range information.

Compute ranges for the code in the given linearized function declaration, returning the ranges as a value of type t and the rewritten code that must go forward for emission.

Iterate through ranges. Each range is associated with an index.

val fold : Available_ranges_vars.t -> init:'a -> f:('a -> Backend_var.t -> Available_ranges_vars.Range.t -> 'a) -> 'a

Like iter, but a fold.

Find the range for the given index, or raise an exception.

All indexes for which the given value of type t contains ranges.

val rewrite_labels_and_remove_empty_subranges_and_ranges : Available_ranges_vars.t -> env:Label.t Label.Map.t -> Available_ranges_vars.t

An internal function used by Coalesce_labels. The env should come from Coalesce_labels.fundecl.