More precise livenes analysis for locals under Asyncify

Open
#9,038 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
cpp, wasm
Domain
compilers

Research direction

Start in src/passes/Asyncify.cpp at the TODO around lines 1597–1599, and review the linked Binaryen issue #3739 and the motivating Emscripten pull request. Determine how liveness after a suspending call should affect saving externref locals; done means dead references are omitted while supported Asyncify behavior remains correct.

Written by the indexing model from the issue text.

Description

I've been trying to add an externref to emscripten here:
https://github.com/emscripten-core/emscripten/pull/26964

And its failing with: Fatal: Asyncify does not yet support non-number types, like references (see https://github.com/WebAssembly/binaryen/issues/3739).

Rather than push to land the fix to #3739, I think my particulur use case might be fixed by resolving this TODO in Asyncify:
https://github.com/WebAssembly/binaryen/blob/3029fbb717390af5d49914ba635b5458dd1c6efa/src/passes/Asyncify.cpp#L1597-L1599

The externref I'm using is not live after the call to the suspending function, so it should not need to be saved or restored.

How hard would it be to fix that TODO? Presumably it would make Asyncify in general more efficient?

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

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.

More from WebAssembly/binaryen

All issues in WebAssembly/binaryen

Similar issues

More Compilers issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.