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 Key : Compute_ranges_intf.S_key with type t = Reg_with_debug_info.tmodule Subrange_state : sig ... endmodule Subrange_info : sig ... endmodule Range_info : sig ... endinclude 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 ... endmodule Range : sig ... endval print : Stdlib.Format.formatter -> Available_ranges_vars.t -> unitval empty : Available_ranges_vars.tA value of type t that holds no range information.
val create :
ppf_dump:Stdlib.Format.formatter ->
Linear.fundecl ->
Available_ranges_vars.t * Linear.fundeclCompute 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.
val iter :
Available_ranges_vars.t ->
f:(Backend_var.t -> Available_ranges_vars.Range.t -> unit) ->
unitIterate 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) ->
'aLike iter, but a fold.
val find :
Available_ranges_vars.t ->
Backend_var.t ->
Available_ranges_vars.Range.tFind the range for the given index, or raise an exception.
val all_indexes : Available_ranges_vars.t -> Backend_var.Set.tAll 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.tAn internal function used by Coalesce_labels. The env should come from Coalesce_labels.fundecl.