gh-148285: Allow recording uops after specializing uops#148373
Open
adityakrmishra wants to merge 1 commit intopython:mainfrom
Open
gh-148285: Allow recording uops after specializing uops#148373adityakrmishra wants to merge 1 commit intopython:mainfrom
adityakrmishra wants to merge 1 commit intopython:mainfrom
Conversation
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Issue:
Currently,
analyzer.pyforces any uop withrecords_value == Trueto be at index 0. This prevents Tier 2 recording uops from safely trailing Tier 1 specializing uops.The Fix (V2):
Following feedback from @Sacul0457 on the previous PR, simply checking if the preceding uop was
tier == 1was too permissive (it allowed recording uops to follow any Tier 1 uop, not just specializing ones).This updated patch uses a strict positional
uop_indextracker inadd_macro().A recording uop is now only permitted if:
uop_index == 0(the very first uop).uop_index == 1AND the preceding uop's name explicitly starts with_SPECIALIZE_.CacheEffect(e.g.,unused/1) andflushparts do not increment theuop_index, ensuring they remain completely transparent.This strictly enforces the architecture while allowing structures like:
macro(X) = _SPECIALIZE_X + _RECORD_TOS_TYPE + unused/1 + _X;