Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE REQUEST] Unboxing #115

Open
vouillon opened this issue Oct 24, 2024 · 0 comments
Open

[FEATURE REQUEST] Unboxing #115

vouillon opened this issue Oct 24, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@vouillon
Copy link
Collaborator

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.

@vouillon vouillon added the enhancement New feature or request label Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant