Skip to content

Backport "eq of parts" fold with logical ops #113

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 2 commits into from
Aug 26, 2021

Conversation

nikic
Copy link

@nikic nikic commented Aug 26, 2021

While the actual optimization for rust-lang/rust#83585 is part of LLVM 13, it did not trigger for logical operations. This backports the necessary patch.

I figured it would make sense to backport this rather than wait for another release cycle.

nikic added 2 commits August 26, 2021 20:19
We currently only handle this with a bitwise and/or instruction,
but not a logical.

(cherry picked from commit be4b836)
The pattern matched here is too complex for the general logical
and/or to bitwise and/or conversion to trigger. However, the
fold is poison-safe, so match it with a select root as well:

https://alive2.llvm.org/ce/z/vNzzSg
https://alive2.llvm.org/ce/z/Beyumt
(cherry picked from commit fafe5a6)
@cuviper
Copy link
Member

cuviper commented Aug 26, 2021

LGTM.

Does this need an upstream 13.x backport? Maybe not if it's just a nice-to-have optimization.

@cuviper cuviper merged commit 411cf42 into rust-lang:rustc/13.0-2021-08-08 Aug 26, 2021
@cuviper
Copy link
Member

cuviper commented Aug 26, 2021

Argh, I didn't mean to squash this! I could force-push fix that, if we care...

@eddyb
Copy link
Member

eddyb commented Aug 27, 2021

Argh, I didn't mean to squash this! I could force-push fix that, if we care...

I think the repository settings can be changed (was it in branch protection?) to disable that mode.

@nikic
Copy link
Author

nikic commented Aug 27, 2021

Does this need an upstream 13.x backport? Maybe not if it's just a nice-to-have optimization.

Yeah, this is just nice to have, so don't need an upstream backport.

Argh, I didn't mean to squash this! I could force-push fix that, if we care...

Don't think it really matters...

vext01 pushed a commit to vext01/llvm-project that referenced this pull request Feb 26, 2024
More work on lowering LLVMIR to YKIR.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants