Uh oh!
There was an error while loading. Please reload this page.
gh-148285: Allow recording uops after specializing uops - #148367
gh-148285: Allow recording uops after specializing uops#148367adityakrmishra wants to merge 0 commit into
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 |
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 |
Sacul0457
commented
Apr 11, 2026
Hmm, while this does allow
Example that violates both: macro(LOAD_SUPER_ATTR) =_LOAD_SUPER_ATTR+// tier1 uop_RECORD_TOS_TYPE+_SPECIALIZE_LOAD_SUPER_ATTR+_PUSH_NULL_CONDITIONAL;BUT, you should wait for a core dev to review this as I may have misunderstood something. |
e35d157 to
639f218CompareMost 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 |
adityakrmishra
commented
Apr 11, 2026
@Sacul0457 Good catch! You are entirely correct—my previous logic conflated all tier1 uops with specializing uops, which was too permissive. I also tangled up the Git history on this branch, so I have closed this PR and opened a clean one with a much stricter positional index check that specifically guards for SPECIALIZE prefixes. The new PR is here: #148373 |
The Issue:
Currently,
analyzer.pyuses a strict positionalfirst = Truecheck when validatingmacrostructures. This strictly forces any uop withrecords_value == Trueto be at index 0, which prevents Tier 2 recording uops from safely trailing Tier 1 specializing uops.The Fix:
Replaced the boolean
firstcheck with a state tracker (valid_recording_pos) inadd_macro().valid_recording_posstarts asTrue.Trueif the parsed part is a specializing uop (uop.properties.tier == 1).CacheEffectandflushparts.Falsefor any other instruction, properly closing the gate.This safely allows structures like:
macro(X) = _SPECIALIZE_X + _RECORD_TOS_TYPE + unused/1 + _X;