jon.recoil.org

Module Flambda2_simplify.Upwards_acc

type t
val print : Format.formatter -> t -> unit

Print a upwards accumulator to a formatter.

val create : flow_result:Flow_types.Flow_result.t -> compute_slot_offsets:bool -> Upwards_env.t -> Downwards_acc.t -> t
val creation_dacc : t -> Downwards_acc.t
val uenv : t -> Upwards_env.t

Extract the environment component of the given upwards accumulator.

val cost_metrics : t -> Flambda2_terms.Cost_metrics.t
val code_age_relation : t -> Flambda2_types.Code_age_relation.t
val lifted_constants : t -> Lifted_constant_state.t

Return the lifted constants that still need to be placed (i.e. have Let-expressions made for them) on the upwards traversal.

val get_and_clear_lifted_constants : t -> t * Lifted_constant_state.t
val with_lifted_constants : t -> Lifted_constant_state.t -> t

Replace the accumulator of lifted constants.

val no_lifted_constants : t -> bool
val add_lifted_constant : t -> Lifted_constant.t -> t
val map_uenv : t -> f:(Upwards_env.t -> Upwards_env.t) -> t

Map the environment component of the given upwards accumulator.

val with_uenv : t -> Upwards_env.t -> t

Replace the environment component of the given upwards accumulator.

val name_occurrences : t -> Flambda2_nominal.Name_occurrences.t
val with_name_occurrences : t -> name_occurrences:Flambda2_nominal.Name_occurrences.t -> t
val clear_name_occurrences : t -> t
val add_free_names : t -> Flambda2_nominal.Name_occurrences.t -> t
val used_value_slots : t -> Flambda2_nominal.Name_occurrences.t

Note that this only includes uses of value slots in projections.

val remove_all_occurrences_of_free_names : t -> Flambda2_nominal.Name_occurrences.t -> t
val clear_cost_metrics : t -> t
val with_cost_metrics : Flambda2_terms.Cost_metrics.t -> t -> t
val add_cost_metrics : Flambda2_terms.Cost_metrics.t -> t -> t
val add_cost_metrics_and_with_name_occurrences : t -> Flambda2_terms.Cost_metrics.t -> Flambda2_nominal.Name_occurrences.t -> t

This function exists as an optimisation to reduce allocation.

val notify_added : code_size:Flambda2_terms.Code_size.t -> t -> t
val notify_removed : operation:Flambda2_terms.Removed_operations.t -> t -> t
val generate_phantom_lets : t -> bool
val is_demoted_exn_handler : t -> Flambda2_identifiers.Continuation.t -> bool
val required_names : t -> Flambda2_identifiers.Name.Set.t
val continuation_param_aliases : t -> Flow_types.Alias_result.t
val mutable_unboxing_result : t -> Flow_types.Mutable_unboxing_result.t
val set_resimplify : t -> t
val resimplify : t -> bool