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

Include register selection heuristics in "Allocating Registers" table #52513

Merged
merged 6 commits into from
May 10, 2021

Conversation

kunalspathak
Copy link
Member

Improve the "Allocating Registers" table that is printed in JitDump to also include which heuristics was used to select the register. It comes handy when trying to figure out why a particular register was selected.

Here is the diff of old vs. new table:
image

The "Final allocation" table is untouched because it doesn't have the register selection heuristics information.

As part of the change, I have introduced lsra_score.h (suggestion for better name are welcome) that contains the score names and I use it to populate RegisterScore enum. Also, I have renamed lsrastats.h to lsra_stats.h (for consistent naming) and moved the score specific entries into lsra_score.h. LsraStat enum is populated from lsra_score.h as well as lsra_stats.h.

Other changes include space adjustments to print the table systematically.

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label May 9, 2021
@kunalspathak
Copy link
Member Author

@dotnet/jit-contrib

REG_SEL_DEF(FREE, 0x10000, "FREE ") // It is not currently assigned to an *active* interval

// These are the original criteria for comparing registers that are free.
REG_SEL_DEF(CONST_AVAILABLE, 0x08000, "CONST") // It is a constant value that is already in an acceptable register.
Copy link
Member Author

Choose a reason for hiding this comment

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

Suggestions welcome for better 5 letter abbreviation for the scores.

Copy link
Member

@AndyAyersMS AndyAyersMS left a comment

Choose a reason for hiding this comment

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

LGTM

@kunalspathak kunalspathak merged commit 05b646c into dotnet:main May 10, 2021
@karelz karelz added this to the 6.0.0 milestone May 20, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Jun 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants