Skip to content

gh-148235: remove duplicate uops _LOAD_CONST_UNDER_INLINE(_BORROW) in JIT - #148236

Merged
Fidget-Spinner merged 3 commits into
python:mainfrom
NekoAsakura:gh-148235/dedup-uop
Apr 8, 2026
Merged

Fidget-Spinner merged 3 commits into
python:mainfrom
NekoAsakura:gh-148235/dedup-uop

Conversation

@NekoAsakura

@NekoAsakura NekoAsakura commented Apr 8, 2026 •

Copy link
Copy Markdown
Member
@Fidget-Spinner

Copy link
Copy Markdown
Member

Sorry but I'd rather remove LOAD_CONST_UNDER_INLINE_X as the INSERT_X is clearer. Also the tests changes need fixing, thanks!

In the longer-term we should change INSERT_X... to LOAD_CONST_INLINE, SWAP X

@NekoAsakura NekoAsakura changed the title gh-148235: remove duplicate uops _INSERT_1_LOAD_CONST_INLINE(_BORROW) in JIT Apr 8, 2026
@NekoAsakura

Copy link
Copy Markdown
Member Author

Done :)

uops = get_opnames(ex)
self.assertNotIn("_UNARY_INVERT", uops)
self.assertIn("_INSERT_1_LOAD_CONST_INLINE_BORROW", uops)
self.assertIn("_LOAD_CONST_INLINE_BORROW", uops)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why this change?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

_INSERT_1_LOAD_CONST_INLINE_BORROW has no op_without_push entry on main, therefore not simplified away by remove_unneeded_uops.

Comment thread Python/bytecodes.c Resolved
self.assertIsNotNone(ex)
uops = get_opnames(ex)
self.assertNotIn("_REPLACE_WITH_TRUE", uops)
self.assertIn("_INSERT_1_LOAD_CONST_INLINE_BORROW", uops)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why this change?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Same reason.

@Fidget-Spinner Fidget-Spinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks

@Fidget-Spinner
Fidget-Spinner merged commit 7563585 into python:main Apr 8, 2026
74 checks passed
@NekoAsakura
NekoAsakura deleted the gh-148235/dedup-uop branch April 8, 2026 12:10
ljfp pushed a commit to ljfp/cpython that referenced this pull request Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants