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

[NFC] Move HeapType::isBottom() to header #7150

Merged
merged 3 commits into from
Dec 13, 2024
Merged

Conversation

tlively
Copy link
Member

@tlively tlively commented Dec 13, 2024

This makes Precompute about 5% faster on a WasmGC binary.

Inspired by #6931.

Since multivalue was standardized, WebAssembly has supported not only
multiple results but also an arbitrary number of inputs on control flow
structures, but until now Binaryen did not support control flow input.
Binaryen IR still has no way to represent control flow input, so lower
it away using scratch locals in IRBuilder. Since both the text and
binary parsers use IRBuilder, this gives us full support for parsing
control flow inputs.

The lowering scheme is mostly simple. A local.set writing the control
flow inputs to a scratch local is inserted immediately before the
control flow structure begins and a local.get retrieving those inputs is
inserted inside the control flow structure before the rest of its body.
The only complications come from ifs, in which the inputs must be
retrieved at the beginning of both arms, and from loops, where branches
to the beginning of the loop must be transformed so their values are
written to the scratch local along the way.

Resolves #6407.
This makes Precompute about 5% faster on a WasmGC binary.

Inspired by #6931.
@tlively tlively requested a review from kripken December 13, 2024 20:04
Base automatically changed from control-flow-inputs to main December 13, 2024 21:23
@tlively tlively merged commit 484adec into main Dec 13, 2024
13 checks passed
@tlively tlively deleted the heaptype-isbottom-header branch December 13, 2024 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants