Skip to content

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
@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