zijian-yi opened PR #14234 from zijian-yi:bitops-opt-rules to bytecodealliance:main:
<!--
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 review the Bytecode Alliance's AI tool usage policy at
https://github.com/bytecodealliance/governance/blob/main/AI_TOOL_POLICY.mdPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->This commit adds three bitops and shifts related mid-end optimization rules and filetests that target them. These filetests fail to optimize on main without these new rules.
(x << z) | (y << z) -> (x | y) << z popcnt(bswap(x)) -> popcnt(x) popcnt(bitrev(x)) == popcnt(x)
zijian-yi has marked PR #14234 as ready for review.
zijian-yi requested cfallin for a review on PR #14234.
zijian-yi requested wasmtime-compiler-reviewers for a review on PR #14234.
github-actions[bot] added the label cranelift on PR #14234.
github-actions[bot] added the label isle on PR #14234.
github-actions[bot] commented on PR #14234:
Subscribe to Label Action
cc @avanhatt, @cfallin, @fitzgen, @mmcloughlin
<details>
This issue or pull request has been labeled: "cranelift", "isle"Thus the following users have been cc'd because of the following labels:
- avanhatt: isle
- cfallin: isle
- fitzgen: isle
- mmcloughlin: isle
To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.
Learn more.
</details>
:thumbs_up: cfallin submitted PR review:
Looks good, and verifier passes with new verification queries -- thanks!
cfallin added PR #14234 Cranelift: add bitops and shifts related opt rules to the merge queue.
github-merge-queue[bot] removed PR #14234 Cranelift: add bitops and shifts related opt rules from the merge queue.
cfallin commented on PR #14234:
@zijian-yi this has a merge conflict due to a concurrent PR that just landed (not your fault) -- would you mind rebasing now? Thanks!
zijian-yi updated PR #14234.
zijian-yi commented on PR #14234:
@zijian-yi this has a merge conflict due to a concurrent PR that just landed (not your fault) -- would you mind rebasing now? Thanks!
Thank you! Done.
zijian-yi edited PR #14234:
<!--
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 review the Bytecode Alliance's AI tool usage policy at
https://github.com/bytecodealliance/governance/blob/main/AI_TOOL_POLICY.mdPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->This commit adds three bitops and shifts related mid-end optimization rules and filetests that target them. These filetests fail to optimize on main without these new rules.
(x << z) | (y << z) -> (x | y) << z popcnt(bswap(x)) -> popcnt(x) popcnt(bitrev(x)) -> popcnt(x)
cfallin has enabled auto merge for PR #14234.
cfallin added PR #14234 Cranelift: add bitops and shifts related opt rules to the merge queue.
:check: cfallin merged PR #14234.
cfallin removed PR #14234 Cranelift: add bitops and shifts related opt rules from the merge queue.
Last updated: Sep 20 2026 at 18:08 UTC