-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
gh-131798: JIT: Optimize _CALL_TYPE_1
when the result is known
#135194
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
Conversation
The test failures should be fixed by #135204, let me update main to make sure CI is all green :) |
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.
Even more JIT magic, I love it.
@@ -1806,7 +1826,6 @@ def testfunc(n): | |||
self.assertEqual(res, TIER2_THRESHOLD) | |||
self.assertIsNotNone(ex) | |||
uops = get_opnames(ex) | |||
self.assertIn("_CALL_TYPE_1", uops) |
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.
Super cool when older tests like this "break" with a new optimization. :)
Followup to #134369 (comment)
This completely removes
_CALL_TYPE_1
when the abstract interpreter is able to deduce the result (by knowing the type of the argument).For example, for something like
type(42)
, we currently doNote that we still do the call even when we know the result.
In this PR, when the result is known,
_CALL_TYPE_1
is replaced with_POP_CALL_ONE_LOAD_CONST_INLINE_BORROW
:Thanks to some previous work on optimizing
remove_unneeded_uops
this becomes just:that is, the entire call is replaced with a load.