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-130415: Use `POP_TWO_LOAD_CONST_INLINE_BORROW` by savannahostrowski · Pull Request #134241 · python/cpython

Conversation

@savannahostrowski

@savannahostrowski savannahostrowski commented May 19, 2025 •
edited by bedevere-app Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member
  • Issue: Better constant narrowing in the JIT optimizer #130415

Sorry, something went wrong.

Uh oh!

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

All reactions
savannahostrowski added 2 commits May 19, 2025 11:22
@savannahostrowski
Use POP_TWO_LOAD_CONST_INLINE_BORROW
6614ae6
@savannahostrowski
Add newline back
37ccb18
@savannahostrowski
savannahostrowski requested a review from Fidget-Spinner as a code owner May 19, 2025 15:24
@bedevere-app bedevere-app Bot mentioned this pull request May 19, 2025
Better constant narrowing in the JIT optimizer #130415
Closed
13 of 17 tasks
@bedevere-app bedevere-app Bot added the awaiting core review label May 19, 2025
blurb-it Bot and others added 3 commits May 19, 2025 15:26
@blurb-it
📜🤖 Added by blurb_it.
3c19e43
@savannahostrowski
Fix rhs and lhs
6c7861c
@savannahostrowski
Merge branch 'use_pop_2' of https://github.com/savannahostrowski/cpython
1673250
 into use_pop_2
@Fidget-Spinner

Fidget-Spinner commented May 19, 2025

Copy link
Copy Markdown
Member

Thanks for the PR. I'd like to advocate for this PR #132733 which will simplify this PR quite a bit. All you'd have to do after that PR lands is to add pure to the current bytecode definition. Then if you want you can improve the cases generator to automatically insert the pops.

All reactions

Sorry, something went wrong.

Uh oh!

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

@savannahostrowski
savannahostrowski requested a review from brandtbucher May 19, 2025 15:37
@savannahostrowski

savannahostrowski commented May 19, 2025

Copy link
Copy Markdown
Member Author

Ah, I didn't know that work was happening. I'll add some tests and then add the annotations when your PR lands.

Fidget-Spinner reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

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

@Fidget-Spinner

Fidget-Spinner commented May 19, 2025

Copy link
Copy Markdown
Member

Thanks! The tests are definitely still gonna be very useful :).

All reactions

Sorry, something went wrong.

Uh oh!

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

@Fidget-Spinner

Fidget-Spinner commented Jun 27, 2025

Copy link
Copy Markdown
Member

@savannahostrowski sorry for blocking this PR! The base PR has landed.

You just have to replace the body in the optimizer_bytecodes.c with REPLACE_OPCODE_IF_EVALUATES_PURE(left, right) now.

All reactions

Sorry, something went wrong.

Uh oh!

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

@brandtbucher

brandtbucher commented Jun 27, 2025

Copy link
Copy Markdown
Member

It’ll also involve modifying the cases generator to insert the new instruction when there is a single output and it’s immortal, too.

All reactions

Sorry, something went wrong.

Uh oh!

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

@Fidget-Spinner

Fidget-Spinner commented Jun 27, 2025

Copy link
Copy Markdown
Member

We should also swap out _COMPARE_OP_INT to use the new style in this PR while we're at it I think.

All reactions

Sorry, something went wrong.

Uh oh!

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

@savannahostrowski

savannahostrowski commented Jul 21, 2025

Copy link
Copy Markdown
Member Author

Closing this in favour of a different approach using the new machinery Ken Jin introduced for pure ops.

All reactions

Sorry, something went wrong.

Uh oh!

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

@savannahostrowski savannahostrowski closed this Jul 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Fidget-Spinner Fidget-Spinner Awaiting requested review from Fidget-Spinner Fidget-Spinner is a code owner
@brandtbucher brandtbucher Awaiting requested review from brandtbucher

Uh oh!

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

Assignees

No one assigned

Labels

awaiting core review

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

@savannahostrowski @Fidget-Spinner @brandtbucher
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.