You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently continuation aliases are quite restrictive: they only apply when a continuation [k]'s handler is exactly an apply_cont of another continuation [k'] with exactly the same arguments, of the form: let_cont k x_1 ... x_n = apply_cont k' x_1 .... x_n. In that case, the continuation alias mechanism replaces calls to [k] by calls to [k'] during the upwards pass.
This is quite restrictive, and actually, we could substitute any continuation [k] whose handler is only an apply_cont, after applying the required renaming and reordering of params/arguments (plus addition of constants arguments), so that we could do the substitution in the following case: let_cont k x y = apply_cont k' y 0 x.
The text was updated successfully, but these errors were encountered:
Replace the continuation alias mechanism with a more general
continuation shortcut mechanism.
A continuation shortcut is a let_cont whose body is an arbitrary
apply_cont. A continuation alias is a special case of continuation
shortcuts where the arguments of the apply_cont are exactly the
parameters of the let_cont.
Shortcuts are detected and resolved in the upwards pass after rewriting
the apply_cont, so that we should never output code containing
continuation shortcuts (except when used as return or exception
continuation).
This should help generate simpler control flow for later Simplify or
To_cmm passes, and make the output of `-dflambda` easier to follow.
Fixesocaml-flambda#3210
Currently continuation aliases are quite restrictive: they only apply when a continuation [k]'s handler is exactly an apply_cont of another continuation [k'] with exactly the same arguments, of the form:
let_cont k x_1 ... x_n = apply_cont k' x_1 .... x_n
. In that case, the continuation alias mechanism replaces calls to [k] by calls to [k'] during the upwards pass.This is quite restrictive, and actually, we could substitute any continuation [k] whose handler is only an apply_cont, after applying the required renaming and reordering of params/arguments (plus addition of constants arguments), so that we could do the substitution in the following case:
let_cont k x y = apply_cont k' y 0 x
.The text was updated successfully, but these errors were encountered: