Skip to content

[InstCombine] isFreeToInvert(): constant expressions aren't free to i… #2987

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 24, 2021

Conversation

fhahn
Copy link

@fhahn fhahn commented May 21, 2021

…nvert (PR50370)

This fixes https://bugs.llvm.org/show_bug.cgi?id=50370,
which reports a yet another endless combine loop,
this one regressed from 554b1bc,
which fixed yet another endless combine loop (PR50308)

This code had fallen into the very typical pitfall of forgetting
that constant expressions exist, and they aren't free to invert,
because the not won't be absorbed by the "constant",
but will remain a (constant) expression...

@fhahn fhahn force-pushed the instcombine-loop branch from ba662ff to 19e73d4 Compare May 21, 2021 16:46
@fhahn
Copy link
Author

fhahn commented May 21, 2021

@swift-ci please test

…nvert (PR50370)

This fixes https://bugs.llvm.org/show_bug.cgi?id=50370,
which reports a yet another endless combine loop,
this one regressed from 554b1bc,
which fixed yet another endless combine loop (PR50308)

This code had fallen into the very typical pitfall of forgetting
that constant expressions exist, and they aren't free to invert,
because the `not` won't be absorbed by the "constant",
but will remain a (constant) expression...

(cherry-picked from e35a9ec)
@fhahn fhahn force-pushed the instcombine-loop branch from 19e73d4 to 9399292 Compare May 22, 2021 10:32
@fhahn
Copy link
Author

fhahn commented May 22, 2021

@swift-ci please test

@hyp
Copy link

hyp commented May 24, 2021

Merging this in.

@hyp hyp merged commit 22c2c44 into swiftlang:apple/stable/20210107 May 24, 2021
@fhahn fhahn deleted the instcombine-loop branch May 25, 2021 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants