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
Binaryen can unbox a value that does not escape, but does not handle more complex cases involving conditionals (e.g, if ... then 1. else 2.) or loops. It might be possible to do better in this cases. We should look at what heuristics are used in the OCaml compiler.
A more ambitious project would be to perform a global analysis of the program and perform unboxing across functions.
When a value is boxed but is used unboxed at some places, we could short-circuit the boxing/unboxing and use the value directly. Binaryen currently perform this optimization only in a closed-world setting. We could either implement it in Wasm_of_ocaml or modify the relevant Binaryen pass.
The text was updated successfully, but these errors were encountered:
Binaryen can unbox a value that does not escape, but does not handle more complex cases involving conditionals (e.g,
if ... then 1. else 2.
) or loops. It might be possible to do better in this cases. We should look at what heuristics are used in the OCaml compiler.A more ambitious project would be to perform a global analysis of the program and perform unboxing across functions.
When a value is boxed but is used unboxed at some places, we could short-circuit the boxing/unboxing and use the value directly. Binaryen currently perform this optimization only in a closed-world setting. We could either implement it in Wasm_of_ocaml or modify the relevant Binaryen pass.
The text was updated successfully, but these errors were encountered: