Skip to content

gh-134584: Eliminate redundant refcounting from _CALL_ISINSTANCE #136077

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

noamcohen97
Copy link
Contributor

@noamcohen97 noamcohen97 commented Jun 28, 2025

@noamcohen97 noamcohen97 force-pushed the refcount-isinstance branch from 55119d3 to 6c04f67 Compare June 28, 2025 14:53
@noamcohen97 noamcohen97 marked this pull request as draft June 28, 2025 15:04
Copy link
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.

Sheesh. This is really good. You even handled the optimizer's constant propagation. Very cool!

We're blocked on Mark's TOS caching PR (see the main issue's comments), so we need to hold off on this for now.

@@ -2093,6 +2093,19 @@ def testfunc(n):
self.assertNotIn("_POP_CALL_ONE_LOAD_CONST_INLINE_BORROW", uops)
self.assertNotIn("_POP_CALL_TWO_LOAD_CONST_INLINE_BORROW", uops)

def test_call_isinstance_guards_pop_top(self):
Copy link
Member

Choose a reason for hiding this comment

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

Can't leave a comment on that line, but inside test_call_isinstance_guards_removed we should include the new opcode _SWAP_CALL_TWO_LOAD_CONST_INLINE_BORROW to ensure remove_unneeded_uops is still working as expected (I think it should be since you also updated op_without_push, but just to be sure :))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants