alexcrichton opened PR #6220 from alexcrichton:more-shift-opts
to bytecodealliance:main
:
This commit adds egraph optimization patterns for left-shifting a value and then right-shifting it as a form of sign extending its lower bits. This matches the behavior of the WebAssembly
i32.extend8_s
instruction, for example. Note that the lowering of that WebAssembly instruction does not use shifts, but historical versions of LLVM that didn't support the instruction, or versions with the instruction disabled, will use shifts instead.A second rule for reduction-of-extend being the same as the original value was added to keep an existing shift-related test passing as well.
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
alexcrichton requested abrown for a review on PR #6220.
alexcrichton requested wasmtime-compiler-reviewers for a review on PR #6220.
abrown submitted PR review.
alexcrichton updated PR #6220.
alexcrichton has enabled auto merge for PR #6220.
alexcrichton merged PR #6220.
Last updated: Nov 22 2024 at 17:03 UTC