Skip to content

[FEATURE REQUEST] Unboxing #115

@vouillon

Description

@vouillon

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

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions