Module Flambda2_simplify.Common_subexpression_elimination
Maintenance of environments and associated calculations for common subexpression elimination, performed during Simplify.
module EPA = Flambda2_simplify.Continuation_extra_params_and_argsmodule P = Flambda2_terms.Flambda_primitivemodule RI = Flambda2_identifiers.Apply_cont_rewrite_idmodule T = Flambda2_typesmodule TE = Flambda2_types.Typing_envmodule TEE = Flambda2_types.Typing_env_extensionval print :
Stdlib.Format.formatter ->
Flambda2_simplify.Common_subexpression_elimination.t ->
unitval add :
Flambda2_simplify.Common_subexpression_elimination.t ->
P.Eligible_for_cse.t ->
bound_to:Flambda2_term_basics.Simple.t ->
Flambda2_term_basics.Scope.t ->
Flambda2_simplify.Common_subexpression_elimination.tIf the t already has an equation for the given primitive, then add does nothing. (Expected usage is that this will correspond to outermost bindings taking precedence, but for simplicity, this function does not enforce that.)
val find :
Flambda2_simplify.Common_subexpression_elimination.t ->
P.Eligible_for_cse.t ->
Flambda2_term_basics.Simple.t optionmodule Join_result : sig ... endval join :
typing_env_at_fork:TE.t ->
cse_at_fork:Flambda2_simplify.Common_subexpression_elimination.t ->
use_info:'a list ->
get_typing_env:('a -> TE.t) ->
get_rewrite_id:('a -> RI.t) ->
get_cse:('a -> Flambda2_simplify.Common_subexpression_elimination.t) ->
params:Flambda2_bound_identifiers.Bound_parameters.t ->
Flambda2_simplify.Common_subexpression_elimination.Join_result.t optionjoin adds CSE equations into cse_at_fork at the next scope level after that given by the typing_env_at_fork.