Skip to content

[MISched] Add statistics for heuristics #137981

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

Merged
merged 1 commit into from
May 9, 2025
Merged

Conversation

c-rhodes
Copy link
Collaborator

When diagnosing scheduling issues it can be useful to know which heuristics are driving the scheduler. This adds pre-RA and post-RA statistics for all heuristics.

@c-rhodes c-rhodes requested review from MatzeB and davemgreen April 30, 2025 15:53
@c-rhodes
Copy link
Collaborator Author

I've been investigating a couple of scheduler issues recently and while it's possible to see what heuristics are driving it in debug output and with grep ("Pick "), I figured it would be good if we just had stats for this, perhaps others will also find this useful.

@mshockwave mshockwave self-requested a review April 30, 2025 16:16
Copy link
Member

@mshockwave mshockwave left a comment

Choose a reason for hiding this comment

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

On a related note, I've been thinking about improving the trace output of MachineScheduler because I alway found some messages a bit difficult to comprehend, I'm wondering what's your thoughts?

@c-rhodes
Copy link
Collaborator Author

c-rhodes commented May 1, 2025

On a related note, I've been thinking about improving the trace output of MachineScheduler because I alway found some messages a bit difficult to comprehend, I'm wondering what's your thoughts?

I think that's a great idea I also found it difficult, particularly when scheduling is enabled both pre and post register-allocation!

Copy link
Collaborator

@davemgreen davemgreen left a comment

Choose a reason for hiding this comment

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

This looks like a fair number of statistics but they sound useful. LGTM

Copy link
Member

@mshockwave mshockwave left a comment

Choose a reason for hiding this comment

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

LGTM. I think these counters will be useful during development.
It's true that the sheer number of new statistic counters looks a little scary, but IMHO users could always opt-out so I think it's fine.

When diagnosing scheduling issues it can be useful to know which
heuristics are driving the scheduler. This adds pre-RA and post-RA
statistics for all heuristics.
@c-rhodes
Copy link
Collaborator Author

c-rhodes commented May 9, 2025

precommit keeps failing but I dont believe the test failures are because of this patch, so going to land.

@c-rhodes c-rhodes merged commit cdde6a6 into llvm:main May 9, 2025
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants