-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Refactoring the xarch perfScore logic to use a lookup table where trivial #117123
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
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
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.
Pull Request Overview
This PR refactors the x86/x64 instruction performance scoring by replacing many explicit getInsExecutionCharacteristics
cases with two lookup tables (insLatencyInfos
and insThroughputInfos
) and updating the instruction macros to include latency (lat
) and throughput (tp
) parameters.
- Updated
INST0
–INST5
macros ininstr.h
and related uses ininstr.cpp
andemitxarch.cpp
to acceptlat
andtp
beforett
andflags
. - Introduced
insLatencyInfos
andinsThroughputInfos
tables inemitxarch.cpp
, driving default latency/throughput. - Simplified the large
switch
ingetInsExecutionCharacteristics
to use the lookup tables in a unifieddefault
case, removing many individual case blocks.
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
File | Description |
---|---|
src/coreclr/jit/instr.h | Adjusted INST* macros to include new lat and tp fields |
src/coreclr/jit/instr.cpp | Updated name table macros to match the new macro signatures |
src/coreclr/jit/emitxarch.cpp | Added latency/throughput tables and replaced many cases with lookup in getInsExecutionCharacteristics |
Comments suppressed due to low confidence (1)
CC. @dotnet/jit-contrib, @AndyAyersMS for review. Just some cleanup/simplification of the perfScore logic for xarch to allow it being table driven where trivial to do. |
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.
Do you expect this to change perf scores anywhere?
No, I explicitly kept them "as is" for now. I do think there's some changes we could make to normalize values a bit more, but that should be separate I think. In particular I think the places we'd want to look at in the future would be resolving the mix between |
This does some basic cleanup of the xarch perfScore logic to use a lookup table for instructions where it's trivial to do. This makes it more clear that new instructions need to consider this field and makes it easier to see where custom handling does exist.