Skip to content
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

[mypyc] Fix invalid unlikely() in certain rare branches #11939

Merged
merged 1 commit into from
Jan 10, 2022

Conversation

JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented Jan 8, 2022

If we switch true/false branches, we also need to switch between
likely/unlikely.

This has an impact at least on accessing module-level final attributes
with non-constant initializers. I couldn't see a significant
difference in benchmark results compare to master, but this seems to
help together with some other work-in-progress improvements I have
been working on (and the old behavior was clearly wrong).

If we switch true/false branches, we also need to switch between
likely/unlikely.

This has an impact at least on accessing module-level final attributes
with non-constant initializers. I couldn't see a significant
difference in benchmark results on master, but this seems to help
together with some other work-in-progress improvements I have been
working on.
@JukkaL JukkaL requested a review from 97littleleaf11 January 8, 2022 11:11
Copy link
Collaborator

@97littleleaf11 97littleleaf11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@JukkaL JukkaL merged commit 41a7934 into master Jan 10, 2022
@JukkaL JukkaL deleted the mypyc-unlikely-fix branch January 10, 2022 12:39
tushar-deepsource pushed a commit to DeepSourceCorp/mypy that referenced this pull request Jan 20, 2022
If we switch true/false branches, we also need to switch between
likely/unlikely.

This has an impact at least on accessing module-level final attributes
with non-constant initializers. I couldn't see a significant
difference in benchmark results compared to master, but this seems to 
help together with some other work-in-progress improvements I have 
been working on.
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.

2 participants