WebAssembly / WebAssembly/binaryen
Avoid extend/wrap to 64 bits when 32 are enough
Open
@kripken is already working on this.
Since Sep 6, 2022.
- Dominant language
- WebAssembly
- Stars
- 8.6k
- Forks
- 885
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 69
Description
E.g.
(i32.wrap_i64
(i64.add
(i64.extend_i32_u
(local.get $0)
)
(i64.const 8)
)
)
=->
(i32.add
(local.get $0)
(i32.const 8)
)
This is an example of a more general rule: we could avoid extending and wrapping if the work in the middle will not matter after the wrapping.
Found by the superoptimizer #4994 (for comparison to other findings: rule #0, benefit 1560922).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.