bytecodealliance / bytecodealliance/wasmtime
Cranelift: Consider rewriting small `br_table`s into conditional branch sequences
Open
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
Assessment
This issue has not been assessed yet.