WebAssembly / WebAssembly/binaryen

Add support for Wasm components in wasm-opt

Open
#6,728 15 comments 14 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
WebAssembly
Stars
8.6k
Forks
885
Avg merge
1d 19h
Merged PRs (30d)
69

Description

wasm-opt does not support running on a Wasm component, that is the default with WASIp2. wasm-opt is used for example in LLVM to optimize compiled binaries (see https://github.com/llvm/llvm-project/pull/98373/), which is not possible in WASIp2 for now because of this lack of support.

A possible solution may be to iterate over a Wasm component and find the core modules within it, apply current wasm-opt optimizations on each core module, then repackage the component.

Remark: I suppose all of binaryen tools can add support for Wasm components. This issue is for wasm-opt specifically but can be transformed into a more general issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Begin at the wasm-opt entry point and reproduce its current behavior with a Wasm component. Trace how the component's core modules could be processed and the component repackaged, then establish tests covering optimization of embedded core modules and preservation of the resulting component structure.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, wasm
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.