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

gh-115480: Type propagate _BINARY_OP_ADD_UNICODE #115710

Merged
merged 4 commits into from
Mar 1, 2024

Conversation

Fidget-Spinner
Copy link
Member

@Fidget-Spinner Fidget-Spinner commented Feb 20, 2024

@Fidget-Spinner
Copy link
Member Author

Needs #115686 to be merged first.

Python/tier2_redundancy_eliminator_bytecodes.c Outdated Show resolved Hide resolved
Python/tier2_redundancy_eliminator_bytecodes.c Outdated Show resolved Hide resolved
Lib/test/test_capi/test_opt.py Outdated Show resolved Hide resolved
@mdboom mdboom mentioned this pull request Feb 28, 2024
32 tasks
Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

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

Let's go ahead and merge this.

Comment on lines +858 to +861
a + a
a + a
a + a
a + a
Copy link
Member

Choose a reason for hiding this comment

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

Sooner or later we'll have a peephole pass that will delete the generated code for this completely. Is there a reason you're not doing something like a = a + a?

Copy link
Member Author

Choose a reason for hiding this comment

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

That transforms it to BINARY_OP_INPLACE_ADD_UNICODE sadly. Which is an unsupported opcode, so the trace ends there.

@Fidget-Spinner Fidget-Spinner merged commit ff96b81 into python:main Mar 1, 2024
50 checks passed
@Fidget-Spinner Fidget-Spinner deleted the binary_op_add_unicode branch March 1, 2024 19:40
woodruffw pushed a commit to woodruffw-forks/cpython that referenced this pull request Mar 4, 2024
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 25, 2024
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants