jon.recoil.org

Module Flambda2_simplify.Are_lifting_conts

ontinuation Lifting Status

Continuation lifting is done in simplify on the way down. Considering a term of the form:

* let_cont k x = * let_cont k' y = * ... * in * .. * in * ..

The decision to lift continuations (e.g. k') out of another (e.g. k), is made once Simplify has reached the bottom of the handler of k **but** has not yet explored the handler of k'. The t type represente the current decision about lifting of continuations:

See occurrences of the constructors in simplify_let_cont_expr and the associated comments for more details.

1: typically when we simplify leafs of expressions, so mostly in simplify_switch because that will be the interesting case for the match-in-match optimisation.

type t = private
  1. | Not_lifting
  2. | Analyzing of {
    1. continuation : Flambda2_identifiers.Continuation.t;
    2. is_exn_handler : bool;
    3. uses : Flambda2_simplify.Continuation_uses.t;
    }
  3. | Lifting_out_of of {
    1. continuation : Flambda2_identifiers.Continuation.t;
    }

The current continuation lifting status, stored in the dacc.

Printing function.

Prevent any lifting of continuation.

Delay the choice of lifting until the leaf of a continuation's handler.

Instruct simplify_let_cont to lift continuations.