-
-
Notifications
You must be signed in to change notification settings - Fork 34.1k
GH-144179: Use recorded values to make optimizer more robust #144437
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
GH-144179: Use recorded values to make optimizer more robust #144437
Conversation
* Add three new symbol kinds * Do not smuggle code object in _PUSH_FRAME operand * Fix small bug in predicate analysis
Fidget-Spinner
left a comment
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.
You need tests for the new symbolic types in the optimizer_symbols.c as well.
| tier2 op(_GUARD_CODE, (version/2 -- )) { | ||
| PyObject *code = PyStackRef_AsPyObjectBorrow(frame->f_executable); | ||
| EXIT_IF(code == Py_None); | ||
| EXIT_IF(((PyCodeObject *)code)->co_version != version); |
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.
Why do we need this? Doesn't a _CHECK_VALIIDTY suffice?
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.
_CHECK_VALIDITY only checks if the executor is valid, not that we are executing the expected path.
We need to check that we have the expected code object.
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.
I don't remember: do we have code version watchers? if so they should work with _CHECK_VALIDITY right?
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.
Watchers only work if they've been wired up, which is the job of the optimizer, not the front-end.
| sym->tag = JIT_SYM_RECORDED_VALUE_TAG; | ||
| sym->recorded_value.known_type = true; | ||
| sym->recorded_value.value = value; | ||
| } |
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.
Why do we not set bottom here and for the one below?
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.
I presume you mean when sym->cls.type != Py_TYPE(value).
I'll add that.
…ythonGH-144437) * Add three new symbol kinds * Do not smuggle code object in _PUSH_FRAME operand * Fix small bug in predicate analysis
Uh oh!
There was an error while loading. Please reload this page.