GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-131798: Optimize `_UNARY_INVERT` by noamcohen97 · Pull Request #135222 · python/cpython

Conversation

@noamcohen97

@noamcohen97 noamcohen97 commented Jun 6, 2025 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor
  • Issue: Better uop coverage in the JIT optimizer #131798

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
noamcohen97 added 4 commits June 6, 2025 01:22
@noamcohen97
optimize _UNARY_INVERT
285e47c
@noamcohen97
add test cases
54f6df3
@noamcohen97
add news entry
94a1907
@noamcohen97
do not replace const ops
4b99dac
@noamcohen97
noamcohen97 requested a review from Fidget-Spinner as a code owner June 6, 2025 16:06
@bedevere-app bedevere-app Bot added the awaiting review label Jun 6, 2025
@bedevere-app bedevere-app Bot mentioned this pull request Jun 6, 2025
Better uop coverage in the JIT optimizer #131798
Open
Fidget-Spinner
Fidget-Spinner approved these changes Jun 6, 2025
View reviewed changes

@Fidget-Spinner Fidget-Spinner left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

nice!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Jun 6, 2025
brandtbucher
brandtbucher approved these changes Jun 6, 2025
View reviewed changes

@brandtbucher brandtbucher left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Looks good, can you add a test for the bool case?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Python/optimizer_bytecodes.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

noamcohen97 added 3 commits June 7, 2025 09:48
@noamcohen97
add bool test case
ab7c1c7
@noamcohen97
better type-check
de53184
@noamcohen97
fix news entry
95f5ee2
@noamcohen97

noamcohen97 commented Jun 7, 2025

Copy link
Copy Markdown
Contributor Author

Thanks for reviewing @brandtbucher and @Fidget-Spinner.
I added a test case for booleans

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

noamcohen97 added 2 commits June 7, 2025 10:00
@noamcohen97
regen cases
7e831ed
@noamcohen97
ignore warnings
e8015e3
@brandtbucher

brandtbucher commented Jun 7, 2025

Copy link
Copy Markdown
Member

Hm, I didn't realize we had deprecated bitwise inversion on bool. Let's just drop bool from the optimizer, it's not worth it.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

noamcohen97 added 2 commits June 9, 2025 11:31
@noamcohen97
drop bool support
9346547
@noamcohen97
Merge branch 'main' into optimize-unary-invert
e57d095
@noamcohen97

noamcohen97 commented Jun 9, 2025

Copy link
Copy Markdown
Contributor Author

Let's just drop bool from the optimizer, it's not worth it.

Sounds good

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Fidget-Spinner
Fidget-Spinner merged commit b150b6a into python:main Jun 9, 2025
@bedevere-app bedevere-app Bot removed the awaiting merge label Jun 9, 2025
@noamcohen97
noamcohen97 deleted the optimize-unary-invert branch June 9, 2025 10:48
lkollar pushed a commit to lkollar/cpython that referenced this pull request Jun 19, 2025
@noamcohen97 @lkollar
pythongh-131798: Optimize _UNARY_INVERT (pythonGH-135222)
7090d7d
Pranjal095 pushed a commit to Pranjal095/cpython that referenced this pull request Jul 12, 2025
@noamcohen97 @Pranjal095
pythongh-131798: Optimize _UNARY_INVERT (pythonGH-135222)
487fa52
taegyunkim pushed a commit to taegyunkim/cpython that referenced this pull request Aug 4, 2025
@noamcohen97 @taegyunkim
pythongh-131798: Optimize _UNARY_INVERT (pythonGH-135222)
ac4eca9
Agent-Hellboy pushed a commit to Agent-Hellboy/cpython that referenced this pull request Aug 19, 2025
@noamcohen97 @Agent-Hellboy
pythongh-131798: Optimize _UNARY_INVERT (pythonGH-135222)
9bfc7f8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Fidget-Spinner Fidget-Spinner Fidget-Spinner approved these changes
@brandtbucher brandtbucher brandtbucher approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@noamcohen97 @brandtbucher @Fidget-Spinner
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.