bongjunj opened PR #11647 from bongjunj:fold-add-or-and 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 ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->This adds
(X | Y) + (X & Y) --> X +Y
bongjunj requested alexcrichton for a review on PR #11647.
bongjunj requested wasmtime-compiler-reviewers for a review on PR #11647.
bongjunj edited PR #11647.
github-actions[bot] commented on PR #11647:
Subscribe to Label Action
cc @cfallin, @fitzgen
<details>
This issue or pull request has been labeled: "cranelift", "isle"Thus the following users have been cc'd because of the following labels:
- cfallin: isle
- fitzgen: isle
To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.
Learn more.
</details>
bongjunj updated PR #11647.
bongjunj updated PR #11647.
bongjunj updated PR #11647.
bongjunj edited PR #11647.
bongjunj edited PR #11647:
<!--
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
-->This adds two simplifications
(X | Y) + (X & Y) --> X +Y
bongjunj edited PR #11647:
<!--
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
-->This adds two simplifications
(X | Y) + (X & Y) --> X +Yand(X & Y) + (X ^ Y) --> X | Y.
alexcrichton submitted PR review.
alexcrichton created PR review comment:
Also, for the bxor/band -> bor reduction mind swapping the
y xparameters to beingx ylike most other rules?
alexcrichton created PR review comment:
Could the commutative versions of these rules be added as well? For example
(rule (simplify (iadd ty (bxor ty y x) (band ty y x))) (bor ty y x)) (rule (simplify (iadd ty (band ty x y) (bor ty x y))) (iadd ty x y))
bongjunj submitted PR review.
bongjunj created PR review comment:
Thanks! I missed that.
bongjunj updated PR #11647.
bongjunj updated PR #11647.
alexcrichton merged PR #11647.
Last updated: Dec 06 2025 at 06:05 UTC