Skip to content

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

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

gh-148235: remove duplicate uops _LOAD_CONST_UNDER_INLINE(_BORROW) in JIT#148236
Fidget-Spinner merged 3 commits intopython:mainfrom
NekoAsakura:gh-148235/dedup-uop

Conversation

@NekoAsakura
Copy link
Copy Markdown
Contributor

@NekoAsakura NekoAsakura commented Apr 8, 2026

@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 gh-148235: remove duplicate uops _LOAD_CONST_UNDER_INLINE(_BORROW) in JIT Apr 8, 2026
@NekoAsakura
Copy link
Copy Markdown
Contributor 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
Contributor 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.

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
Contributor Author

Choose a reason for hiding this comment

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

Same reason.

Copy link
Copy Markdown
Member

@Fidget-Spinner Fidget-Spinner left a comment

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
78 checks passed
@NekoAsakura NekoAsakura deleted the gh-148235/dedup-uop branch April 8, 2026 12:10
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.

3 participants