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-148211: decompose `_POP_TOP_LOAD_CONST_INLINE(_BORROW)` in JIT by NekoAsakura · Pull Request #148230 · python/cpython

Conversation

@NekoAsakura

@NekoAsakura NekoAsakura commented Apr 7, 2026 •
edited by bedevere-app Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

The composite uop definitions in bytecodes.c are kept for now — remove_unneeded_uops still produces them as intermediate forms during push/pop cancellation.

cpython/Python/optimizer_analysis.c

Lines 610 to 653 in 4ff8b07

const uint16_t op_without_push[MAX_UOP_ID + 1] = {
[_COPY] = _NOP,
[_LOAD_CONST_INLINE] = _NOP,
[_LOAD_CONST_INLINE_BORROW] = _NOP,
[_LOAD_CONST_UNDER_INLINE] = _POP_TOP_LOAD_CONST_INLINE,
[_LOAD_CONST_UNDER_INLINE_BORROW] = _POP_TOP_LOAD_CONST_INLINE_BORROW,
[_LOAD_FAST] = _NOP,
[_LOAD_FAST_BORROW] = _NOP,
[_LOAD_SMALL_INT] = _NOP,
[_POP_TOP_LOAD_CONST_INLINE] = _POP_TOP,
[_POP_TOP_LOAD_CONST_INLINE_BORROW] = _POP_TOP,
[_POP_TWO_LOAD_CONST_INLINE_BORROW] = _POP_TWO,
[_POP_CALL_ONE_LOAD_CONST_INLINE_BORROW] = _POP_CALL_ONE,
[_POP_CALL_TWO_LOAD_CONST_INLINE_BORROW] = _POP_CALL_TWO,
[_SHUFFLE_2_LOAD_CONST_INLINE_BORROW] = _POP_CALL_ONE_LOAD_CONST_INLINE_BORROW,
};
const bool op_skip[MAX_UOP_ID + 1] = {
[_NOP] = true,
[_CHECK_VALIDITY] = true,
[_CHECK_PERIODIC] = true,
[_SET_IP] = true,
};
const uint16_t op_without_pop[MAX_UOP_ID + 1] = {
[_POP_TOP] = _NOP,
[_POP_TOP_NOP] = _NOP,
[_POP_TOP_INT] = _NOP,
[_POP_TOP_FLOAT] = _NOP,
[_POP_TOP_UNICODE] = _NOP,
[_POP_TOP_LOAD_CONST_INLINE] = _LOAD_CONST_INLINE,
[_POP_TOP_LOAD_CONST_INLINE_BORROW] = _LOAD_CONST_INLINE_BORROW,
[_POP_TWO] = _POP_TOP,
[_POP_TWO_LOAD_CONST_INLINE_BORROW] = _POP_TOP_LOAD_CONST_INLINE_BORROW,
[_POP_CALL_TWO_LOAD_CONST_INLINE_BORROW] = _POP_CALL_ONE_LOAD_CONST_INLINE_BORROW,
[_POP_CALL_ONE_LOAD_CONST_INLINE_BORROW] = _POP_CALL_LOAD_CONST_INLINE_BORROW,
[_POP_CALL_TWO] = _POP_CALL_ONE,
[_POP_CALL_ONE] = _POP_CALL,
};
const uint16_t op_without_pop_null[MAX_UOP_ID + 1] = {
[_POP_CALL] = _POP_TOP,
[_POP_CALL_LOAD_CONST_INLINE_BORROW] = _POP_TOP_LOAD_CONST_INLINE_BORROW,
};

Specifically, these composites chain through _POP_TOP_LOAD_CONST_INLINE_BORROW in the op_without_push / op_without_pop / op_without_pop_null tables:

  • _POP_TWO_LOAD_CONST_INLINE_BORROW
  • _POP_CALL_LOAD_CONST_INLINE_BORROW
  • _POP_CALL_ONE_LOAD_CONST_INLINE_BORROW
  • _POP_CALL_TWO_LOAD_CONST_INLINE_BORROW
  • _SHUFFLE_2_LOAD_CONST_INLINE_BORROW

Additionally, _LOAD_CONST_UNDER_INLINE(_BORROW) references _POP_TOP_LOAD_CONST_INLINE(_BORROW) as a target in op_without_push — those table entries would need updating too.

Once these dependents are decomposed, the definitions can be fully removed.

  • Issue: Refactor the JIT uops #148211

Sorry, something went wrong.

Uh oh!

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

All reactions
@NekoAsakura
pythongh-148211: decompose _POP_TOP_LOAD_CONST_INLINE(_BORROW) in JIT
0c407bd
@NekoAsakura
NekoAsakura requested review from Fidget-Spinner, markshannon, savannahostrowski and tomasr8 as code owners April 7, 2026 19:35
@bedevere-app bedevere-app Bot added the awaiting review label Apr 7, 2026
@bedevere-app bedevere-app Bot mentioned this pull request Apr 7, 2026
Refactor the JIT uops #148211
Closed
@Fidget-Spinner

Fidget-Spinner commented Apr 7, 2026

Copy link
Copy Markdown
Member

Feel free to remove the composite uops altogether, including removing them from remove_unneeded_uops!

All reactions

Sorry, something went wrong.

Uh oh!

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

@Fidget-Spinner Fidget-Spinner added the skip news label Apr 7, 2026
@Fidget-Spinner

Fidget-Spinner commented Apr 7, 2026

Copy link
Copy Markdown
Member

Ah wait, it seems this is quite hard to remove from the unneeded ops pass without modifying it heavily. So let's skip that for now. Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

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

Fidget-Spinner
Fidget-Spinner approved these changes Apr 7, 2026
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.

LGTM. Thanks a lot!

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Python/optimizer_analysis.c Resolved

Uh oh!

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

@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Apr 7, 2026
@NekoAsakura NekoAsakura mentioned this pull request Apr 8, 2026
Remove duplicate uops _LOAD_CONST_UNDER_INLINE(_BORROW) in JIT #148235
Closed
@Fidget-Spinner

Fidget-Spinner commented Apr 8, 2026

Copy link
Copy Markdown
Member

Please fix the merge conflicts from the other PR. Thank you!

All reactions

Sorry, something went wrong.

Uh oh!

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

@NekoAsakura
Merge branch 'main' into pythongh-148211/decompose-pop-top
81d854d
@NekoAsakura

NekoAsakura commented Apr 8, 2026

Copy link
Copy Markdown
Member Author

Done :)

All reactions

Sorry, something went wrong.

Uh oh!

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

NekoAsakura added 2 commits April 8, 2026 21:32
@NekoAsakura
Merge branch 'main' into pythongh-148211/decompose-pop-top
a8abce8
@NekoAsakura
pythongh-148211: decompose _POP_TOP_LOAD_CONST_INLINE(_BORROW) in JIT
d6e454a
@Fidget-Spinner
Fidget-Spinner merged commit d2fa4b2 into python:main Apr 8, 2026
78 checks passed

Uh oh!

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

@bedevere-app bedevere-app Bot removed the awaiting merge label Apr 8, 2026
@NekoAsakura
NekoAsakura deleted the gh-148211/decompose-pop-top branch April 8, 2026 15:22
@NekoAsakura NekoAsakura mentioned this pull request Apr 9, 2026
gh-148211: decompose [_POP_CALL_X/_SHUFFLE_2]_LOAD_CONST_INLINE_BORROW in JIT #148313
Merged
ljfp pushed a commit to ljfp/cpython that referenced this pull request Apr 25, 2026
@NekoAsakura @ljfp
pythongh-148211: decompose _POP_TOP_LOAD_CONST_INLINE(_BORROW) in J…
7f7ba3d
…IT (pythonGH-148230)
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
@markshannon markshannon Awaiting requested review from markshannon markshannon is a code owner
@tomasr8 tomasr8 Awaiting requested review from tomasr8 tomasr8 is a code owner
@savannahostrowski savannahostrowski Awaiting requested review from savannahostrowski

Uh oh!

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

Assignees

No one assigned

Labels

skip news

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.

2 participants

@NekoAsakura @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.