Skip to content
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-116202: Incorporate invalidation check into _START_EXECUTOR. #118044

Merged

Conversation

markshannon
Copy link
Member

@markshannon markshannon commented Apr 18, 2024

The uop pair stats show that _START_EXECUTOR _CHECK_VALIDITY is the second most common pair and that every _START_EXECUTOR is followed by either a _CHECK_VALIDITY or _CHECK_VALIDITY_SET_IP.

This PR adds a validity check to _START_EXECUTOR allowing the optimizer to remove the redundant _CHECK_VALIDITYs.
This also reduces the number of validity checks in loops as traces are known to be valid at _JUMP_TO_TOP.

  _START_EXECUTOR
top:
  _CHECK_VALIDITY
  ...
  _JUMP_TO_TOP

becomes:

  _START_EXECUTOR
top:
  ...
  _JUMP_TO_TOP

Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

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

Makes sense!

@markshannon markshannon merged commit 7e6fa5f into python:main Apr 19, 2024
52 of 56 checks passed
@markshannon markshannon deleted the start-executor-check-invalid branch April 19, 2024 08:26
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.

2 participants