bytecodealliance / bytecodealliance/wasmtime

Cranelift: Consider rewriting small `br_table`s into conditional branch sequences

Open
#6,051 3 comments 0 reactions 0 assignees View on GitHub
cranelift:goal:optimize-speed
Dominant language
Rust
Stars
18.6k
Forks
1.8k
Avg merge
1d 18h
Merged PRs (30d)
126

Description

I'm seeing a bunch of 3-5 target `br_table`s in `spidermonkey.wasm`, and I suspect that a series of conditional branches might perform better than these small `br_table`s and their indirect jumps. That they are showing up in `spidermonkey.wasm` means that LLVM's Wasm backend is regularly emitting them, so this wouldn't be too overly specific of an optimization.

Could potentially do this in the mid-end or during lowering. Haven't thought too much about it.

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.