-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Labels
enhancementNew feature or requestNew feature or request
Description
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.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request