jon.recoil.org

Module Flambda2_simplify.Downwards_acc

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

Print a downwards accumulator to a formatter.

val denv : t -> Downwards_env.t

Extract the environment component of the given downwards accumulator.

val map_denv : t -> f:(Downwards_env.t -> Downwards_env.t) -> t

Map the environment component of the given downwards accumulator.

val with_denv : t -> Downwards_env.t -> t

Replace the environment component of the given downwards accumulator.

val flow_acc : t -> Flow.Acc.t

Extract the dataflow analysis accumulator

val with_flow_acc : Flow.Acc.t -> t -> t

MSet the dataflow analysis accumulator of the given dacc.

val map_flow_acc : t -> f:(Flow.Acc.t -> Flow.Acc.t) -> t

Map the dataflow analysis accumulator of the given dacc.

include Continuation_uses_env_intf.S with type t := t

We don't have an interface that insists on adding continuations before seeing their uses. This would be problematic when inserting wrappers, where we have already advanced past the point at which such wrappers would need to be defined, before knowing that a wrapper is needed.

val delete_continuation_uses : t -> Flambda2_identifiers.Continuation.t -> t
val get_typing_env_no_more_than_one_use : t -> Flambda2_identifiers.Continuation.t -> Flambda2_types.Typing_env.t option
val num_continuation_uses : t -> Flambda2_identifiers.Continuation.t -> int
val all_continuations_used : t -> Flambda2_identifiers.Continuation.Set.t
val continuation_uses_env : t -> Continuation_uses_env.t
val with_continuation_uses_env : t -> cont_uses_env:Continuation_uses_env.t -> t
val demote_exn_handler : t -> Flambda2_identifiers.Continuation.t -> t

Mark that an exception handler continuation should be converted to a normal continuation. This is used when turning local exceptions into jumps.

val demoted_exn_handlers : t -> Flambda2_identifiers.Continuation.Set.t
val code_age_relation : t -> Flambda2_types.Code_age_relation.t
val with_code_age_relation : t -> code_age_relation:Flambda2_types.Code_age_relation.t -> t
val typing_env : t -> Flambda2_types.Typing_env.t
val no_lifted_constants : t -> bool
val add_to_lifted_constant_accumulator : ?also_add_to_env:unit -> t -> Lifted_constant_state.t -> t
val get_lifted_constants : t -> Lifted_constant_state.t
val get_and_clear_lifted_constants : t -> t * Lifted_constant_state.t
val clear_lifted_constants : t -> t
val set_lifted_constants : t -> Lifted_constant_state.t -> t
val find_shareable_constant : t -> Flambda2_terms.Static_const.t -> Flambda2_identifiers.Symbol.t option
val consider_constant_for_sharing : t -> Flambda2_identifiers.Symbol.t -> Flambda2_terms.Static_const.t -> t
val with_shareable_constants : t -> shareable_constants: Flambda2_identifiers.Symbol.t Flambda2_terms.Static_const.Map.t -> t
val add_use_of_value_slot : t -> Flambda2_identifiers.Value_slot.t -> t
val used_value_slots : t -> Flambda2_nominal.Name_occurrences.t
val with_used_value_slots : t -> used_value_slots:Flambda2_nominal.Name_occurrences.t -> t
val add_code_ids_to_remember : t -> Flambda2_identifiers.Code_id.Set.t -> t
val code_ids_to_remember : t -> Flambda2_identifiers.Code_id.Set.t
val with_code_ids_to_remember : t -> code_ids_to_remember:Flambda2_identifiers.Code_id.Set.t -> t
val add_code_ids_to_never_delete : t -> Flambda2_identifiers.Code_id.Set.t -> t
val code_ids_to_never_delete : t -> Flambda2_identifiers.Code_id.Set.t
val with_code_ids_to_never_delete : t -> code_ids_to_never_delete:Flambda2_identifiers.Code_id.Set.t -> t
val add_code_ids_never_simplified : t -> old_code_ids:Flambda2_identifiers.Code_id.Set.t -> t
val code_ids_never_simplified : t -> Flambda2_identifiers.Code_id.Set.t
val with_code_ids_never_simplified : t -> code_ids_never_simplified:Flambda2_identifiers.Code_id.Set.t -> t
val merge_debuginfo_rewrite : t -> bound_to:Flambda2_term_basics.Simple.t -> Debuginfo.t -> t
val find_debuginfo_rewrite : t -> bound_to:Flambda2_term_basics.Simple.t -> Debuginfo.t option
val are_lifting_conts : t -> Are_lifting_conts.t
val with_are_lifting_conts : t -> Are_lifting_conts.t -> t
val get_and_clear_lifted_continuations : t -> t * (Downwards_env.t * Original_handlers.t) list
val add_lifted_continuation : Downwards_env.t -> Original_handlers.t -> t -> t
val get_continuation_lifting_budget : t -> int
val reset_continuation_lifting_budget : t -> t
val with_continuation_lifting_budget : t -> int -> t
val decrease_continuation_lifting_budget : t -> int -> t
val get_continuation_specialization_budget : t -> int
val reset_continuation_specialization_budget : t -> t
val with_continuation_specialization_budget : t -> int -> t
val decrease_continuation_specialization_budget : t -> int -> t
val prepare_for_speculative_inlining : t -> t
val continuations_to_specialize : t -> Flambda2_identifiers.Continuation.Set.t
val add_continuation_to_specialize : t -> Flambda2_identifiers.Continuation.t -> t