bytecodealliance / bytecodealliance/wasm-tools

Add a top-down code generation option to `wasm-smith`

Open
#1,484 1 comment 0 reactions 0 assignees View on GitHub
wasm-smith
Dominant language
Rust
Stars
1.8k
Forks
351
Avg merge
16h 57m
Merged PRs (30d)
38

Description

Right now we generate bottom up, based on what is on the stack.

This means that we pre-filter instructions that require "rare" stacks, making their generation even rarer.

We should also add the ability to generate code top down, where we first choose the instruction we want to generate, and then ensure that the prerequisite operand values are also generated and pushed onto the stack first. This avoids the "pre-filter" and makes "rare" stacks more likely.

We could even switch between the two approaches within the same function body.

cc @alexcrichton @cfallin @jameysharp

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.